初始化

This commit is contained in:
2025-07-28 15:52:07 +08:00
commit cd0e77b332
1304 changed files with 302802 additions and 0 deletions

View File

@@ -0,0 +1,242 @@
<template>
<div class="app-container">
<el-form class="lookForm" :model="queryParams" ref="queryForm" size="mini" :inline="true" label-width="140px">
<el-form-item label="学号" prop="stuNo">
<el-input v-model="queryParams.stuNo" placeholder="请输入学号" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="学生姓名" prop="stuName">
<el-input v-model="queryParams.stuName" placeholder="请输入学生姓名" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="岗位名称" prop="postName">
<el-input v-model="queryParams.postName" placeholder="请输入岗位名称" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="工作日期" prop="workDate">
<el-date-picker clearable v-model="queryParams.workDate" type="date" value-format="yyyy-MM-dd"
placeholder="请选择工作日期">
</el-date-picker>
</el-form-item>
<el-form-item label="审核状态" prop="applyStatus">
<el-select v-model="queryParams.applyStatus" placeholder="请选择审核状态" clearable>
<el-option v-for="dict in dict.type.qgzx_stu_post_status" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="tableData">
<el-table-column label="学号" align="center" prop="stuNo" />
<el-table-column label="姓名" align="center" prop="stuName" />
<el-table-column label="学院" align="center" prop="stuDept" />
<el-table-column label="岗位名称" align="center" prop="postName" />
<el-table-column label="岗位类型" align="center" prop="postType" />
<el-table-column label="设岗部门" align="center" prop="deptName" />
<el-table-column label="工作日期" align="center" prop="workDate" />
<el-table-column label="工作时长" align="center">
<template v-slot="{ row }">
{{ row.postType == "固定岗位A" ? row.workTime + "" : row.workTime + "小时" }}
</template>
</el-table-column>
<el-table-column label="申请时间" align="center" prop="applyTime" width="170px"/>
<el-table-column label="审核状态" align="center" prop="applyStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.qgzx_stu_post_status" :value="scope.row.applyStatus" />
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view" @click="lookVClick(scope.row)">查看</el-button>
<el-button v-if="scope.row.applyStatus == '2'" size="mini" type="text" icon="el-icon-close"
@click="delLog(scope.row)">撤回工时</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
<el-dialog title="审核" :visible.sync="lookV" append-to-body>
<el-form class="lookForm" size="mini" ref="applyForm" label-width="148px">
<el-form-item label="工作岗位">
<el-input v-model="lookForm.postName" readonly />
</el-form-item>
<el-form-item label="主要工作">
<el-input v-model="lookForm.mainWork" type="textarea" readonly />
</el-form-item>
<el-form-item label="工作附件">
<ImagePreview width="200px" height="200px" :src="lookForm.workMaterial" />
</el-form-item>
<el-form-item label="工作日期">
<el-input v-model="lookForm.workDate" readonly />
</el-form-item>
<el-form-item label="工作时长">
<el-input v-model="lookForm.workTime" type="number" readonly />
{{ lookForm.postType == "固定岗位A" ? "天" : "小时" }}
</el-form-item>
<el-form-item label="审核意见">
<el-radio-group v-model="lookForm.zdlsCmt" disabled>
<el-radio :label="'通过'">通过</el-radio>
<el-radio :label="'不通过'">不通过</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="指导老师签章">
<img v-if="lookForm.zdlsSign" :src="baseurl + lookForm.zdlsSign" width="200px" height="50px"
class="avatar">
</el-form-item>
<el-form-item v-if="!isEmpty(lookForm.zdlsCmt)" label="审核时间">
<el-input v-model="lookForm.zdlsTime" readonly />
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { getOwnSign } from "@/api/workstudy/post";
import { listZdlsAll as getList, cancelLog } from "@/api/workstudy/worklog";
import { CheckImgExists, fullLoading, isEmpty } from "@/api/helpFunc";
import { getTokenKeySessionStorage as getToken } from "@/utils/auth";
export default {
name: "workstudy-StuPost-zdls",
dicts: ['qgzx_stu_post_status'],
data() {
return {
isEmpty,
loading: false,
tableData: [],
total: 0,
queryParams: {
pageNum: 1,
pageSize: 10,
postName: null
},
editV: false,
lookForm: {},
applyForm: {},
upload: {
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/common/upload"
},
baseurl: process.env.VUE_APP_BASE_API + "/",
lookV: false,
auditForm: {
id: null,
zdlsCmt: null,
zdlsSign: null
},
}
},
created() {
this.getList();
},
methods: {
delLog(row) {
let id = row.id;
this.$confirm('是否撤销工作记录,撤销后不可恢复', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
let loading = fullLoading(this);
let res = await cancelLog(id);
loading.close();
if (res.code == 200) {
this.$message.success(res.msg);
this.getList();
}
});
},
async lookVClick(row) {
let loading1 = fullLoading(this);
let res1 = await getOwnSign();
loading1.close();
if (res1.code == 200) {
let data = { ...res1.data };
if (isEmpty(data.signature)) {
this.$confirm('您的签名尚未上传', '提示', {
confirmButtonText: '点我前往',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$router.push("/user/profile")
}).catch(() => {
});
} else {
this.lookForm = {};
this.lookForm = { ...row };
this.auditForm.id = this.lookForm.id;
this.auditForm.zdlsSign = data.signature;
this.lookV = true;
}
}
},
handleAvatarSuccess(response, file, fileList) {
this.auditForm.zdlsSign = response.fileName;
this.$forceUpdate();
},
async getList() {
this.loading = true;
let res = await getList(this.queryParams);
this.loading = false;
if (res.code == 200) {
this.tableData = [...res.rows];
this.total = res.total;
}
},
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
}
}
</script>
<style scoped lang="scss">
.lookForm {
.el-form-item {
margin-bottom: 5px;
}
}
</style>

