体检管理添加体检反馈功能
This commit is contained in:
+213
@@ -0,0 +1,213 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" class="platform" v-cloak>
|
||||
<guava ref="guava" padding="0 5%">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
v-model="pageForm.year"
|
||||
type="year"
|
||||
style="width: 100%;"
|
||||
value-format="yyyy"
|
||||
placeholder="请选择年度"
|
||||
@change="yearChange">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="体检项目">
|
||||
<el-select v-model="pageForm.projectId"
|
||||
style="width: 100%;"
|
||||
clearable
|
||||
@change="doSearch">
|
||||
<el-option v-for="item in projectOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="分工会" v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])">
|
||||
<el-select v-model="pageForm.unionId"
|
||||
style="width: 100%;"
|
||||
clearable
|
||||
filterable
|
||||
@change="doSearch">
|
||||
<el-option v-for="item in unions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<table-tool label="问题反馈列表">
|
||||
<el-button type="danger"
|
||||
size="small"
|
||||
:disabled="selectedFeedbackIds.length === 0"
|
||||
@click="deleteFeedbackBatch">批量删除</el-button>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData"
|
||||
style="width: 100%"
|
||||
row-key="id"
|
||||
:size="tableSize"
|
||||
v-loading="tableLoading"
|
||||
@selection-change="handleSelectionChange"
|
||||
ref="table"
|
||||
class="vi-table">
|
||||
<el-table-column type="selection"
|
||||
width="55"
|
||||
align="center"
|
||||
header-align="center"></el-table-column>
|
||||
<el-table-column type="index"
|
||||
:index="indexMethod"
|
||||
label="序号"
|
||||
width="80px"
|
||||
align="center"
|
||||
header-align="center"></el-table-column>
|
||||
<el-table-column prop="year"
|
||||
label="年度"
|
||||
min-width="120px"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="projectName"
|
||||
label="体检项目"
|
||||
min-width="160px"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="unionName"
|
||||
label="分工会"
|
||||
min-width="160px"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="feedbackInfo"
|
||||
label="反馈信息"
|
||||
min-width="240px"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="createdByName"
|
||||
label="创建人"
|
||||
min-width="120px"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="创建时间"
|
||||
min-width="180px"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="{row}">
|
||||
{{ row.createdAt ? $moment(row.createdAt).format('YYYY-MM-DD HH:mm:ss') : '' }}
|
||||
</template>
|
||||
</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 {
|
||||
tableData: [],
|
||||
selectedFeedbackIds: [],
|
||||
unions: [],
|
||||
projectOptions: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSelectionChange(rows) {
|
||||
this.selectedFeedbackIds = rows.map(function (item) {
|
||||
return item.id
|
||||
})
|
||||
},
|
||||
async pageData() {
|
||||
this.tableLoading = true
|
||||
const resp = await this.$axios.post("/platform/healthCheckup/list/mange/feedback/query/pageData", this.pageForm)
|
||||
if (resp.code === 0) {
|
||||
this.tableData = [].concat(resp.data.list || [])
|
||||
this.selectedFeedbackIds = []
|
||||
this.pageForm.totalCount = resp.data.totalCount || 0
|
||||
this.$nextTick(function () {
|
||||
if (this.$refs.table) {
|
||||
this.$refs.table.doLayout()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
this.tableLoading = false
|
||||
},
|
||||
async doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
await this.pageData()
|
||||
},
|
||||
async deleteFeedbackBatch() {
|
||||
if (this.selectedFeedbackIds.length === 0) {
|
||||
this.notifyWarning("请选择需要删除的反馈")
|
||||
return
|
||||
}
|
||||
const confirm = await this.$confirm("确认批量删除选中的反馈吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await this.$axios.post("/platform/healthCheckup/list/mange/deleteFeedbackBatch", {
|
||||
ids: this.selectedFeedbackIds.join(",")
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
await this.pageData()
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
async yearChange() {
|
||||
const resp = await $.get("/platform/healthCheckup/project/mange/getHealthCheckupProject", {year: this.pageForm.year})
|
||||
if (resp.code === 0) {
|
||||
this.projectOptions = resp.data
|
||||
if (resp.data && resp.data.length > 0) {
|
||||
const currentProjectId = this.pageForm.projectId
|
||||
if (!currentProjectId || !resp.data.some(function (item) {
|
||||
return item.id === currentProjectId
|
||||
})) {
|
||||
this.pageForm.projectId = resp.data[0].id
|
||||
}
|
||||
} else {
|
||||
this.pageForm.projectId = ""
|
||||
}
|
||||
await this.doSearch()
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.pageForm.year = this.$moment().format('YYYY')
|
||||
this.unions = await this.$businessTool.listUnion()
|
||||
if (!this.pageForm.unionId && this.unions && this.unions.length === 1) {
|
||||
this.pageForm.unionId = this.unions[0].id
|
||||
}
|
||||
await this.yearChange()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+104
-2
@@ -1,4 +1,4 @@
|
||||
<!--#
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
@@ -85,6 +85,8 @@ layout("/layouts/platform.html"){
|
||||
<el-radio-button :label="1">已选择</el-radio-button>
|
||||
<el-radio-button :label="0">未选择</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-button type="primary" size="small" @click="openHealthFeedback"
|
||||
v-if="$auth.hasRoleOr(['BRANCH_UNION_ADMIN'])">体检反馈</el-button>
|
||||
<el-button type="primary" size="small" @click="openImport"
|
||||
v-if="$auth.hasPermissionOr(['healthCheckup.list.import'])">导入名单
|
||||
</el-button>
|
||||
@@ -233,6 +235,27 @@ layout("/layouts/platform.html"){
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="体检反馈" :visible.sync="healthFeedbackDialog" width="60%"
|
||||
:close-on-click-modal="false">
|
||||
<el-form :model="healthFeedbackForm" label-width="100px">
|
||||
<el-form-item label="反馈信息">
|
||||
<el-input v-model="healthFeedbackForm.feedbackInfo" placeholder="请输入反馈信息"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end" class="mb10">
|
||||
<el-button @click="healthFeedbackDialog=false" type="primary" plain>取消</el-button>
|
||||
<el-button @click="saveHealthFeedback" type="primary" v-loading="healthFeedbackLoading">保存</el-button>
|
||||
</el-row>
|
||||
<el-table :data="healthFeedbackList" border style="width: 100%">
|
||||
<el-table-column align="center" label="问题反馈" prop="feedbackInfo" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column align="center" label="操作" width="100px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="deleteHealthFeedback(row)" type="danger" size="mini">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<excel-import
|
||||
ref="excelImportRef"
|
||||
@@ -297,6 +320,15 @@ layout("/layouts/platform.html"){
|
||||
projectId: "",
|
||||
remarks: "",
|
||||
},
|
||||
healthFeedbackDialog: false,
|
||||
healthFeedbackLoading: false,
|
||||
healthFeedbackList: [],
|
||||
healthFeedbackForm: {
|
||||
year: "",
|
||||
projectId: "",
|
||||
unionId: "",
|
||||
feedbackInfo: ""
|
||||
},
|
||||
campusOptions: [],
|
||||
isEmployedOptions: [
|
||||
{value: '是', label: '是'},
|
||||
@@ -418,6 +450,72 @@ layout("/layouts/platform.html"){
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
},
|
||||
validateHealthFeedbackCondition() {
|
||||
// 反馈必须绑定当前筛选的年度和体检项目;分工会未选时由后端自动回落到当前登录人所属分工会。
|
||||
if (!this.pageForm.year || !this.pageForm.projectId) {
|
||||
this.notifyWarning("请先选择年度、体检项目后再打开体检反馈")
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
async openHealthFeedback() {
|
||||
if (!this.validateHealthFeedbackCondition()) {
|
||||
return
|
||||
}
|
||||
this.healthFeedbackForm.year = this.pageForm.year
|
||||
this.healthFeedbackForm.projectId = this.pageForm.projectId
|
||||
this.healthFeedbackForm.unionId = this.pageForm.unionId
|
||||
this.healthFeedbackForm.feedbackInfo = ""
|
||||
await this.queryHealthFeedbackList()
|
||||
this.healthFeedbackDialog = true
|
||||
},
|
||||
async queryHealthFeedbackList() {
|
||||
const resp = await $.get(loc() + "/feedbackList", {
|
||||
year: this.pageForm.year,
|
||||
projectId: this.pageForm.projectId,
|
||||
unionId: this.pageForm.unionId
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.healthFeedbackList = resp.data || []
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
},
|
||||
async saveHealthFeedback() {
|
||||
if (!this.validateHealthFeedbackCondition()) {
|
||||
return
|
||||
}
|
||||
if (!this.healthFeedbackForm.feedbackInfo) {
|
||||
this.notifyWarning("请输入反馈信息")
|
||||
return
|
||||
}
|
||||
this.healthFeedbackLoading = true
|
||||
const resp = await $.post(loc() + "/saveFeedback", this.healthFeedbackForm)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.healthFeedbackForm.feedbackInfo = ""
|
||||
await this.queryHealthFeedbackList()
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
this.healthFeedbackLoading = false
|
||||
},
|
||||
async deleteHealthFeedback(row) {
|
||||
const confirm = await this.$confirm("确认删除这条反馈吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await $.post(loc() + "/deleteFeedback", {id: row.id})
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
await this.queryHealthFeedbackList()
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
openImport() {
|
||||
// importUser
|
||||
|
||||
@@ -438,7 +536,7 @@ layout("/layouts/platform.html"){
|
||||
cancelButtonText: "取消",
|
||||
type: "info"
|
||||
}).then(async () => {
|
||||
const resp = await this.$axios.post(loc() + '/doDelete', {id});
|
||||
const resp = await $.post(loc() + '/doDelete', {id: id});
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg);
|
||||
this.doSearch();
|
||||
@@ -513,6 +611,9 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
async created() {
|
||||
this.unions = await this.$businessTool.listUnion()
|
||||
if (!this.pageForm.unionId && this.unions && this.unions.length === 1) {
|
||||
this.pageForm.unionId = this.unions[0].id
|
||||
}
|
||||
this.flushUnits()
|
||||
await this.yearChange()
|
||||
this.pageData()
|
||||
@@ -524,3 +625,4 @@ layout("/layouts/platform.html"){
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user