first commit

This commit is contained in:
2026-09-09 09:14:28 +08:00
commit 5343198112
5199 changed files with 1052895 additions and 0 deletions
@@ -0,0 +1,513 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
#qsmEditor .w-e-text-container {
height: 200px !important;
}
.btDiv {
cursor: pointer;
}
.btDiv:hover {
background-color: rgb(240, 240, 240);
}
.shou {
cursor: pointer;
}
.issue {
cursor: pointer;
padding: 20px 0;
}
.issue:hover {
background-color: rgb(240, 240, 240);
}
.el-divider {
background-color: #409EFF;
}
.el-divider__text {
color: #409EFF;
}
.inputParent input {
border: none;
border-bottom: 1px solid rgb(220, 223, 230);
border-radius: 0;
}
.issueList > .el-table__header-wrapper {
display: none;
}
.issueList .el-table__expanded-cell {
background-color: rgb(250, 250, 250) !important;
}
.el-table .last-row {
background-color: rgb(250, 250, 250);
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="btn-group tool-button mt5">
<el-input placeholder="请输入内容" v-model="pageForm.qtitle">
<template slot="prepend">标题</template>
</el-input>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="doSearch" icon="el-icon-search"
style="background-color:#409eff;color: white;"></el-button>
</div>
</el-card>
<el-card class="mt20" shadow="never">
<el-table
:data="tableData"
header-align="center"
size="medium"
style="width: 100%"
>
<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="qtitle">
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="说明"
prop="qsm"
show-overflow-tooltip="true">
<template scope="scope">
<div v-html="scope.row.qsm" v-if="scope.row.qsm">{{scope.row.qsm}}</div>
<span v-else>暂无</span>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="创建人"
prop="username">
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="创建时间"
prop="qctime">
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="类型"
prop="qlx">
<template scope="scope">
<span style="color: #67C23A" v-if="scope.row.qlx==1">问卷调查</span>
<span style="color: #67C23A" v-if="scope.row.qlx==2">在线答题</span>
<span style="color: #67C23A" v-if="scope.row.qlx==3">购物问卷</span>
<span style="color: #67C23A" v-if="scope.row.qlx==4">意向选择</span>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="状态"
prop="qflag">
<template scope="scope">
<span style="color: #E6A23C" v-if="scope.row.qflag==1">未开启</span>
<span style="color: #67C23A" v-if="scope.row.qflag==2">已开启</span>
<span style="color: #F56C6C" v-if="scope.row.qflag==3">已关闭</span>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="操作" width="250px">
<template scope="{row}">
<el-button @click="openFill(row.qid,row.activityuserscopeid)" plain size="small"
type="primary">填写问卷
</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
:current-page="pageForm.pageNumber"
:page-size="pageForm.pageSize"
:page-sizes="[10, 20, 30, 50]"
:total="pageForm.totalCount"
@current-change="pageNumberChange"
@size-change="pageSizeChange"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</el-row>
</el-card>
</template>
<template #view>
<div style="padding-left: 20px;padding-right: 20px">
<el-row style="text-align: center">
<h2>{{viewData.qtitle}}</h2>
</el-row>
<el-row style="margin-bottom: 20px">
<div v-html="viewData.qsm"></div>
</el-row>
<el-row style="border-bottom: 1px solid rgb(200,200,200);padding: 20px 0;margin-bottom: 20px"
v-for="issue,idx in viewData.issues">
<el-col :span="1">
<span style="color: red" v-if="issue.iisbd">*</span>
<span style="font-weight: bolder">{{idx+1}}.</span>
</el-col>
<el-col :span="23">
<el-row>
<div v-html="issue.iname"></div>
</el-row>
<el-row>
<div style="color: rgb(160,160,160)" v-html="issue.its"
v-if="issue.its"></div>
</el-row>
<el-row v-if="issue.itx==1">
<template v-if="issue.iplfs==1">
<!--竖向排列-->
<el-row v-for="wor,idx in issue.wors">
<el-row style="margin-top: 5px" v-if="wor.wimg">
<el-image :src="FILE_STREAM_PREVIEW_ADDRESS + '?id=' +wor.wimg"
fit="cover"
style="width: 100px;max-width: 100px"></el-image>
</el-row>
<el-row style="margin-top: 5px" v-if="wor.wimg">
<div v-html="wor.wsm"></div>
</el-row>
<el-row style="margin-top: 5px">
<el-radio-group v-if="issue.iisdx==true" v-model="issue.rwid">
<el-radio :label="wor.wid">
{{wor.wtxt}} &nbsp;
<span class="inputParent" v-if="wor.wistk==true">
<el-input size="mini" style="border-top: none"
v-model="wor.tktxt"></el-input>
<span style="color:red;" v-if="wor.wisbt==true">*</span>
</span>
</el-radio>
</el-radio-group>
<el-checkbox-group v-if="issue.iisdx==false" v-model="issue.rwid">
<el-checkbox :label="wor.wid">
{{wor.wtxt}}
<span class="inputParent" v-if="wor.wistk==true">
<el-input size="mini"
style="border-top: none"></el-input>
<span style="color:red;" v-if="wor.wisbt==true">*</span>
</span>
</el-checkbox>
</el-checkbox-group>
<el-row style="margin-top: 5px"
v-if="!wor.wimg&&wor.wsm">
<div v-html="wor.wsm"></div>
</el-row>
</el-row>
</el-row>
</template>
<template v-if="issue.iplfs==2">
<!--横向排列-->
<el-row :gutter="20" v-for="idx1 in issue.wors.length">
<el-col :span="parseInt(24/issue.icolnum)"
v-for="idx2 in issue.icolnum">
<div :style="!issue.wors[((idx1-1)*issue.icolnum+idx2)-1].wimg?'':'text-align: center'"
v-if="(idx1-1)*issue.icolnum+idx2<=issue.wors.length">
<el-row style="margin-top: 5px"
v-if="issue.wors[((idx1-1)*issue.icolnum+idx2)-1].wimg">
<el-image
:src="issue.wors[((idx1-1)*issue.icolnum+idx2)-1].islocal?issue.wors[((idx1-1)*issue.icolnum+idx2)-1].wimg:FILE_STREAM_PREVIEW_ADDRESS + '?id=' +issue.wors[((idx1-1)*issue.icolnum+idx2)-1].wimg"
fit="cover"
style="width: 100%;max-width: 300px"></el-image>
</el-row>
<el-row style="margin-top: 5px"
v-if="issue.wors[((idx1-1)*issue.icolnum+idx2)-1].wimg">
<div style="color: rgb(160,160,160);text-align: left">
{{issue.wors[((idx1-1)*issue.icolnum+idx2)-1].wsm}}
</div>
</el-row>
<el-row style="margin-top: 5px">
<el-radio :label="idx1+'-'+idx2" v-if="issue.iisdx==true"
v-model="issue.rwid">
{{issue.wors[((idx1-1)*issue.icolnum+idx2)-1].wtxt}}
&nbsp;<span
class="inputParent"
v-if="issue.wors[((idx1-1)*issue.icolnum+idx2)-1].wistk==true"><el-input
size="mini"
style="border-top: none"
v-model="issue.wors[((idx1-1)*issue.icolnum+idx2)-1].tktxt"></el-input> <span
style="color:red;"
v-if="issue.wors[((idx1-1)*issue.icolnum+idx2)-1].wisbt==true">*</span></span>
</el-radio>
<el-checkbox :key="idx1+'-'+idx2" :label="idx1+'-'+idx2"
v-if="issue.iisdx==false">
{{issue.wors[((idx1-1)*issue.icolnum+idx2)-1].wtxt}}
<span class="inputParent"
v-if="issue.wors[((idx1-1)*issue.icolnum+idx2)-1].wistk==true"><el-input
size="mini"
style="border-top: none"
v-model="issue.wors[((idx1-1)*issue.icolnum+idx2)-1].tktxt"></el-input> <span
style="color:red;"
v-if="issue.wors[((idx1-1)*issue.icolnum+idx2)-1].wisbt==true">*</span></span>
</el-checkbox>
<el-row style="margin-top: 5px"
v-if="!issue.wors[((idx1-1)*issue.icolnum+idx2)-1].wimg&&issue.wors[((idx1-1)*issue.icolnum+idx2)-1].wsm">
<div style="color: rgb(160,160,160)">
&nbsp;&nbsp;&nbsp;&nbsp;{{issue.wors[((idx1-1)*issue.icolnum+idx2)-1].wsm}}
</div>
</el-row>
</el-row>
</div>
</el-col>
</el-row>
</template>
</el-row>
<el-row v-if="issue.itx==2">
<el-input size="small" style="width: 50%"
v-model="issue.wors[0].rval">
</el-input>
</el-row>
</el-col>
</el-row>
<div style="width: 100%;text-align: center;margin-top: 30px">
<el-button @click="subData" style="width: 70%" type="primary">提交问卷</el-button>
</div>
</div>
</template>
</guava>
<el-row class="transition-row">
<!-- <transition name="el-zoom-in-center">
<div class="transition-item" v-show="v=='fill'">
<el-card class="box-card v-box" shadow="never">
<div class="clearfix" slot="header">
<el-button @click="v='index'" icon="el-icon-back" style="font-size: 18px"
type="text">返回
</el-button>
</div>
</el-card>
</div>
</transition>-->
</el-row>
</div>
<script>
let E = window.wangEditor
let qsmEditor
let upTxtEditor
let vue = new Vue({
el: '#app',
data() {
return {
v: "index",
tableData: [],
viewData: [],
formData: [],
pageForm: {
searchName: "",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
qid: ""
}
},
methods: {
async openFill(id, activityuserscopeid) {
const resp = await $.post('/platform/activity/basic/scope/getScopeUser', {activityGroupId: activityuserscopeid})
if (resp.data === 0) {
this.$notify.warning('您没有此次答题的权限')
return
}
this.qid = id
$.get(loc() + "/findOne", {"qid": id}, res => {
const {code, data, msg} = res
if (code == 0) {
data.issues.forEach(issue => {
if (!issue.iisdx) {
issue.rwid = []
}
})
this.viewData = data
this.$refs.guava.view()
} else {
this.$message.warning(msg);
}
})
},
subData() {
let flag = true
let msg
let issues = this.viewData.issues
i:
for (let i = 0; i < issues.length; i++) {
w:
for (let j = 0; j < issues[i].wors.length; j++) {
let wor = issues[i].wors[j]
if (issues[i].iisbd) {
if (issues[i].itx == 1 && !issues[i].rwid) {
flag = false
msg = '第' + (i + 1) + '题未作答!'
break i
}
if (issues[i].itx == 2 && !wor.rval) {
flag = false
msg = '第' + (i + 1) + '题未作答!'
break i
}
if (issues[i].rwid == wor.wid && wor.wisbt && !wor.rval) {
flag = false
msg = '第' + (i + 1) + '题内容未填写!'
break i
}
}
}
if (issues[i].itx == 1 && issues[i].iisbd && !issues[i].rwid) {
flag = false
msg = '第' + (i + 1) + '题未作答!'
break i
}
}
if (!flag) {
this.$notify({
title: '提示',
message: msg,
type: 'warning'
});
} else {
issues.forEach((issue) => {
if (issue.itx == 1) {
if (issue.iisdx == false) {
issue.rwid.forEach((wid) => {
issue.wors.forEach((wor) => {
if (wor.wid == wid) {
let reply = {"rwid": wor.wid, "rval": wor.rval}
this.formData.push(reply)
}
})
})
} else {
issue.wors.forEach((wor) => {
if (wor.wid == issue.rwid) {
let reply = {"rwid": wor.wid, "rval": wor.rval}
this.formData.push(reply)
}
})
}
} else {
issue.wors.forEach((wor) => {
let reply = {"rwid": wor.wid, "rval": wor.rval}
this.formData.push(reply)
})
}
})
$.post(loc() + "/subData", {
json: JSON.stringify(this.formData),
"qid": this.qid
}, (data) => {
if (data.code == 0) {
this.$notify({
title: '成功',
message: "您的答卷已提交,感谢您的参与!",
type: 'success'
});
this.$refs.guava.index()
this.flag = true
} else {
this.$notify({
title: '错误',
message: data.msg,
type: 'error'
});
}
})
}
},
doSearch() {
this.pageForm.pageNumber = 1;
this.pageData();
},
pageOrder(column) {
switch (column.order) {
case 'descending':
column.order = 'desc'
break
case "ascending":
column.order = 'asc'
break
}
this.pageForm.pageOrderName = column.prop;
this.pageForm.pageOrderBy = column.order;
this.pageData();
},
pageNumberChange(val) {//页码更新操作
this.pageForm.pageNumber = val;
this.pageData();
},
pageSizeChange(val) {//分页大小更新操作
this.pageForm.pageSize = val;
this.pageData();
},
pageData() {//加载分页数据
sublime.showLoadingbar();
$.post(loc() + "/data", this.pageForm, (data) => {
sublime.closeLoadingbar();
if (data.code == 0) {
this.tableData = data.data.list;
this.pageForm.totalCount = data.data.totalCount;
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
}
},
created() {
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,342 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
:clearable="false"
@change="yearChange"
placeholder="选择年"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属问卷:</div>
<div class="search-item-option">
<el-select filterable="true" placeholder="所属问卷" style="width: 100%;"
v-model="pageForm.questionId">
<el-option :label="item.qtitle" :value="item.qid"
v-for="item in questions"></el-option>
</el-select>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select @change="getData()" clearable="true" filterable="true"
placeholder="所属工会" style="width: 100%;"
v-model="pageForm.unionId">
<el-option :label="item.unionname" :value="item.id"
v-for="item in unions"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索
</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="工会列表">
<template #func>
<template
v-if="questions.find(v => v.qid === pageForm.questionId) && questions.find(v => v.qid === pageForm.questionId).qlx === 3">
<el-button :disabled="!pageForm.questionId" @click="doExportInventory"
icon="el-icon-printer"
size="small"
type="primary">导出购物清单
</el-button>
<el-button :disabled="!pageForm.questionId" @click="doExport"
icon="el-icon-printer"
size="small"
type="primary">导出汇总
</el-button>
</template>
<template
v-if="questions.find(v => v.qid === pageForm.questionId) && questions.find(v => v.qid === pageForm.questionId).qlx === 4 && ${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}">
<el-button @click="sendMsg" icon="el-icon-s-promotion" size="small"
type="primary">
短信通知
</el-button>
<el-button
@click="shopExport(true)" icon="el-icon-printer"
size="small"
type="primary">按商品导出
</el-button>
<el-button
@click="doUnionUserExport(true)" icon="el-icon-printer"
size="small"
type="primary">导出已选名单
</el-button>
<el-button
@click="doUnionUserExport(false)" icon="el-icon-printer"
size="small"
type="primary">导出未选名单
</el-button>
<el-button :disabled="!pageForm.questionId" @click="doExportCakeUnion"
icon="el-icon-printer"
size="small"
type="primary">导出汇总表
</el-button>
</template>
</template>
</table-tool>
<el-table :data="tableData"
:show-summary="questions.find(v => v.qid === pageForm.questionId) && questions.find(v => v.qid === pageForm.questionId).qlx === 4"
:size="tableSize" @sort-change="pageOrder"
class="vi-table"
ref="table" row-key="id" style="width: 100%" v-loading="tableLoading">
<el-table-column type="index" width="50"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='unselectedTeacherSum'">
<el-link @click="viewUnselectedUser(row)" type="primary">
{{row.unselectedTeacherSum}}
</el-link>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作"
prop="userOnline"
v-if="tableData && tableData.length>0 && [4].includes(qlx)"
width="100px">
<template scope="{ row }">
<el-button @click="openView(row.unionId)" size="mini" type="primary"
v-if="[4].includes(qlx)">
查看
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
<template #view>
<question-x ref="questionX"></question-x>
</template>
</guava>
<el-dialog :title="unselectUserDialogTitle" :visible.sync="unselectUserDialog" width="50%">
<div>
<el-button @click="doExportUnselectedCakeUser"
class="pull-right"
icon="el-icon-printer"
type="primary">导出未领取人员
</el-button>
</div>
<el-table :data="unselectUserTable" height="500px">
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="单位" prop="unitname"></el-table-column>
<el-table-column label="手机号" prop="mobile"></el-table-column>
</el-table>
</el-dialog>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
unions: [],
questions: [],
personnelData: [],
personnelLoading: false,
tableLoading: false,
tableData: [],
tableSize: '',
tableKey: '',
tableColumns: [],
personnelColumns: [
{prop: 'username', label: '姓名'},
{prop: 'loginname', label: '工号'},
{prop: 'unitname', label: '所属单位'},
{prop: 'unionname', label: '所属工会'},
{prop: 'fraction', label: '分值'}
],
pageForm: {
year: new Date().getFullYear() + ''
},
unselectUserDialog: false,
unselectUserDialogTitle: '',
unselectUserTable: [],
selectUnion: {}
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'question-x': httpVueLoader('/components/question/QuestionDetail.vue')
},
computed: {
qlx() {
const qs = this.questions
const qid = this.pageForm.questionId
if (qs && qs.length > 0 && qid) {
return qs.find(v => v.qid === qid).qlx
}
return null
}
},
methods: {
sendMsg() {
this.$confirm('您确定要向未领取人员发送短信提醒吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(loc() + '/sendMsg', {questionId: this.pageForm.questionId})
if (resp.code === 0) {
this.$message.success(resp.msg)
} else {
this.$message.error(resp.msg)
}
}).catch(() => {
});
},
shopExport() {
if (!this.pageForm.questionId) {
this.$notify.warning({title: '警告', message: '请先选择问卷!'});
return
}
const loading = this.$loading({
lock: true,
text: '正在努力导出中,感谢您的耐心等待!',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
axios.post(loc() + "/shopExport?questionId=" + this.pageForm.questionId, {}, {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) => {
})
//window.open(loc() + "/shopExport?questionId=" + this.pageForm.questionId)
},
doUnionUserExport(flag) {
window.open(loc() + "/doUnionUserExport?questionId=" + this.pageForm.questionId + "&flag=" + flag)
},
doExportUnselectedCakeUser() {
window.location.href = loc() + '/doExportCakeUser?questionId=' + this.pageForm.questionId + '&ghId=' + this.selectUnion.unionId + '&isSelected=false'
},
async viewUnselectedUser(row) {
this.unselectUserDialogTitle = row.unionName + '未选人员名单'
this.unselectUserDialog = true
this.selectUnion = row
const params = {
unionId: row.unionId,
questionId: this.pageForm.questionId
}
const {data} = await $.get(loc() + '/getUnselectedUser', params)
this.unselectUserTable = data
},
doExportCakeUnion() {
window.open('/platform/question/cake/doExportCakeUnion?questionId=' + this.pageForm.questionId)
},
doExport() {
location.href = loc() + '/doExport?questionId=' + (this.pageForm.questionId ? this.pageForm.questionId : '') + '&unionId=' + (this.pageForm.unionId ? this.pageForm.unionId : '')
},
doExportInventory() {
location.href = loc() + '/doExportInventory?questionId=' + this.pageForm.questionId
},
doSearch() {
this.getData()
},
async getData() {
this.tableLoading = true
const {data} = await $.post(loc() + "/getData", {...this.pageForm})
this.tableColumns = data.label
this.tableData = data.list
this.tableLoading = false
},
async openView(unionId) {
const {data, code, msg} = await this.getAnswerData(unionId)
if (code !== 0) {
this.$notify.error({title: '错误', message: msg});
return
}
this.personnelData = data
this.personnelLoading = true
this.$refs.guava.view()
setTimeout(() => {
this.$refs['questionX'].openView(this.pageForm.questionId, this.questions, unionId)
}, 100)
this.personnelLoading = false
},
async getAnswerData(unionId) {
return await $.get(loc() + "/getAnswerData", {
questionId: this.pageForm.questionId,
unionId: unionId
});
},
async yearChange() {
this.questions = await this.getQuestion()
this.$set(this.pageForm, "questionId", this.questions.length > 0 ? this.questions[0].qid : '')
},
async getQuestion() {
const {data} = await $.get(loc() + "/getQuestion", {year: this.pageForm.year})
return data
}
},
async created() {
this.questions = await this.getQuestion()
this.$set(this.pageForm, "questionId", this.questions.length > 0 ? this.questions[0].qid : '')
this.unions = await getUnions(null)
if (this.pageForm.questionId) {
this.getData()
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,307 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<!-- 在 head 标签中添加 meta 标签,并设置 viewport-fit=cover 值 -->
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover"
name="viewport">
<title>智慧工会问卷调查</title>
<!-- 引入样式文件 -->
<link href="https://cdn.jsdelivr.net/npm/vant@2.5/lib/index.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/weui/2.2.0/style/weui.min.css" rel="stylesheet">
</head>
<style>
[v-clock] {
display: none
}
.van-radio__label {
width: 100%;
}
.van-checkbox__label {
width: 100%;
}
.weui-msg {
width: 100%;
height: 100%;
}
.myHide {
display: none;
}
.max50 {
max-width: 50%;
}
</style>
<body>
<div id="app" style="padding: 0 10px;" v-clock v-if="showPage">
<van-nav-bar @click-left="history.back()" fixed left-arrow placeholder title="问卷调查"></van-nav-bar>
<div style="margin: 1.2rem 0.20rem 0.4rem 0.20rem;padding: 0.3rem 0.34rem;text-align: center"
v-show="showMsg==true">
<div class="weui-msg">
<div class="weui-msg__icon-area">
<i class="weui-icon-success weui-icon_msg" v-if="flag"></i>
<i class="weui-icon-warn weui-icon_msg" v-else></i>
</div>
<div class="weui-msg__text-area">
<h2 class="weui-msg__title">{{msg}}</h2>
</div>
</div>
</div>
<div style="padding-top: 20px" v-show="showMsg==false">
<div style="width: 100%;text-align: center;color: #1ea0fa"><h2>{{data.qtitle}}</h2></div>
<div style="width: 100%;margin-top: 20px" v-html="data.qsm" v-if="data.qsm">
</div>
<hr style="margin-top: 20px;border: none;border-bottom: 1px rgb(150,150,150) dashed" v-if="data.qsm"/>
<div style="margin-top: 50px;">
<van-panel :desc="getTxt(issue.its)" :status="issue.iisbd?'必答':''"
:title="(iidx+1)+'. '+ getTxt(issue.iname)"
style="margin: 20px 0;box-shadow: 0 0 10px rgb(220,220,220)" v-for="issue,iidx in data.issues">
<!-- 单选-->
<div style="padding: 10px" v-if="issue.itx==1&&issue.iisdx==true">
<van-radio-group :direction="issue.iplfs==1?'vertical':'horizontal'"
style="position: relative;box-sizing: border-box;"
v-model="issue.rwid">
<van-radio :class="issue.iplfs==2?'max50':''" :name="wor.wid"
style="padding: 10px 10px;margin: 0;box-sizing: border-box;"
v-for="wor in issue.wors">
<div style="width: 100%" v-if="wor.wimg">
<van-image
:src="'${AppFileDomain!}'+wor.wimg"
fit="cover"
height="100px"
width="100px"/>
</div>
<div style="width: 100%;margin: 5px 0" v-html="wor.wtxt"></div>
<div style="width: 100%;margin: 5px 0;color: rgb(180,180,180);font-size: 12px"
v-html="wor.wsm">
</div>
<div style="width: 100%;margin: 5px 0" v-if="wor.wistk==true">
<van-field :required="wor.wisbt" style="border: 1px rgb(240,240,240) solid"
v-model="wor.rval"/>
</div>
</van-radio>
</van-radio-group>
</div>
<!-- 多选-->
<div style="padding: 10px" v-if="issue.itx==1&&issue.iisdx==false">
<van-checkbox-group :direction="issue.iplfs==1?'vertical':'horizontal'"
:max="issue.imaxselect?issue.imaxselect:9999999"
style="position: relative;box-sizing: border-box;"
v-model="issue.rwid">
<van-checkbox :class="issue.iplfs==2?'max50':''" :name="wor.wid" shape="square"
style="padding: 10px 10px;margin: 0;box-sizing: border-box;"
v-for="wor in issue.wors">
<div style="width: 100%" v-if="wor.wimg">
<van-image
:src="'${AppFileDomain!}'+wor.wimg"
fit="cover"
height="100px"
width="100px"/>
</div>
<div style="width: 100%;margin: 5px 0" v-html="wor.wtxt"></div>
<div style="width: 100%;margin: 5px 0;color: rgb(180,180,180);font-size: 12px"
v-html="wor.wsm">
</div>
<div style="width: 100%;margin: 5px 0" v-if="wor.wistk==true">
<van-field :required="wor.wisbt" style="border: 1px rgb(240,240,240) solid"
v-model="wor.rval"/>
</div>
</van-checkbox>
</van-checkbox-group>
</div>
<!-- 填空-->
<div style="padding: 10px" v-if="issue.itx==2">
<van-field
autosize
placeholder="请输入内容"
rows="2"
show-word-limit
style="border: 1px rgb(240,240,240) solid"
type="textarea"
v-model="issue.wors[0].rval"
/>
</div>
</van-panel>
</div>
<div style="width: 100%;text-align: center;margin-top: 30px">
<van-button :loading="loading" @click.native="subData" color="#1ea0fa" style="width: 70%" type="primary"
v-show="data!={}">
提交问卷
</van-button>
</div>
</div>
<div class="weui-footer" style="margin-top: 80px;margin-bottom: 10px" v-if="showPage">
<p class="weui-footer__text">Copyright © 2019-2020 智慧工会平台</p>
</div>
</div>
<van-number-keyboard safe-area-inset-bottom/>
<!-- 引入 Vue 和 Vant 的 JS 文件 -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vant@2.5/lib/vant.min.js"></script>
<script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
<script>
let vue = new Vue({
el: "#app",
data: function () {
return {
loading: false,
showMsg: false,
showPage: false,
msg: '',
flag: null,
data: {},
formData: [],
getTxt(val) {
if (val) {
return val.replace(/<(style|script|iframe)[^>]*?>[\s\S]+?<\/\1\s*>/gi, '').replace(/<[^>]+?>/g, '').replace(/\s+/g, ' ').replace(/&nbsp;/g, ' ').replace(/>/g, ' ');
}
return ''
},
}
},
methods: {
subData: function () {
let flag = true
let msg = ""
vue.formData = []
let issues = vue.data.issues
i:
for (let i = 0; i < issues.length; i++) {
w:
for (let j = 0; j < issues[i].wors.length; j++) {
let wor = issues[i].wors[j]
if (issues[i].iisbd) {
if (issues[i].itx == 1 && !issues[i].rwid) {
flag = false
msg = '第' + (i + 1) + '题未作答!'
break i
}
if (issues[i].itx == 2 && !wor.rval) {
flag = false
msg = '第' + (i + 1) + '题未作答!'
break i
}
if (issues[i].rwid == wor.wid && wor.wisbt && !wor.rval) {
flag = false
msg = '第' + (i + 1) + '题内容未填写!'
break i
}
}
}
if (issues[i].itx == 1 && issues[i].iisbd && issues[i].rwid.length == 0) {
flag = false
msg = '第' + (i + 1) + '题未作答!'
break i
}
}
if (!flag) {
vue.$notify({type: 'danger', message: msg})
} else {
issues.forEach(function (issue) {
if (issue.iisdx == false) {
issue.rwid.forEach(function (wid) {
issue.wors.forEach(function (wor) {
if (wor.wid == wid) {
let reply = {"rwid": wor.wid, "rval": wor.rval}
vue.formData.push(reply)
}
})
})
} else {
issue.wors.forEach(function (wor) {
if (wor.wid == issue.rwid) {
let reply = {"rwid": wor.wid, "rval": wor.rval}
vue.formData.push(reply)
}
})
}
})
vue.loading = true
$.post("/platform/zgfw/mobile/questionnaire/subData", {json: JSON.stringify(vue.formData)}, function (data) {
if (data.code == 0) {
vue.loading = false
vue.msg = '您的答卷已提交,感谢您的参与!'
vue.flag = true
vue.showMsg = true
} else {
vue.$notify({type: 'danger', message: data.msg})
}
})
}
},
getData: function () {
$.get("/platform/zgfw/mobile/questionnaire/data", function (data) {
if (data.code == 0) {
if (data.data.qflag == 1 || data.data.qflag == 3) {
vue.msg = '该问卷尚未开启!'
vue.flag = false
vue.showMsg = true
} else {
if (data.data.qdtkssj && data.data.qdtjssj) {
let now = new Date()
let qdtkssj = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate() + ' ' + data.data.qdtkssj
let qdtjssj = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate() + ' ' + data.data.qdtjssj
qdtkssj = new Date(qdtkssj).getTime()
qdtjssj = new Date(qdtjssj).getTime()
if (!(qdtkssj < now.getTime() && now.getTime() < qdtjssj)) {
vue.msg = '该问卷每日答题时间为:' + data.data.qdtkssj + '-' + data.data.qdtjssj
vue.flag = false
vue.showMsg = true
}
}
}
data.data.issues.forEach(function (issue) {
if (issue.itx == 1 && issue.iisdx) {
issue.rwid = ''
} else if (issue.itx == 1 && !issue.iisdx) {
issue.rwid = []
} else if (issue.itx == 2) {
issue.rwid = issue.wors[0].wid
}
issue.wors.forEach(function (wor) {
if (wor.wismr) {
if (issue.itx == 1 && issue.iisdx) {
issue.rwid = wor.wid
} else if (issue.itx == 1 && !issue.iisdx) {
issue.rwid.push(wor.wid)
}
}
})
})
vue.showMsg = false
vue.data = data.data
} else {
vue.msg = data.msg
vue.flag = false
vue.showMsg = true
// window.close()
// wx.closeWindow();
}
vue.showPage = true
})
}
},
created: function () {
this.getData()
}
})
</script>
</body>
</html>
@@ -0,0 +1,354 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-tabs__content {
padding-top: 20px;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
:clearable="false"
@change="yearChange"
placeholder="选择年"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属问卷:</div>
<div class="search-item-option">
<el-select filterable="true" placeholder="所属问卷" style="width: 100%;"
v-model="pageForm.questionId">
<el-option :label="item.qtitle" :value="item.qid" v-for="item in questions"></el-option>
</el-select>
</div>
</div>
<div class="search-item" v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select @change="getData()" clearable="true" filterable="true"
placeholder="所属工会" style="width: 100%;" v-model="pageForm.unionId">
<el-option :label="item.unionname" :value="item.id" v-for="item in unions"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="工会列表">
<template #func>
<template
v-if="questions.find(v => v.qid === pageForm.questionId) && questions.find(v => v.qid === pageForm.questionId).qlx === 3">
<el-button :disabled="!pageForm.questionId" @click="doExportInventory"
icon="el-icon-printer"
size="small"
type="primary">导出购物清单
</el-button>
<el-button :disabled="!pageForm.questionId" @click="doExport" icon="el-icon-printer"
size="small"
type="primary">导出汇总
</el-button>
</template>
<template
v-if="questions.find(v => v.qid === pageForm.questionId) && questions.find(v => v.qid === pageForm.questionId).qlx === 4 && ${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}">
<el-button @click="sendMsg" icon="el-icon-s-promotion" size="small" type="primary">
短信通知
</el-button>
<el-button
@click="shopExport(true)" icon="el-icon-printer"
size="small"
type="primary">按商品导出
</el-button>
<el-button
@click="doUnionUserExport(true)" icon="el-icon-printer"
size="small"
type="primary">导出已选名单
</el-button>
<el-button
@click="doUnionUserExport(false)" icon="el-icon-printer"
size="small"
type="primary">导出未选名单
</el-button>
<el-button :disabled="!pageForm.questionId" @click="doExportCakeUnion"
icon="el-icon-printer"
size="small"
type="primary">导出汇总表
</el-button>
</template>
</template>
</table-tool>
<el-table :data="tableData"
:show-summary="questions.find(v => v.qid === pageForm.questionId) && questions.find(v => v.qid === pageForm.questionId).qlx === 4"
:size="tableSize" @sort-change="pageOrder"
class="vi-table"
ref="table" row-key="id" style="width: 100%" v-loading="tableLoading">
<el-table-column type="index" width="50"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='unselectedTeacherSum'">
<el-link @click="viewUnselectedUser(row)" type="primary">
{{row.unselectedTeacherSum}}
</el-link>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作"
prop="userOnline" v-if="tableData && tableData.length>0 && [2,3,4].includes(qlx)"
width="100px">
<template scope="{ row }">
<el-button @click="openView(row.unionId)" size="mini" type="primary"
v-if="[2,3,4].includes(qlx)">
查看
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
<template #view>
<question-x ref="questionX"></question-x>
</template>
</guava>
<el-dialog :title="unselectUserDialogTitle" :visible.sync="unselectUserDialog" width="50%">
<div>
<el-button @click="doExportUnselectedCakeUser"
class="pull-right"
icon="el-icon-printer"
type="primary">导出未领取人员
</el-button>
</div>
<el-table :data="unselectUserTable" height="500px">
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="单位" prop="unitname"></el-table-column>
<el-table-column label="手机号" prop="mobile"></el-table-column>
</el-table>
</el-dialog>
</div>
<script>
const vue = new Vue({
el: '#app',
data() {
return {
unions: [],
questions: [],
personnelData: [],
personnelLoading: false,
tableLoading: false,
tableData: [],
tableSize: '',
tableKey: '',
tableColumns: [],
personnelColumns: [
{prop: 'username', label: '姓名'},
{prop: 'loginname', label: '工号'},
{prop: 'unitname', label: '所属单位'},
{prop: 'unionname', label: '所属工会'},
{prop: 'fraction', label: '分值'}
],
pageForm: {
year: new Date().getFullYear() + ''
},
unselectUserDialog: false,
unselectUserDialogTitle: '',
unselectUserTable: [],
selectUnion: {}
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'question-x': httpVueLoader('/components/question/QuestionDetail.vue')
},
computed: {
qlx() {
const qs = this.questions
const qid = this.pageForm.questionId
if (qs && qs.length > 0 && qid) {
return qs.find(v => v.qid === qid).qlx
}
return null
}
},
methods: {
sendMsg() {
this.$confirm('您确定要向未领取人员发送短信提醒吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(loc()+'/sendMsg', {questionId: this.pageForm.questionId})
if (resp.code === 0) {
this.$message.success(resp.msg)
} else {
this.$message.error(resp.msg)
}
}).catch(() => {
});
},
shopExport() {
if (!this.pageForm.questionId) {
this.$notify.warning({title: '警告', message: '请先选择问卷!'});
return
}
const loading = this.$loading({
lock: true,
text: '正在努力导出中,感谢您的耐心等待!',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
axios.post(loc() + "/shopExport?questionId=" + this.pageForm.questionId, {}, {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) => {
})
//window.open(loc() + "/shopExport?questionId=" + this.pageForm.questionId)
},
doUnionUserExport(flag) {
window.open(loc() + "/doUnionUserExport?questionId=" + this.pageForm.questionId + "&flag=" + flag)
},
doExportUnselectedCakeUser() {
window.open(loc() + "/doExportCakeUser?questionId=" + this.pageForm.questionId + '&ghId=' + this.selectUnion.unionId + '&isSelected=false')
},
async viewUnselectedUser(row) {
this.unselectUserDialogTitle = row.unionName + '未选人员名单'
this.unselectUserDialog = true
this.selectUnion = row
const params = {
unionId: row.unionId,
questionId: this.pageForm.questionId
}
const {data} = await $.get('/platform/zgfw/question/cake/getUnselectedUser', params)
this.unselectUserTable = data
},
doExportCakeUnion() {
window.open('/platform/zgfw/question/cake/doExportCakeUnion?questionId=' + this.pageForm.questionId)
},
doExport() {
location.href = loc() + '/doExport?questionId=' + (this.pageForm.questionId ? this.pageForm.questionId : '') + '&unionId=' + (this.pageForm.unionId ? this.pageForm.unionId : '')
},
doExportInventory() {
location.href = loc() + '/doExportInventory?questionId=' + this.pageForm.questionId
},
async getData() {
this.tableLoading = true
const {data} = await $.post(loc() + "/getData", this.pageForm)
this.tableColumns = data.label
this.tableData = data.list
console.log(data)
this.tableLoading = false
},
async openView(unionId) {
const {data, code, msg} = await this.getAnswerData(unionId)
if (code !== 0) {
this.$notify.error({title: '错误', message: msg});
return
}
this.personnelData = data
this.personnelLoading = true
this.$refs.guava.view()
setTimeout(() => {
this.$refs['questionX'].openView(this.pageForm.questionId, this.questions, unionId)
}, 100)
this.personnelLoading = false
},
async getAnswerData(unionId) {
return await $.get(loc() + "/getAnswerData", {
questionId: this.pageForm.questionId,
unionId: unionId
});
},
async yearChange() {
this.questions = await this.getQuestion()
this.$set(this.pageForm, "questionId", this.questions.length > 0 ? this.questions[0].qid : '')
},
async getQuestion() {
const {data} = await $.get(loc() + "/getQuestion", {year: this.pageForm.year})
return data
},
tableSizeChange(size) {
this.tableSize = size
},
columnChange(val) {
this.tableLoading = true
this.tableColumns = val
this.tableLoading = false
},
doSearch() {
this.tableKey = new Date().getTime()
this.getData()
},
pageOrder(column) {
this.pageForm.pageOrderName = column.prop;
this.pageForm.pageOrderBy = column.order;
this.getData();
}
},
async created() {
this.questions = await this.getQuestion()
this.questions = this.questions.filter(v => [1, 3, 4].includes(v.qlx))
this.$set(this.pageForm, "questionId", this.questions.length > 0 ? this.questions[0].qid : '')
this.unions = await getUnions(null)
if (this.pageForm.questionId !== "") {
this.getData();
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,366 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.issueList > .el-table__header-wrapper {
display: none;
}
.issueList .el-table__expanded-cell {
background-color: rgb(250, 250, 250) !important;
}
.el-table .last-row {
background-color: rgb(250, 250, 250);
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
style="width: 100%"
:clearable="false"
placeholder="选择年"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">标题:</div>
<div class="search-item-option">
<el-input placeholder="请输入内容" v-model="pageForm.qtitle">
</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 shadow="never" class="mt20">
<el-table :data="tableData" header-align="center" style="width: 100%">
<el-table-column align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
<el-table-column align="center" label="标题" prop="qtitle"></el-table-column>
<el-table-column align="center" label="说明" prop="qsm" show-overflow-tooltip="true">
<template scope="scope">
<div v-html="scope.row.qsm" v-if="scope.row.qsm">{{scope.row.qsm}}</div>
<span v-else>暂无</span>
</template>
</el-table-column>
<el-table-column align="center" label="创建人" prop="username"></el-table-column>
<el-table-column align="center" label="调查时间" prop="qctime"></el-table-column>
<el-table-column align="center" label="类型" prop="qlx">
<template scope="scope">
<span style="color: #67C23A" v-if="scope.row.qlx==1">在线调查</span>
<span style="color: #67C23A" v-if="scope.row.qlx==2">在线答题</span>
<span style="color: #67C23A" v-if="scope.row.qlx==3">购物问卷</span>
<span style="color: #67C23A" v-if="scope.row.qlx==4">意向选择</span>
</template>
</el-table-column>
<el-table-column align="center" label="状态" prop="qflag">
<template scope="scope">
<span style="color: #E6A23C" v-if="scope.row.qflag==1">未开启</span>
<span style="color: #67C23A" v-if="scope.row.qflag==2">已开启</span>
<span style="color: #F56C6C" v-if="scope.row.qflag==3">已关闭</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="250px">
<template scope="scope">
<el-button @click="openAnswerView(scope.row.qid,scope.row.qtitle)" size="mini" type="primary">查看答题报告
</el-button>
<el-button @click="openView(scope.row.qid)" size="mini" type="primary">查看比例报告
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit_func>
<el-button @click="doExport" icon="el-icon-printer" type="primary">导出</el-button>
</template>
<template #edit>
<div class="pl10 pr10">
<el-row class="text-center">
<h2 style="margin: 0">{{viewData.q.qtitle}}</h2>
</el-row>
<el-row class="mb20">
<div v-html="viewData.q.qsm"></div>
</el-row>
<div id="issue-wrap" :style="{'height':issueWrapHeight+'px'}"
style="overflow-y: scroll;transition-duration: .5s;transition-timing-function: ease-in-out">
<el-row v-for="issue,idx in viewData.q.issues">
<el-row>
<span style="font-weight: bolder;color: rgb(120,120,120)">第 {{idx+1}} 题:</span>
<div style="display: inline-block" v-html="issue.iname"></div>
<span style="color: rgb(180,180,180)" v-if="issue.itx==1&&issue.iisdx">[单选题]</span>
<span style="color: rgb(180,180,180)" v-if="issue.itx==1&&!issue.iisdx">[多选题]</span>
<span style="color: rgb(180,180,180)" v-if="issue.itx==2">[填空题]</span>
</el-row>
<el-row class="mt20 mb20">
<el-table
:data="issue.wors"
header-align="center"
style="width: 100%"
v-if="issue.itx==1"
>
<el-table-column
align="center"
header-align="center"
label="选项"
prop="wtxt">
<template scope="scope">
{{scope.row.wtxt}}
<span @click="openTkView(scope.row.wid)"
style="color: #409EFF;cursor:pointer;text-decoration: underline"
v-if="scope.row.wistk">详细</span>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="小计"
prop="xj">
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="比例"
prop="bl">
<template scope="scope">
<el-progress :percentage="scope.row.bl"
v-if="scope.row.bl!=undefined"></el-progress>
</template>
</el-table-column>
</el-table>
<el-button @click="openTkView(issue.wors[0].wid)" size="small" type="primary"
v-else>
查看详细信息
</el-button>
</el-row>
</el-row>
</div>
</div>
</template>
<template #view>
<div class="pl10 pr10">
<el-row class="text-center">
<h2 style="margin: 0">
{{viewQuestionName}}
<el-button @click="doExportAnswer" icon="el-icon-printer" type="primary" size="small">导出</el-button>
</h2>
</el-row>
<div style="overflow-y: scroll;transition-duration: .5s;transition-timing-function: ease-in-out">
<el-row v-for="issue,idx in fullIssueAnswerInfo">
<el-row>
<span style="font-weight: bolder;color: rgb(120,120,120)">第 {{idx+1}} 题:</span>
<div style="display: inline-block" v-html="issue.iname"></div>
<span style="color: rgb(180,180,180)" v-if="issue.itx==1&&issue.iisdx">[单选题]</span>
<span style="color: rgb(180,180,180)" v-if="issue.itx==1&&!issue.iisdx">[多选题]</span>
<span style="color: rgb(180,180,180)" v-if="issue.itx==2">[填空题]</span>
</el-row>
<el-row class="mt20 mb20">
<el-table
:data="issue.answerUsers"
header-align="center"
style="width: 100%">
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="单位" prop="unitname"></el-table-column>
<el-table-column label="分工会" prop="unionname"></el-table-column>
<el-table-column label="回答选项" prop="wtxt" sortable
v-if="issue.itx===1"></el-table-column>
<el-table-column label="回答内容" prop="rval" sortable
v-if="issue.itx===2"></el-table-column>
</el-table>
</el-row>
</el-row>
</div>
</div>
</template>
</guava>
<el-dialog
:close-on-click-modal="false"
:visible.sync="tkViewDialogVisible"
custom-class="ViewDialogClass"
title="详细信息"
width="50%"
>
<el-row>
<div class="btn-group tool-button mt5">
<el-input placeholder="请输入内容" size="small" v-model="tkPageForm.searchKeyword">
<template slot="prepend">文本</template>
</el-input>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="doTkSearch" icon="el-icon-search" size="small" type="primary"></el-button>
</div>
</el-row>
<el-row class="el-table-container" style="margin-top: 20px;">
<el-table
:data="tkTableData"
header-align="center"
size="medium"
style="width: 100%"
>
<el-table-column
align="center"
header-align="center"
label="序号"
type="index"
>
<template scope="scope">
<span>{{scope.$index+(tkPageForm.pageNumber - 1) * tkPageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="提交时间"
prop="rtime"
width="200px">
</el-table-column>
<el-table-column
header-align="center"
label="文本"
prop="rval">
</el-table-column>
</el-table>
</el-row>
<el-row class="el-pagination-container">
<el-pagination
:current-page="tkPageForm.pageNumber"
:page-size="tkPageForm.pageSize"
:page-sizes="[10, 20, 30, 50]"
:total="pageForm.totalCount"
@current-change="(val)=>{tkPageForm.pageNumber = val;tkPageData();}"
@size-change="(val)=>{tkPageForm.pageSize = val;tkPageData();}"
layout="total, prev, pager, next">
</el-pagination>
</el-row>
</el-dialog>
</div>
<script>
let vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
v: "index",
tableData: [],
tkTableData: [],
pageForm: {
searchName: "",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: "",
year: new Date().getFullYear() + ''
},
tkPageForm: {
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
title: '',
},
viewData: {q: {issue: [{word: []}]}},
tkViewDialogVisible: false,
questionId: '',
issueWrapHeight: 0,
fullIssueAnswerInfo: [],
viewQuestionId: null,
viewQuestionName: null
}
},
methods: {
doExportAnswer() {
window.open(loc() + '/exportAnswerView?id=' + this.viewQuestionId)
},
async openAnswerView(id,qtitle) {
this.$refs.guava.view()
const {data} = await $.get(loc() + '/getAnswerView', {id})
this.fullIssueAnswerInfo = data
this.viewQuestionId = id
this.viewQuestionName = qtitle
},
doExport() {
location.href = loc() + '/doExport?questionId=' + this.questionId
},
openTkView(wid) {
this.tkPageForm.wid = wid
this.tkPageData()
this.tkViewDialogVisible = true
},
doTkSearch() {
this.tkPageForm.pageNumber = 1;
this.tkPageData();
},
async tkPageData() {
const {data} = await $.post(loc() + "/tkData", this.tkPageForm)
this.tkTableData = data.list
this.tkPageForm.totalCount = data.totalCount
},
async openView(qid) {
this.issueWrapHeight = 0
this.questionId = qid
const {data} = await $.get(loc() + "/getReplyData", {qid: qid})
data.q.issues.forEach(function (issue) {
issue.wors.forEach(function (wor) {
const xj = data[issue.iid].hasOwnProperty(wor.wid) ? data[issue.iid][wor.wid] : 0
wor.xj = xj
console.log(data[issue.iid].num)
wor.bl = (xj / data[issue.iid].num).toFixed(2) * 100
wor.bl = isNaN(wor.bl) ? 0 : wor.bl
})
}
)
this.viewData = data
this.$refs.guava.edit()
this.$nextTick(() => {
setTimeout(() => {
this.issueWrapHeight = window.innerHeight - 10 - 20 - document.getElementById('issue-wrap').getBoundingClientRect().top - 1
}, 500)
})
},
},
created() {
this.pageData()
}
})
</script>
<!--#
}
#-->
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,237 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-tabs__content {
padding-top: 20px;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
:clearable="false"
@change="yearChange"
placeholder="选择年"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属问卷:</div>
<div class="search-item-option">
<el-select filterable="true" placeholder="所属问卷" style="width: 100%;" @change="doSearch"
v-model="pageForm.questionId">
<el-option :label="item.qtitle" :value="item.qid" v-for="item in questions"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">工号姓名:</div>
<div class="search-item-option">
<el-input placeholder="输入关键字" v-model="pageForm.searchKeyword" maxlength="10"></el-input>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select @change="flushUnits" @clear="flushUnits" clearable="true"
filterable="true"
placeholder="所属工会" style="width: 100%;"
v-model="pageForm.unionId">
<el-option :label="item.unionname" :value="item.id" v-for="item in unions"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属单位:</div>
<div class="search-item-option">
<el-select clearable="true" filterable="true" placeholder="所属单位"
style="width: 100%;"
v-model="pageForm.unitId">
<el-option :label="item.name" :value="item.id" v-for="item in units"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">答题日期:</div>
<div class="search-item-option">
<el-date-picker
@change="doSearch"
style="width: 100%"
v-model="pageForm.answerDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择答题日期">
</el-date-picker>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="得分名单">
<template #func>
<el-button :disabled="!pageForm.questionId" @click="doExportInventory" icon="el-icon-printer"
size="small"
type="primary">导出得分名单
</el-button>
<!--<el-button :disabled="!pageForm.questionId" @click="doExportAll" icon="el-icon-printer"
size="small"
type="primary">导出分工会阶段得分
</el-button>-->
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" class="vi-table"
ref="table" row-key="id" style="width: 100%" v-loading="tableLoading">
<el-table-column
align="center" header-align="center" label="名次" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns">
<template v-if="column.prop=='dayCount'" scope="{row}">
<span @click="showDays(row)" style="color: #236eb4; cursor: pointer">{{ row.dayCount ? row.dayCount : 0 }}</span>
</template>
</el-table-column>
</el-table>
<!--# include("/layouts/pagination.html"){}#-->
</el-card>
</template>
</guava>
<el-dialog title="答题次数" :visible.sync="dayDialogVisible" width="40%">
<el-table :data="dayTableData" style="width: 100%;" max-height="400">
<el-table-column align="center" header-align="center" show-overflow-tooltip label="姓名"
prop="username"></el-table-column>
<el-table-column align="center" header-align="center" show-overflow-tooltip label="工号"
prop="loginname"></el-table-column>
<el-table-column align="center" header-align="center" show-overflow-tooltip label="答题时间"
prop="day"></el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dayDialogVisible = false">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
dayDialogVisible: false,
dayTableData: [],
unions: [],
units: [],
questions: [],
tableLoading: false,
tableKey: '',
tableColumns: [
{prop: 'username', label: '姓名'},
{prop: 'loginname', label: '工号'},
{prop: 'sex', label: '性别'},
{prop: 'unitname', label: '单位'},
{prop: 'unionname', label: '工会'},
{prop: 'mobile', label: '联系方式'},
// {prop: 'answerTotal', label: '答题次数(第几回答题)', sortable: true},
{prop: 'max_score', label: '得分'},
{prop: 'answerDate', label: '答题日期'},
{prop: 'answerNum', label: '答题次数'},
],
pageForm: {
unionId: '',
unitId: '',
year: new Date().getFullYear() + '',
keyWord: '',
answerDate: moment().format("YYYY-MM-DD")
}
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue')
},
methods: {
showDays(row) {
if (!row.days || row.dayCount === 0) {
return
}
this.dayTableData = []
row.days.split(',').map(o => {
this.dayTableData.push({username: row.username, loginname: row.loginname, day: o})
})
this.dayDialogVisible = true
},
doExportInventory() {
let {questionId, unionId, unitId, answerDate} = this.pageForm
answerDate = answerDate == null ? '' : answerDate
window.open(loc() + "/doExport?questionId=" + questionId + "&unionId=" + unionId + "&unitId=" + unitId + "&answerDate=" + answerDate)
},
doExportAll() {
const {questionId, unionId, unitId} = this.pageForm
window.open(loc() + "/doExportAll?questionId=" + questionId)
},
async yearChange() {
this.questions = await this.getQuestion()
this.questions = this.questions.filter(v => v.qlx === 2)
this.$set(this.pageForm, "questionId", this.questions.length > 0 ? this.questions[0].qid : '')
this.doSearch()
},
async getQuestion() {
const {data} = await $.get(loc()+"/getQuestion", {year: this.pageForm.year})
return data
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
},
async created() {
this.questions = await this.getQuestion()
this.questions = this.questions.filter(v => v.qlx === 2)
this.$set(this.pageForm, "questionId", this.questions.length > 0 ? this.questions[0].qid : '')
this.pageData();
this.unions = await getUnions(null)
this.flushUnits();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,481 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
#qsmEditor .w-e-text-container {
height: 200px !important;
}
.btDiv {
cursor: pointer;
}
.btDiv:hover {
background-color: rgb(240, 240, 240);
}
.shou {
cursor: pointer;
}
.issue {
cursor: pointer;
padding: 20px 0;
}
.issue:hover {
background-color: rgb(240, 240, 240);
}
.el-divider {
background-color: #409EFF;
}
.el-divider__text {
color: #409EFF;
}
.inputParent input {
border: none;
border-bottom: 1px solid rgb(220, 223, 230);
border-radius: 0;
}
.issueList > .el-table__header-wrapper {
display: none;
}
.issueList .el-table__expanded-cell {
background-color: rgb(250, 250, 250) !important;
}
.el-table .last-row {
background-color: rgb(250, 250, 250);
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="btn-group tool-button mt5">
<el-date-picker
:clearable="false"
placeholder="选择年"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
<div class="btn-group tool-button mt5">
<el-input placeholder="请输入内容" v-model="pageForm.qtitle">
<template slot="prepend">标题</template>
</el-input>
</div>
<!-- <div class="btn-group tool-button mt5">-->
<!-- <el-select v-model="pageForm.qlx"-->
<!-- placeholder="类型">-->
<!-- <el-option-->
<!-- v-for="item in [{x:1,y:'问卷调查'},{x:2,y:'投票'}]"-->
<!-- :key="item.x"-->
<!-- :label="item.y"-->
<!-- :value="item.x">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </div>-->
<div class="btn-group tool-button mt5">
<el-button @click="doSearch" icon="el-icon-search"
style="background-color:#409eff;color: white;"></el-button>
</div>
</el-card>
<el-card shadow="never" class="mt20">
<el-table
:data="tableData"
header-align="center"
size="medium"
style="width: 100%"
>
<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="qtitle">
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="说明"
prop="qsm"
show-overflow-tooltip="true">
<template scope="scope">
<div v-html="scope.row.qsm" v-if="scope.row.qsm">{{scope.row.qsm}}</div>
<span v-else>暂无</span>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="创建人"
prop="username">
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="调查时间"
prop="qctime">
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="类型"
prop="qlx">
<template scope="scope">
<span style="color: #67C23A" v-if="scope.row.qlx==1">问卷调查</span>
<span style="color: #67C23A" v-if="scope.row.qlx==2">在线答题</span>
<span style="color: #67C23A" v-if="scope.row.qlx==3">购物问卷</span>
<span style="color: #67C23A" v-if="scope.row.qlx==4">意向选择</span>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="状态"
prop="qflag">
<template scope="scope">
<span style="color: #E6A23C" v-if="scope.row.qflag==1">未开启</span>
<span style="color: #67C23A" v-if="scope.row.qflag==2">已开启</span>
<span style="color: #F56C6C" v-if="scope.row.qflag==3">已关闭</span>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="操作" width="250px">
<template scope="scope">
<el-button @click="openView(scope.row.qid)" plain size="small" type="primary">查看报告
</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
:current-page="pageForm.pageNumber"
:page-size="pageForm.pageSize"
:page-sizes="[10, 20, 30, 50]"
:total="pageForm.totalCount"
@current-change="pageNumberChange"
@size-change="pageSizeChange"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</el-row>
</el-card>
</template>
<template #edit_func>
<el-button @click="doExport" icon="el-icon-printer" type="primary">导出</el-button>
</template>
<template #edit>
<div style="padding: 0 150px">
<el-row style="text-align: center">
<h2>{{viewData.q.qtitle}}</h2>
</el-row>
<el-row style="margin-bottom: 20px">
<div v-html="viewData.q.qsm"></div>
</el-row>
<el-row v-for="issue,idx in viewData.q.issues">
<el-row>
<span style="font-weight: bolder;color: rgb(120,120,120)">第 {{idx+1}} 题:</span>
<div style="display: inline-block" v-html="issue.iname"></div>
<span style="color: rgb(180,180,180)" v-if="issue.itx==1&&issue.iisdx">[单选题]</span>
<span style="color: rgb(180,180,180)" v-if="issue.itx==1&&!issue.iisdx">[多选题]</span>
<span style="color: rgb(180,180,180)" v-if="issue.itx==2">[填空题]</span>
</el-row>
<el-row style="margin: 20px 0">
<el-table
:data="issue.wors"
:row-class-name="tableRowClassName"
header-align="center"
style="width: 100%"
v-if="issue.itx==1"
>
<el-table-column
align="center"
header-align="center"
label="选项"
prop="wtxt">
<template scope="scope">
{{scope.row.wtxt}}
<span @click="openTkView(scope.row.wid)"
style="color: #409EFF;cursor:pointer;text-decoration: underline"
v-if="scope.row.wistk">详细</span>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="小计"
prop="xj">
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="比例"
prop="bl">
<template scope="scope">
<el-progress :percentage="scope.row.bl"
v-if="scope.row.bl!=undefined"></el-progress>
</template>
</el-table-column>
</el-table>
<el-button @click="openTkView(issue.wors[0].wid)" plain size="small" type="primary"
v-else>
查看详细信息
</el-button>
</el-row>
</el-row>
</div>
</template>
</guava>
<el-dialog
:close-on-click-modal="false"
:visible.sync="tkViewDialogVisible"
custom-class="ViewDialogClass"
title="详细信息"
width="50%"
>
<el-row>
<div class="btn-group tool-button mt5">
<el-input placeholder="请输入内容" size="small" v-model="tkPageForm.searchKeyword">
<template slot="prepend">文本</template>
</el-input>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="doTkSearch" icon="el-icon-search" size="small"
style="background-color:#409eff;color: white;"></el-button>
</div>
</el-row>
<el-row class="el-table-container" style="margin-top: 20px;">
<el-table
:data="tkTableData"
header-align="center"
size="medium"
style="width: 100%"
>
<el-table-column
align="center"
header-align="center"
label="序号"
type="index"
>
<template scope="scope">
<span>{{scope.$index+(tkPageForm.pageNumber - 1) * tkPageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="提交时间"
prop="rtime"
width="200px">
</el-table-column>
<el-table-column
header-align="center"
label="文本"
prop="rval">
</el-table-column>
</el-table>
</el-row>
<el-row class="el-pagination-container">
<el-pagination
:current-page="tkPageForm.pageNumber"
:page-size="tkPageForm.pageSize"
:page-sizes="[10, 20, 30, 50]"
:total="pageForm.totalCount"
@current-change="tkPageNumberChange"
@size-change="tkPageSizeChange"
layout="total, prev, pager, next">
</el-pagination>
</el-row>
</el-dialog>
</div>
<script>
let E = window.wangEditor
let qsmEditor
let upTxtEditor
let vue = new Vue({
el: '#app',
data() {
return {
v: "index",
tableData: [],
tkTableData: [],
pageForm: {
searchName: "",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: "",
year: new Date().getFullYear() + ''
},
tkPageForm: {
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
title: '',
},
viewData: {q: {issue: [{word: []}]}},
tkViewDialogVisible: false,
questionId: ''
}
},
methods: {
doExport() {
location.href = loc() + '/doExport?questionId=' + this.questionId
},
tableRowClassName(row, rowIndex) {
if (row.row.bl == undefined) {
return 'last-row';
}
return '';
},
openTkView(wid) {
this.tkPageForm.wid = wid
this.tkPageData()
this.tkViewDialogVisible = true
},
doTkSearch() {
this.tkPageForm.pageNumber = 1;
this.tkPageData();
},
tkPageNumberChange(val) {//页码更新操作
this.tkPageForm.pageNumber = val;
this.tkPageData();
}
,
tkPageSizeChange(val) {//分页大小更新操作
this.tkPageForm.pageSize = val;
this.tkPageData();
}
,
tkPageData() {//加载分页数据
let self = this;
sublime.showLoadingbar();//显示loading
$.post(loc() + "/tkData", self.tkPageForm, function (data) {
sublime.closeLoadingbar();//关闭loading
if (data.code == 0) {
self.tkTableData = data.data.list;
self.tkPageForm.totalCount = data.data.totalCount;
} else {
self.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
},
openView(qid) {
this.questionId = qid
$.get(loc() + "/getReplyData", {qid: qid}, (data) => {
if (data.code == 0) {
data.data.q.issues.forEach(function (issue) {
issue.wors.forEach(function (wor) {
xj = data.data[issue.iid].hasOwnProperty(wor.wid) ? data.data[issue.iid][wor.wid] : 0
wor.xj = xj
console.log(data.data[issue.iid].num)
wor.bl = (xj / data.data[issue.iid].num).toFixed(2) * 100
wor.bl = isNaN(wor.bl) ? 0 : wor.bl
})
// issue.wors.push({wtxt: '本题有效填写人次', xj: data.data[issue.iid].yxs})
}
)
this.viewData = data.data
// this.v = "view"
this.$refs.guava.edit()
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
})
},
doSearch() {
this.pageForm.pageNumber = 1;
this.pageData();
}
,
pageOrder(column) {//按字段排序
switch (column.order) {
case 'descending':
column.order = 'desc'
break
case "ascending":
column.order = 'asc'
break
}
this.pageForm.pageOrderName = column.prop;
this.pageForm.pageOrderBy = column.order;
this.pageData();
}
,
pageNumberChange(val) {//页码更新操作
this.pageForm.pageNumber = val;
this.pageData();
}
,
pageSizeChange(val) {//分页大小更新操作
this.pageForm.pageSize = val;
this.pageData();
}
,
pageData() {//加载分页数据
let self = this;
sublime.showLoadingbar();//显示loading
$.post(loc() + "/data", self.pageForm, function (data) {
sublime.closeLoadingbar();//关闭loading
if (data.code == 0) {
self.tableData = data.data.list;
self.pageForm.totalCount = data.data.totalCount;
} else {
self.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
}
,
},
created() {
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,231 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-tabs__content {
padding-top: 20px;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
:clearable="false"
@change="yearChange"
placeholder="选择年"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属问卷:</div>
<div class="search-item-option">
<el-select filterable="true" placeholder="所属问卷" style="width: 100%;" @change="doSearch"
v-model="pageForm.questionId">
<el-option :label="item.qtitle" :value="item.qid" v-for="item in questions"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">工号姓名:</div>
<div class="search-item-option">
<el-input placeholder="输入关键字" v-model="pageForm.searchKeyword" maxlength="10"></el-input>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select @change="flushUnits" @clear="flushUnits" clearable="true"
filterable="true"
placeholder="所属工会" style="width: 100%;"
v-model="pageForm.unionId">
<el-option :label="item.unionname" :value="item.id" v-for="item in unions"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属单位:</div>
<div class="search-item-option">
<el-select clearable="true" filterable="true" placeholder="所属单位"
style="width: 100%;"
v-model="pageForm.unitId">
<el-option :label="item.name" :value="item.id" v-for="item in units"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="参加人员">
<template #func>
<el-button :disabled="!pageForm.questionId" @click="doExportInventory" icon="el-icon-printer"
size="small"
type="primary">导出名单
</el-button>
<el-button :disabled="!pageForm.questionId" @click="exportAnswerDateAndScore"
icon="el-icon-printer"
size="small"
type="primary">每日都答题用户名单
</el-button>
<!--<el-button :disabled="!pageForm.questionId" @click="doExportAll" icon="el-icon-printer"
size="small"
type="primary">导出分工会阶段得分
</el-button>-->
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" class="vi-table"
ref="table" row-key="id" style="width: 100%" v-loading="tableLoading">
<el-table-column
align="center" header-align="center" label="名次" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns">
<template v-if="column.prop=='dayCount'" scope="{row}">
<span @click="showDays(row)" style="color: #236eb4; cursor: pointer">{{ row.dayCount ? row.dayCount : 0 }}</span>
</template>
</el-table-column>
</el-table>
<!--# include("/layouts/pagination.html"){}#-->
</el-card>
</template>
</guava>
<!-- <el-dialog title="答题次数" :visible.sync="dayDialogVisible" width="40%">-->
<!-- <el-table :data="dayTableData" style="width: 100%;" max-height="400">-->
<!-- <el-table-column align="center" header-align="center" show-overflow-tooltip label="姓名"-->
<!-- prop="username"></el-table-column>-->
<!-- <el-table-column align="center" header-align="center" show-overflow-tooltip label="工号"-->
<!-- prop="loginname"></el-table-column>-->
<!-- <el-table-column align="center" header-align="center" show-overflow-tooltip label="答题时间"-->
<!-- prop="day"></el-table-column>-->
<!-- </el-table>-->
<!-- <span slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="dayDialogVisible = false">确 定</el-button>-->
<!-- </span>-->
<!-- </el-dialog>-->
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
dayDialogVisible: false,
dayTableData: [],
unions: [],
units: [],
questions: [],
tableLoading: false,
tableKey: '',
tableColumns: [
{prop: 'username', label: '姓名'},
{prop: 'loginname', label: '工号'},
{prop: 'sex', label: '性别'},
{prop: 'unitname', label: '单位'},
{prop: 'unionname', label: '工会'},
{prop: 'mobile', label: '联系方式'},
// {prop: 'answerTotal', label: '答题次数(第几回答题)', sortable: true},
{prop: 'max_score', label: '得分'},
// {prop: 'answerDate', label: '答题日期'},
],
pageForm: {
unionId: '',
unitId: '',
year: new Date().getFullYear() + '',
keyWord: '',
answerDate: moment().format("YYYY-MM-DD")
}
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue')
},
methods: {
showDays(row) {
if (!row.days || row.dayCount === 0) {
return
}
this.dayTableData = []
row.days.split(',').map(o => {
this.dayTableData.push({username: row.username, loginname: row.loginname, day: o})
})
this.dayDialogVisible = true
},
doExportInventory() {
let {questionId, unionId, unitId, answerDate} = this.pageForm
answerDate = answerDate == null ? '' : answerDate
window.open(loc() + "/export?questionId=" + questionId + "&unionId=" + unionId + "&unitId=" + unitId + "&answerDate=" + answerDate)
},
exportAnswerDateAndScore() {
const {questionId} = this.pageForm
window.open(loc() + "/exportAnswerDateAndScore?id=" + questionId)
},
doExportAll() {
const {questionId, unionId, unitId} = this.pageForm
window.open(loc() + "/doExportAll?questionId=" + questionId)
},
async yearChange() {
this.questions = await this.getQuestion()
this.questions = this.questions.filter(v => v.qlx === 2)
this.$set(this.pageForm, "questionId", this.questions.length > 0 ? this.questions[0].qid : '')
this.doSearch()
},
async getQuestion() {
const {data} = await $.get("/platform/question/answer/ranking/getQuestion", {year: this.pageForm.year})
return data
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
},
async created() {
this.questions = await this.getQuestion()
this.questions = this.questions.filter(v => v.qlx === 2)
this.$set(this.pageForm, "questionId", this.questions.length > 0 ? this.questions[0].qid : '')
this.pageData();
this.unions = await getUnions(null)
this.flushUnits();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,198 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-tabs__content {
padding-top: 20px;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
:clearable="false"
@change="yearChange"
placeholder="选择年"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属问卷:</div>
<div class="search-item-option">
<el-select filterable="true" placeholder="所属问卷" style="width: 100%;" @change="doSearch"
v-model="pageForm.questionId">
<el-option :label="item.qtitle" :value="item.qid" v-for="item in questions"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">工号姓名:</div>
<div class="search-item-option">
<el-input placeholder="输入关键字" v-model="pageForm.searchKeyword" maxlength="10"></el-input>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select @change="flushUnits" @clear="flushUnits" clearable="true"
filterable="true"
placeholder="所属工会" style="width: 100%;"
v-model="pageForm.unionId">
<el-option :label="item.unionname" :value="item.id" v-for="item in unions"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属单位:</div>
<div class="search-item-option">
<el-select clearable="true" filterable="true" placeholder="所属单位"
style="width: 100%;"
v-model="pageForm.unitId">
<el-option :label="item.name" :value="item.id" v-for="item in units"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">中奖日期:</div>
<div class="search-item-option">
<el-date-picker
@change="doSearch"
style="width: 100%"
v-model="pageForm.winDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择中奖日期">
</el-date-picker>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="中奖名单">
<template #func>
<el-button :disabled="!pageForm.questionId" @click="exportWinners" icon="el-icon-printer"
size="small"
type="primary">导出中奖名单
</el-button>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" class="vi-table"
ref="table" row-key="id" style="width: 100%" v-loading="tableLoading">
<el-table-column
align="center" header-align="center" label="名次" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
:key="column.prop"
v-for="column in tableColumns">
</el-table-column>
</el-table>
<!--# include("/layouts/pagination.html"){}#-->
</el-card>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
dayDialogVisible: false,
dayTableData: [],
unions: [],
units: [],
questions: [],
tableLoading: false,
tableKey: '',
tableColumns: [
{prop: 'username', label: '姓名'},
{prop: 'loginname', label: '工号'},
{prop: 'sex', label: '性别'},
{prop: 'unitname', label: '单位'},
{prop: 'unionname', label: '工会'},
{prop: 'mobile', label: '联系方式'},
{prop: 'winDate', label: '中奖日期'},
{prop: 'maxScore', label: '抽奖分数(最高分)'},
],
pageForm: {
unionId: '',
unitId: '',
year: new Date().getFullYear() + '',
keyWord: ''
}
}
},
methods: {
exportWinners() {
const {questionId, unionId, unitId} = this.pageForm
window.open(loc() + "/exportWinners?questionId=" + questionId + "&unionId=" + unionId + "&unitId=" + unitId)
},
async yearChange() {
this.questions = await this.getQuestion()
this.questions = this.questions.filter(v => v.qlx === 2)
this.$set(this.pageForm, "questionId", this.questions.length > 0 ? this.questions[0].qid : '')
this.doSearch()
},
async getQuestion() {
const {data} = await $.get("/platform/question/answer/winners/getQuestion", {year: this.pageForm.year})
return data
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
},
async created() {
this.questions = await this.getQuestion()
this.questions = this.questions.filter(v => v.qlx === 2)
this.$set(this.pageForm, "questionId", this.questions.length > 0 ? this.questions[0].qid : '')
this.pageData();
this.unions = await getUnions(null)
this.flushUnits();
}
})
</script>
<!--#
}
#-->