View File

@@ -0,0 +1,228 @@
<template>
<div class="app-container">
<el-form class="lookForm" :model="queryParams" ref="queryForm" size="mini" :inline="true" label-width="140px">
<el-form-item label="学号" prop="stuNo">
<el-input v-model="queryParams.stuNo" placeholder="请输入学号" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="学生姓名" prop="stuName">
<el-input v-model="queryParams.stuName" placeholder="请输入学生姓名" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="学生学院" prop="stuDept">
<el-input v-model="queryParams.stuDept" placeholder="请输入学生学院" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="岗位名称" prop="postName">
<el-input v-model="queryParams.postName" placeholder="请输入岗位名称" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="设岗部门" prop="deptName">
<el-input v-model="queryParams.deptName" placeholder="请输入设岗部门" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="工作月份" prop="workMonth">
<el-date-picker clearable v-model="queryParams.workMonth" type="month" value-format="yyyy-MM"
placeholder="请选择工作月份">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="tableData">
<el-table-column label="学号" align="center" prop="stu_no" />
<el-table-column label="姓名" align="center" prop="stu_name" />
<el-table-column label="学生学院" align="center" prop="stu_dept" />
<el-table-column label="岗位名称" align="center" prop="post_name" />
<el-table-column label="岗位类型" align="center" prop="post_type" />
<el-table-column label="设岗部门" align="center" prop="dept_name" />
<el-table-column label="工作月份" align="center" prop="work_month" />
<el-table-column label="工作时长" align="center">
<template v-slot="{ row }">
{{ row.post_type == "固定岗位A" ? row.total_time + "" : row.total_time + "小时" }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template v-slot="{ row }">
<el-button type="text" size="mini" icon="el-icon-view" @click="logVClick(row)">详情</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
<el-dialog title="工作记录" :visible.sync="logV" fullscreen append-to-body>
<el-table :data="logList">
<el-table-column label="#" align="center" prop="id" />
<el-table-column label="学号" align="center" prop="stuNo" />
<el-table-column label="姓名" align="center" prop="stuName" />
<el-table-column label="学院" align="center" prop="stuDept" />
<el-table-column label="岗位名称" align="center" prop="postName" />
<el-table-column label="岗位类型" align="center" prop="postType" />
<el-table-column label="设岗部门" align="center" prop="deptName" />
<el-table-column label="工作日期" align="center" prop="workDate" />
<el-table-column label="工作时长" align="center">
<template v-slot="{ row }">
{{ row.postType == "固定岗位A" ? row.workTime + "" : row.workTime + "小时" }}
</template>
</el-table-column>
<el-table-column label="审核状态" align="center" prop="applyStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.qgzx_stu_post_status" :value="scope.row.applyStatus" />
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view"
@click="lookVClick(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="logTotal > 0" :total="logTotal" :page.sync="logParams.pageNum"
:limit.sync="logParams.pageSize" @pagination="getLogList" />
<el-dialog title="查看" width="800px" :visible.sync="lookV" append-to-body>
<el-form class="lookForm" size="mini" label-width="148px">
<el-form-item label="工作岗位">
<el-input v-model="lookForm.postName" readonly />
</el-form-item>
<el-form-item label="工作日期">
<el-input v-model="lookForm.workDate" readonly />
</el-form-item>
<el-form-item label="工作时长">
<el-input v-model="lookForm.workTime" readonly />
</el-form-item>
<el-form-item label="主要工作">
<el-input v-model="lookForm.mainWork" type="textarea" readonly />
</el-form-item>
<el-form-item label="工作附件">
<ImagePreview :src="lookForm.workMaterial" />
</el-form-item>
</el-form>
</el-dialog>
</el-dialog>
</div>
</template>
<script>
import { listWorkLogMonthTotal as getList, listView } from "@/api/workstudy/worklog";
import { fullLoading, isEmpty } from "@/api/helpFunc";
import { getTokenKeySessionStorage as getToken } from "@/utils/auth";
export default {
name: "workstudy-StuPost-zdls",
dicts: ['qgzx_stu_post_status'],
data() {
return {
isEmpty,
loading: false,
tableData: [],
total: 0,
queryParams: {
pageNum: 1,
pageSize: 10,
postName: null
},
logV: false,
logParams: {
pageNum: 1,
pageSize: 10,
workMonth: null,
stuPostId: null
},
logList: [],
logTotal: 0,
lookV: false,
lookForm: {
}
}
},
created() {
this.getList();
},
methods: {
lookVClick(row) {
this.lookForm = { ...row };
this.lookV = true;
},
async logVClick(row) {
this.logParams = {
workMonth: row.work_month,
stuPostId: row.stu_post_id,
pageNum: 1,
pageSize: 10,
};
await this.getLogList();
this.logV = true;
},
async getLogList() {
let loadiing = fullLoading(this);
let res = await listView(this.logParams);
loadiing.close();
if (res.code == 200) {
this.logList = [...res.rows];
this.logTotal = res.total;
console.log(this.logList);
}
},
async getList() {
this.loading = true;
let res = await getList(this.queryParams);
this.loading = false;
if (res.code == 200) {
this.tableData = [...res.rows];
this.total = res.total;
}
},
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
}
}
</script>
<style scoped lang="scss">
.lookForm {
.el-form-item {
margin-bottom: 5px;
}
}
</style>

View File

@@ -0,0 +1,291 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="学生岗位id" prop="stuPostId">
<el-input v-model="queryParams.stuPostId" placeholder="请输入学生岗位id" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="工作时长" prop="workTime">
<el-input v-model="queryParams.workTime" placeholder="请输入工作时长" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="工作日期" prop="workDate">
<el-date-picker clearable v-model="queryParams.workDate" type="date" value-format="yyyy-MM-dd"
placeholder="请选择工作日期">
</el-date-picker>
</el-form-item>
<el-form-item label="申请时间" prop="applyTime">
<el-date-picker clearable v-model="queryParams.applyTime" type="date" value-format="yyyy-MM-dd"
placeholder="请选择申请时间">
</el-date-picker>
</el-form-item>
<el-form-item label="审核状态" prop="applyStatus">
<el-select v-model="queryParams.applyStatus" placeholder="请选择审核状态" clearable>
<el-option v-for="dict in dict.type.qgzx_stu_post_status" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="指导老师意见" prop="zdlsCmt">
<el-input v-model="queryParams.zdlsCmt" placeholder="请输入指导老师意见" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="指导老师签章" prop="zdlsSign">
<el-input v-model="queryParams.zdlsSign" placeholder="请输入指导老师签章" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['workstudy:worklog:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
v-hasPermi="['workstudy:worklog:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
v-hasPermi="['workstudy:worklog:remove']">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['workstudy:worklog:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="worklogList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="#" align="center" prop="id" />
<el-table-column label="学生岗位id" align="center" prop="stuPostId" />
<el-table-column label="工作时长" align="center" prop="workTime" />
<el-table-column label="主要工作" align="center" prop="mainWork" />
<el-table-column label="工作附件" align="center" prop="workMaterial" />
<el-table-column label="工作日期" align="center" prop="workDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.workDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="申请时间" align="center" prop="applyTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.applyTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="审核状态" align="center" prop="applyStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.qgzx_stu_post_status" :value="scope.row.applyStatus" />
</template>
</el-table-column>
<el-table-column label="指导老师意见" align="center" prop="zdlsCmt" />
<el-table-column label="指导老师签章" align="center" prop="zdlsSign" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['workstudy:worklog:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['workstudy:worklog:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 添加或修改勤工助学工作记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="学生岗位id" prop="stuPostId">
<el-input v-model="form.stuPostId" placeholder="请输入学生岗位id" />
</el-form-item>
<el-form-item label="工作时长" prop="workTime">
<el-input v-model="form.workTime" placeholder="请输入工作时长" />
</el-form-item>
<el-form-item label="主要工作" prop="mainWork">
<el-input v-model="form.mainWork" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="工作附件" prop="workMaterial">
<el-input v-model="form.workMaterial" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="工作日期" prop="workDate">
<el-date-picker clearable v-model="form.workDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择工作日期">
</el-date-picker>
</el-form-item>
<el-form-item label="申请时间" prop="applyTime">
<el-date-picker clearable v-model="form.applyTime" type="date" value-format="yyyy-MM-dd"
placeholder="请选择申请时间">
</el-date-picker>
</el-form-item>
<el-form-item label="审核状态" prop="applyStatus">
<el-select v-model="form.applyStatus" placeholder="请选择审核状态">
<el-option v-for="dict in dict.type.qgzx_stu_post_status" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="指导老师意见" prop="zdlsCmt">
<el-input v-model="form.zdlsCmt" placeholder="请输入指导老师意见" />
</el-form-item>
<el-form-item label="指导老师签章" prop="zdlsSign">
<el-input v-model="form.zdlsSign" placeholder="请输入指导老师签章" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listWorklog, getWorklog, delWorklog, addWorklog, updateWorklog } from "@/api/workstudy/worklog";
export default {
name: "Worklog",
dicts: ['qgzx_stu_post_status'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 勤工助学工作记录表格数据
worklogList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
stuPostId: null,
workTime: null,
mainWork: null,
workMaterial: null,
workDate: null,
applyTime: null,
applyStatus: null,
zdlsCmt: null,
zdlsSign: null
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询勤工助学工作记录列表 */
getList() {
this.loading = true;
listWorklog(this.queryParams).then(response => {
this.worklogList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
stuPostId: null,
workTime: null,
mainWork: null,
workMaterial: null,
workDate: null,
applyTime: null,
applyStatus: null,
zdlsCmt: null,
zdlsSign: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加勤工助学工作记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getWorklog(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改勤工助学工作记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateWorklog(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addWorklog(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除勤工助学工作记录编号为"' + ids + '"的数据项?').then(function () {
return delWorklog(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
},
/** 导出按钮操作 */
handleExport() {
this.download('workstudy/worklog/export', {
...this.queryParams
}, `worklog_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@@ -0,0 +1,429 @@
<template>
<div class="app-container">
<el-form class="lookForm" :model="queryParams" ref="queryForm" size="mini" :inline="true" label-width="140px">
<el-form-item label="岗位名称" prop="postName">
<el-input v-model="queryParams.postName" placeholder="请输入岗位名称" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="设岗部门" prop="deptName">
<el-input v-model="queryParams.deptName" placeholder="请输入设岗部门" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="审核状态" prop="applyStatus">
<el-select v-model="queryParams.applyStatus" placeholder="请选择审核状态" clearable>
<el-option v-for="dict in dict.type.qgzx_stu_post_status" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="工作日期" prop="workDate">
<el-date-picker clearable v-model="queryParams.workDate" type="date" value-format="yyyy-MM-dd"
placeholder="请选择工作日期">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-button icon="el-icon-plus" plain type="success" size="mini" @click="addVClick">填报</el-button>
<span style="color: red;">
<!-- *每周不超过8小时, -->
固定岗位B每月不超过40小时,固定岗位A每月不超过当月的工作日.
</span>
<span>本月已填报{{ monthTime }} (不含拒绝)</span>
<el-table v-loading="loading" :data="tableData">
<el-table-column label="#" align="center" prop="id" />
<el-table-column label="学号" align="center" prop="stuNo" />
<el-table-column label="姓名" align="center" prop="stuName" />
<el-table-column label="学院" align="center" prop="stuDept" />
<el-table-column label="岗位名称" align="center" prop="postName" />
<el-table-column label="岗位类型" align="center" prop="postType" />
<el-table-column label="设岗部门" align="center" prop="deptName" />
<el-table-column label="工作日期" align="center" prop="workDate" />
<el-table-column label="工作时长" align="center">
<template v-slot="{ row }">
{{ row.postType == "固定岗位A" ? row.workTime + "" : row.workTime + "小时" }}
</template>
</el-table-column>
<el-table-column label="申请时间" align="center" prop="applyTime" width="170px" />
<el-table-column label="审核状态" align="center" prop="applyStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.qgzx_stu_post_status" :value="scope.row.applyStatus" />
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button v-if="scope.row.applyStatus == '0'" size="mini" type="text" icon="el-icon-edit"
@click="editVClick(scope.row)">修改</el-button>
<el-button v-if="scope.row.applyStatus == '0' || scope.row.applyStatus == '1'" size="mini"
type="text" icon="el-icon-close" @click="cancelApply(scope.row)">取消申请</el-button>
<el-button v-if="scope.row.applyStatus != '0'" size="mini" type="text" icon="el-icon-view"
@click="lookVClick(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
<el-dialog title="填报" :visible.sync="editV">
<el-form class="lookForm" size="mini" ref="applyForm" label-width="148px">
<el-form-item label="工作岗位">
<StuOwnPostSelect v-model="applyForm.stuPostId" />
</el-form-item>
<el-form-item label="工作日期">
<el-date-picker :picker-options="pickerOptions" v-model="applyForm.workDate" align="right"
type="date" placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item :label="postType == '固定岗位A' ? '工作时长(单位:天)' : '工作时长(单位:小时)'">
<el-input v-model="applyForm.workTime" type="number" />
</el-form-item>
<el-form-item label="主要工作">
<el-input :maxlength="200" v-model="applyForm.mainWork" type="textarea" />
</el-form-item>
<el-form-item label="工作附件">
<ImageUpload v-model="applyForm.workMaterial" />
</el-form-item>
<el-form-item label="">
<!-- <el-button plain type="primary" @click="doSave">保存</el-button> -->
<el-button plain type="success" @click="doApply">提交</el-button>
<span style="color: red;">
<!-- *每周不超过8小时, -->
每月不超过40小时.
</span>
</el-form-item>
</el-form>
</el-dialog>
<el-dialog title="查看" :visible.sync="lookV">
<el-form class="lookForm" size="mini" ref="applyForm" label-width="148px">
<el-form-item label="工作岗位">
<el-input v-model="lookForm.postName" readonly />
</el-form-item>
<el-form-item label="工作日期">
<el-input v-model="lookForm.workDate" readonly />
</el-form-item>
<el-form-item label="工作时长(单位:小时 /天)">
<el-input v-model="lookForm.workTime" readonly />
</el-form-item>
<el-form-item label="主要工作">
<el-input v-model="lookForm.mainWork" type="textarea" readonly />
</el-form-item>
<el-form-item label="工作附件">
<ImagePreview width="200px" height="200px" :src="lookForm.workMaterial" />
</el-form-item>
<el-form-item v-if="!isEmpty(lookForm.zdlsCmt)" label="审核意见">
<el-radio-group v-model="lookForm.zdlsCmt" disabled>
<el-radio :label="'通过'">通过</el-radio>
<el-radio :label="'不通过'">不通过</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="!isEmpty(lookForm.zdlsCmt)" label="指导老师签章">
<img v-if="lookForm.zdlsSign" :src="baseurl + lookForm.zdlsSign" width="200px" height="50px"
class="avatar">
</el-form-item>
<el-form-item v-if="!isEmpty(lookForm.zdlsCmt)" label="审核时间">
<el-input v-model="lookForm.zdlsTime" readonly />
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import StuOwnPostSelect from "@/views/workstudy/components/StuOwnPostSelect";
import { fullLoading, isEmpty } from "@/api/helpFunc";
import { cancelApply, computeTimeByStuNo, doApply, doSave, listOwnApply as getList } from "@/api/workstudy/worklog";
import { listOwnCanSelectPost } from "@/api/workstudy/stuPost";
import dayjs from "dayjs";
export default {
name: "workstudy-WorkLog-stu",
dicts: ['qgzx_stu_post_status'],
components: {
StuOwnPostSelect
},
data() {
return {
editV: false,
baseurl: process.env.VUE_APP_BASE_API + "/",
isEmpty,
loading: false,
tableData: [],
total: 0,
queryParams: {
pageNum: 1,
pageSize: 10,
postName: null
},
applyForm: {
},
pickerOptions: {
disabledDate(time) {
//return false // 完全开放日期选择,五天后,关闭
const today = new Date();
const currentDate = new Date(today.getFullYear(), today.getMonth(), today.getDate());
const fiveDaysAgo = new Date(today.getFullYear(), today.getMonth(), 5);
// 获取当前月份的第一天和最后一天
const firstDayOfCurrentMonth = new Date(today.getFullYear(), today.getMonth(), 1);
const lastDayOfCurrentMonth = new Date(
today.getFullYear(),
today.getMonth() + 1,
0
);
// 获取上个月的第一天和最后一天
const firstDayOfLastMonth = new Date(today.getFullYear(), today.getMonth() - 1, 1);
const lastDayOfLastMonth = new Date(
today.getFullYear(),
today.getMonth(),
0
);
// 判断今天是否在当前月份的前五天
const isWithinLastFiveDays = currentDate <= fiveDaysAgo;
// 如果今天在当前月份的前五天内,允许选择上个月的日期
if (isWithinLastFiveDays) {
return time < firstDayOfLastMonth || time > lastDayOfCurrentMonth;
} else {
// 否则,只允许选择当前月份及以后的日期
return time < firstDayOfCurrentMonth || time > lastDayOfCurrentMonth;
}
},
shortcuts: [{
text: '今天',
onClick(picker) {
picker.$emit('pick', new Date());
}
}, {
text: '昨天',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24);
picker.$emit('pick', date);
}
}]
},
lookV: false,
lookForm: {},
monthTime: 0,
postType: "",
}
},
created() {
this.computeTimeByStuNo();
this.getList();
},
methods: {
async listOwnCanSelectPost() {
let loading = fullLoading(this);
let res = await listOwnCanSelectPost();
loading.close();
if (res.code == 200) {
let data = [...res.rows];
if (!isEmpty(data)) {
let stuPost = data[0];
console.log(stuPost.id);
this.postType = stuPost.postType;
this.applyForm.stuPostId = stuPost.id;
}
}
},
async computeTimeByStuNo() {
let res = await computeTimeByStuNo();
if (res.code == 200) {
let data = { ...res.data };
if (!isEmpty(data.workTime)) {
this.monthTime = data.workTime;
}
}
},
lookVClick(row) {
this.lookForm = {};
this.lookForm = { ...row };
this.lookV = true;
},
cancelApply(row) {
let id = row.id;
this.$confirm('您确定要取消申请吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
let loading = fullLoading(this);
let res = await cancelApply(id);
loading.close();
if (res.code == 200) {
this.$message.success(res.msg);
this.getList();
}
}).catch(() => {
});
},
editVClick(row) {
this.applyForm = {};
this.applyForm = { ...row };
this.editV = true;
},
async addVClick() {
await this.listOwnCanSelectPost();
this.applyForm = {};
this.editV = true;
},
async doSave() {
let sdata = { ...this.applyForm };
if (isEmpty(sdata.stuPostId)) {
this.$message.info("请选择岗位");
return;
}
if (isEmpty(sdata.workDate)) {
this.$message.info("请选择工作日期");
return;
}
if (isEmpty(sdata.workTime)) {
this.$message.info("请输入工作时长");
return;
}
if (this.postType == "固定岗位B") {
if (sdata.workTime <= 0 || sdata.workTime > 8) {
this.$message.info("请输入正确的工作时长(每天工作时长不能超过8小时)");
return;
}
}
if (sdata.workTime.toString().indexOf(".") > -1) {
if (! /(\.5)$/.test(sdata.workTime.toString())) {
this.$message.info("请输入正确的工作时长(小数点后只能以.5结尾)");
return;
}
}
if (isEmpty(sdata.mainWork)) {
this.$message.info("请输入主要工作");
return;
}
if (isEmpty(sdata.workMaterial)) {
this.$message.info("请上传工作附件");
return;
}
sdata.workDate = dayjs(sdata.workDate).format();
let loading = fullLoading(this);
let res = await doSave(sdata);
loading.close();
if (res.code == 200) {
this.$message.success(res.msg);
this.getList();
this.computeTimeByStuNo();
this.editV = false;
}
},
async doApply() {
let sdata = { ...this.applyForm };
console.log(sdata);
if (isEmpty(sdata.stuPostId)) {
this.$message.info("请选择岗位");
return;
}
if (isEmpty(sdata.workDate)) {
this.$message.info("请选择工作日期");
return;
}
if (isEmpty(sdata.workTime)) {
this.$message.info("请输入工作时长");
return;
}
if (sdata.workTime.toString().indexOf(".") > -1) {
if (! /(\.5)$/.test(sdata.workTime.toString())) {
this.$message.info("请输入正确的工作时长(小数点后只能以.5结尾)");
return;
}
}
if (isEmpty(sdata.mainWork)) {
this.$message.info("请输入主要工作");
return;
}
if (isEmpty(sdata.workMaterial)) {
this.$message.info("请上传工作附件");
return;
}
sdata.workDate = dayjs(sdata.workDate).format();
let loading = fullLoading(this);
let res = await doApply(sdata);
loading.close();
if (res.code == 200) {
this.$message.success(res.msg);
this.getList();
this.computeTimeByStuNo();
this.editV = false;
}
},
async getList() {
this.loading = true;
let res = await getList(this.queryParams);
this.loading = false;
if (res.code == 200) {
this.tableData = [...res.rows];
this.total = res.total;
}
},
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
}
}
</script>
<style scoped lang="scss">
.lookForm {
.el-form-item {
margin-bottom: 5px;
}
}
</style>

View File

@@ -0,0 +1,348 @@
<template>
<div class="app-container">
<el-form class="lookForm" :model="queryParams" ref="queryForm" size="mini" :inline="true" label-width="140px">
<el-form-item label="学号" prop="stuNo">
<el-input v-model="queryParams.stuNo" placeholder="请输入学号" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="学生姓名" prop="stuName">
<el-input v-model="queryParams.stuName" placeholder="请输入学生姓名" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="岗位名称" prop="postName">
<el-input v-model="queryParams.postName" placeholder="请输入岗位名称" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="工作日期" prop="workDate">
<el-date-picker clearable v-model="queryParams.workDate" type="date" value-format="yyyy-MM-dd"
placeholder="请选择工作日期">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-finished" size="mini"
@click="manyAudit('2')">批量同意</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-close" size="mini"
@click="manyAudit('10')">批量拒绝</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="tableData" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="学号" align="center" prop="stuNo" />
<el-table-column label="姓名" align="center" prop="stuName" />
<el-table-column label="学院" align="center" prop="stuDept" />
<el-table-column label="岗位名称" align="center" prop="postName" />
<el-table-column label="岗位类型" align="center" prop="postType" />
<el-table-column label="设岗部门" align="center" prop="deptName" />
<el-table-column label="工作日期" align="center" prop="workDate" />
<el-table-column label="工作时长" align="center">
<template v-slot="{ row }">
{{ row.postType == "固定岗位A" ? row.workTime + "" : row.workTime + "小时" }}
</template>
</el-table-column>
<el-table-column label="申请时间" align="center" prop="applyTime" width="170px" />
<el-table-column label="审核状态" align="center" prop="applyStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.qgzx_stu_post_status" :value="scope.row.applyStatus" />
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="lookVClick(scope.row)">审核</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
<el-dialog title="审核" :visible.sync="lookV" append-to-body>
<el-form class="lookForm" size="mini" ref="applyForm" label-width="148px">
<el-form-item label="工作岗位">
<el-input v-model="lookForm.postName" readonly />
</el-form-item>
<el-form-item label="主要工作">
<el-input v-model="lookForm.mainWork" type="textarea" readonly />
</el-form-item>
<el-form-item label="工作附件">
<ImagePreview width="200px" height="200px" :src="lookForm.workMaterial" />
</el-form-item>
<el-form-item label="工作日期">
<el-input v-model="lookForm.workDate" readonly />
</el-form-item>
<el-form-item label="工作时长">
<el-input v-model="lookForm.workTime" type="number" /> {{ lookForm.postType == "固定岗位A" ? "天" : "小时" }}
<span style="color: red;">*工作时长可修改</span>
</el-form-item>
</el-form>
<hr />
<el-form class="lookForm" size="mini" ref="auditForm" label-width="148px">
<el-form-item label="审核意见">
<el-radio-group v-model="auditForm.zdlsCmt">
<el-radio :label="'通过'">通过</el-radio>
<el-radio :label="'不通过'">不通过</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="指导老师签章">
<el-upload :limit="1" class="avatar-uploader" :action="upload.url" :headers="upload.headers"
:show-file-list="false" :on-success="handleAvatarSuccess">
<img v-if="auditForm.zdlsSign" :src="baseurl + auditForm.zdlsSign" width="200px" height="50px"
class="avatar">
<span v-else> 点击上传</span>
</el-upload>
</el-form-item>
<el-form-item label="">
<el-button @click="doAudit" size="mini" type="success" plain>审核</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { getOwnSign } from "@/api/workstudy/post";
import { doAudit, listZdls as getList, manyAudit } from "@/api/workstudy/worklog";
import { CheckImgExists, fullLoading, isEmpty } from "@/api/helpFunc";
import { getTokenKeySessionStorage as getToken } from "@/utils/auth";
export default {
name: "workstudy-StuPost-zdls",
dicts: ['qgzx_stu_post_status'],
data() {
return {
isEmpty,
loading: false,
tableData: [],
total: 0,
queryParams: {
pageNum: 1,
pageSize: 10,
postName: null
},
editV: false,
lookForm: {},
applyForm: {},
upload: {
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/common/upload"
},
baseurl: process.env.VUE_APP_BASE_API + "/",
lookV: false,
auditForm: {
id: null,
zdlsCmt: null,
zdlsSign: null
},
selectedId: []
}
},
created() {
this.getList();
},
methods: {
async manyAudit(val) {
if (isEmpty(this.selectedId)) {
this.$message.info("请勾选记录");
return;
}
let loading = fullLoading(this);
let res1 = await getOwnSign();
loading.close();
if (res1.code == 200) {
let data = { ...res1.data };
if (isEmpty(data.signature)) {
this.$confirm('您的签名尚未上传', '提示', {
confirmButtonText: '点我前往',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$router.push("/user/profile")
}).catch(() => {
});
} else {
let msg = "";
if (val == '2') {
msg = "同意";
} else {
msg = "拒绝";
}
let sign = data.signature;
this.$confirm('您确定要批量' + msg + '吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
let sdata = [];
this.selectedId.map(x => {
let temp = {
id: x,
applyStatus: val,
zdlsCmt: msg,
zdlsSign: sign
}
sdata.push(temp);
});
let loading = fullLoading(this);
let res = await manyAudit(sdata);
loading.close();
if (res.code == 200) {
this.$message.success(res.msg);
this.getList();
}
}).catch(() => {
});
}
}
},
handleSelectionChange(val) {
this.selectedId = val.map(x => x.id);
},
async doAudit() {
let sdata = { ...this.auditForm };
sdata.workTime = this.lookForm.workTime;
if (isEmpty(sdata.workTime)) {
this.$message.info("请输入工作时间");
return;
}
if (sdata.workTime <= 0 || sdata.workTime > 24) {
this.$message.info("请输入正确的工作时间");
return;
}
if (isEmpty(sdata.zdlsCmt)) {
this.$message.info("请选择是否通过");
return;
}
if (isEmpty(sdata.zdlsSign)) {
this.$message.info("请上传签章");
return;
}
if (!CheckImgExists(this.baseurl + sdata.zdlsSign)) {
this.$message.info("签名失效,请重新上传");
return;
}
let loading = fullLoading(this);
let res = await doAudit(sdata);
loading.close();
if (res.code == 200) {
this.$message.success(res.msg);
this.getList();
this.lookV = false;
}
},
async lookVClick(row) {
let loading1 = fullLoading(this);
let res1 = await getOwnSign();
loading1.close();
if (res1.code == 200) {
let data = { ...res1.data };
if (isEmpty(data.signature)) {
this.$confirm('您的签名尚未上传', '提示', {
confirmButtonText: '点我前往',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$router.push("/user/profile")
}).catch(() => {
});
} else {
this.lookForm = {};
this.lookForm = { ...row };
this.auditForm.id = this.lookForm.id;
this.auditForm.zdlsSign = data.signature;
this.lookV = true;
}
}
},
handleAvatarSuccess(response, file, fileList) {
this.auditForm.zdlsSign = response.fileName;
this.$forceUpdate();
},
async getList() {
this.loading = true;
let res = await getList(this.queryParams);
this.loading = false;
if (res.code == 200) {
this.tableData = [...res.rows];
this.total = res.total;
}
},
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
}
}
</script>
<style scoped lang="scss">
.lookForm {
.el-form-item {
margin-bottom: 5px;
}
}
</style>