安全考试
This commit is contained in:
@ -84,7 +84,7 @@ export interface ProjectTeamForemanResp {
|
||||
* 班组id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
foremanList: foremanQuery[];
|
||||
/**
|
||||
* 班组名称
|
||||
*/
|
||||
@ -94,7 +94,9 @@ export interface ProjectTeamForemanResp {
|
||||
* 项目id
|
||||
*/
|
||||
projectId: string | number;
|
||||
}
|
||||
|
||||
export interface foremanQuery {
|
||||
/**
|
||||
* 班组长id
|
||||
*/
|
||||
|
@ -61,3 +61,15 @@ export const delQuestionUserAnswer = (id: string | number | Array<string | numbe
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 上传线下考试试卷存储
|
||||
* @param data
|
||||
*/
|
||||
export const uploadQuestionUserAnswer = (data: any) => {
|
||||
return request({
|
||||
url: '/safety/questionUserAnswer/upload/zip',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
@ -1,33 +1,17 @@
|
||||
export interface QuestionUserAnswerVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId: string | number;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
userId: string | number;
|
||||
|
||||
/**
|
||||
* 题库id列表
|
||||
*/
|
||||
bankIdList: Array<string | number>;
|
||||
|
||||
/**
|
||||
* 答案列表
|
||||
*/
|
||||
answerList: Array<string>;
|
||||
|
||||
/**
|
||||
* 得分
|
||||
*/
|
||||
score: number;
|
||||
id: string | number;
|
||||
file: string;
|
||||
/**
|
||||
* 考试类型(1线上考试 2线下考试)
|
||||
*/
|
||||
/**
|
||||
* 考试时间(时间戳/秒)
|
||||
*/
|
||||
examTime: number;
|
||||
|
||||
/**
|
||||
* 用时时间(时间戳/秒)
|
||||
@ -38,11 +22,6 @@ export interface QuestionUserAnswerVO {
|
||||
* 及格线/总分(格式:60,100)
|
||||
*/
|
||||
pass: string;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
file: string;
|
||||
}
|
||||
|
||||
export interface QuestionUserAnswerForm extends BaseEntity {
|
||||
@ -50,7 +29,7 @@ export interface QuestionUserAnswerForm extends BaseEntity {
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
teamId?: string | number;
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@ -64,18 +43,23 @@ export interface QuestionUserAnswerForm extends BaseEntity {
|
||||
/**
|
||||
* 题库id列表
|
||||
*/
|
||||
bankIdList: Array<string | number>;
|
||||
bankId?: string | number;
|
||||
|
||||
/**
|
||||
* 答案列表
|
||||
*/
|
||||
answerList: Array<string>;
|
||||
answer?: string;
|
||||
|
||||
/**
|
||||
* 得分
|
||||
*/
|
||||
score?: number;
|
||||
|
||||
/**
|
||||
* 考试时间(时间戳/秒)
|
||||
*/
|
||||
examTime?: number;
|
||||
|
||||
/**
|
||||
* 用时时间(时间戳/秒)
|
||||
*/
|
||||
@ -93,45 +77,16 @@ export interface QuestionUserAnswerForm extends BaseEntity {
|
||||
}
|
||||
|
||||
export interface QuestionUserAnswerQuery extends PageQuery {
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
userId?: string | number;
|
||||
|
||||
teamId?: string | number;
|
||||
projectId?: string | number;
|
||||
/**
|
||||
* 题库id列表
|
||||
* 考试类型(1线上考试 2线下考试)
|
||||
*/
|
||||
bankIdList: Array<string | number>;
|
||||
|
||||
/**
|
||||
* 答案列表
|
||||
*/
|
||||
answerList: Array<string>;
|
||||
|
||||
/**
|
||||
* 得分
|
||||
*/
|
||||
score?: number;
|
||||
|
||||
/**
|
||||
* 用时时间(时间戳/秒)
|
||||
*/
|
||||
takeTime?: number;
|
||||
|
||||
/**
|
||||
* 及格线/总分(格式:60,100)
|
||||
*/
|
||||
pass?: string;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
file?: string;
|
||||
examType?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
|
63
src/api/safety/questionsCategory/index.ts
Normal file
63
src/api/safety/questionsCategory/index.ts
Normal file
@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { QuestionsCategoryVO, QuestionsCategoryForm, QuestionsCategoryQuery } from '@/api/safety/questionsCategory/types';
|
||||
|
||||
/**
|
||||
* 查询题库类别列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listQuestionsCategory = (query?: QuestionsCategoryQuery): AxiosPromise<QuestionsCategoryVO[]> => {
|
||||
return request({
|
||||
url: '/safety/questionsCategory/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询题库类别详细
|
||||
* @param id
|
||||
*/
|
||||
export const getQuestionsCategory = (id: string | number): AxiosPromise<QuestionsCategoryVO> => {
|
||||
return request({
|
||||
url: '/safety/questionsCategory/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增题库类别
|
||||
* @param data
|
||||
*/
|
||||
export const addQuestionsCategory = (data: QuestionsCategoryForm) => {
|
||||
return request({
|
||||
url: '/safety/questionsCategory',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改题库类别
|
||||
* @param data
|
||||
*/
|
||||
export const updateQuestionsCategory = (data: QuestionsCategoryForm) => {
|
||||
return request({
|
||||
url: '/safety/questionsCategory',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除题库类别
|
||||
* @param id
|
||||
*/
|
||||
export const delQuestionsCategory = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/safety/questionsCategory/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
41
src/api/safety/questionsCategory/types.ts
Normal file
41
src/api/safety/questionsCategory/types.ts
Normal file
@ -0,0 +1,41 @@
|
||||
export interface QuestionsCategoryVO {
|
||||
/**
|
||||
* 题库类别
|
||||
*/
|
||||
categoryName: string;
|
||||
id: string | number;
|
||||
}
|
||||
|
||||
export interface QuestionsCategoryForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 题库类别
|
||||
*/
|
||||
categoryName?: string;
|
||||
}
|
||||
|
||||
export interface QuestionsCategoryQuery extends PageQuery {
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 题库类别
|
||||
*/
|
||||
categoryName?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
import request from '@/utils/request';
|
||||
import request, { download } from '@/utils/request';
|
||||
import { OssQuery, OssVO } from './types';
|
||||
import { AxiosPromise } from 'axios';
|
||||
|
||||
@ -26,3 +26,8 @@ export function delOss(ossId: string | number | Array<string | number>) {
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
// 下载OSS对象存储
|
||||
export function downLoadOss(ossId: string | number | Array<string | number>) {
|
||||
return download('/safety/questionUserAnswer/exportFile', { userIdList: ossId }, '安全考试.zip');
|
||||
}
|
||||
|
@ -16,10 +16,41 @@
|
||||
:list-type="isConstruction ? 'picture-card' : 'text'"
|
||||
:accept="accept"
|
||||
:drag="isDarg"
|
||||
:data="data"
|
||||
>
|
||||
<!-- 上传按钮 -->
|
||||
<el-button v-if="!isConstruction && !isImportInfo" type="primary">选取文件</el-button>
|
||||
<el-button v-if="isImportInfo" type="warning" plain icon="Edit">导入员工资料 </el-button>
|
||||
<slot>
|
||||
<!-- 上传按钮 -->
|
||||
<el-button v-if="!isConstruction && !isImportInfo" type="primary">选取文件</el-button>
|
||||
<el-button v-if="isImportInfo" type="warning" plain icon="Edit">导入员工资料 </el-button>
|
||||
<!-- 上传提示 -->
|
||||
<div v-if="showTip" class="el-upload__tip">
|
||||
请上传
|
||||
<template v-if="fileSize">
|
||||
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
|
||||
</template>
|
||||
<template v-if="fileType">
|
||||
格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b>
|
||||
</template>
|
||||
的文件
|
||||
</div>
|
||||
<!-- 文件列表 -->
|
||||
<transition-group
|
||||
v-if="!isConstruction && !isImportInfo"
|
||||
class="upload-file-list el-upload-list el-upload-list--text"
|
||||
name="el-fade-in-linear"
|
||||
tag="ul"
|
||||
>
|
||||
<li v-for="(file, index) in fileList" :key="file.uid" class="el-upload-list__item ele-upload-list__item-content">
|
||||
<el-link :href="`${file.url}`" :underline="false" target="_blank">
|
||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
||||
</el-link>
|
||||
<div class="ele-upload-list__item-content-action">
|
||||
<el-button type="danger" link @click="handleDelete(index)">删除</el-button>
|
||||
</div>
|
||||
</li>
|
||||
</transition-group>
|
||||
</slot>
|
||||
|
||||
<el-icon v-if="isConstruction"><Plus /></el-icon>
|
||||
<template #file="{ file }">
|
||||
<div class="pdf" v-if="isConstruction">
|
||||
@ -38,33 +69,6 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<!-- 上传提示 -->
|
||||
<div v-if="showTip" class="el-upload__tip">
|
||||
请上传
|
||||
<template v-if="fileSize">
|
||||
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
|
||||
</template>
|
||||
<template v-if="fileType">
|
||||
格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b>
|
||||
</template>
|
||||
的文件
|
||||
</div>
|
||||
<!-- 文件列表 -->
|
||||
<transition-group
|
||||
v-if="!isConstruction && !isImportInfo"
|
||||
class="upload-file-list el-upload-list el-upload-list--text"
|
||||
name="el-fade-in-linear"
|
||||
tag="ul"
|
||||
>
|
||||
<li v-for="(file, index) in fileList" :key="file.uid" class="el-upload-list__item ele-upload-list__item-content">
|
||||
<el-link :href="`${file.url}`" :underline="false" target="_blank">
|
||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
||||
</el-link>
|
||||
<div class="ele-upload-list__item-content-action">
|
||||
<el-button type="danger" link @click="handleDelete(index)">删除</el-button>
|
||||
</div>
|
||||
</li>
|
||||
</transition-group>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -93,7 +97,9 @@ const props = defineProps({
|
||||
//ip地址
|
||||
uploadUrl: propTypes.string.def('/resource/oss/upload'),
|
||||
//可拖拽上传
|
||||
isDarg: propTypes.bool.def(false)
|
||||
isDarg: propTypes.bool.def(false),
|
||||
// 其他参数
|
||||
data: propTypes.object.def({})
|
||||
});
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
@ -233,7 +239,6 @@ const uploadedSuccessfully = () => {
|
||||
}
|
||||
if (number.value > 0 && uploadList.value.length === number.value) {
|
||||
fileList.value = fileList.value.filter((f) => f.url !== undefined).concat(uploadList.value);
|
||||
console.log('🚀 ~ uploadedSuccessfully ~ fileList.value:', fileList.value);
|
||||
uploadList.value = [];
|
||||
number.value = 0;
|
||||
|
||||
|
@ -234,6 +234,7 @@ const submitForm = () => {
|
||||
machineryFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
if (form.value.id) {
|
||||
await updateMachinery(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
|
@ -12,7 +12,7 @@
|
||||
<el-option v-for="item in contractorOpt" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班组" prop="contractorId">
|
||||
<el-form-item label="班组" prop="teamId">
|
||||
<el-select v-model="queryParams.teamId" clearable placeholder="全部">
|
||||
<el-option v-for="item in ProjectTeam" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
|
@ -4,26 +4,13 @@
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="项目id" prop="projectId">
|
||||
<el-input v-model="queryParams.projectId" placeholder="请输入项目id" clearable @keyup.enter="handleQuery" />
|
||||
<el-form-item label="用户姓名" prop="userId">
|
||||
<el-input v-model="queryParams.userId" placeholder="请输入用户姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户id" prop="userId">
|
||||
<el-input v-model="queryParams.userId" placeholder="请输入用户id" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="题库id列表" prop="bankId">
|
||||
<el-input v-model="queryParams.bankId" placeholder="请输入题库id列表" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="答案列表" prop="answer">
|
||||
<el-input v-model="queryParams.answer" placeholder="请输入答案列表" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="得分" prop="score">
|
||||
<el-input v-model="queryParams.score" placeholder="请输入得分" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用时时间" prop="takeTime">
|
||||
<el-input v-model="queryParams.takeTime" placeholder="请输入用时时间" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="及格线/总分" prop="pass">
|
||||
<el-input v-model="queryParams.pass" placeholder="请输入及格线/总分" clearable @keyup.enter="handleQuery" />
|
||||
<el-form-item label="班组" prop="teamId">
|
||||
<el-select v-model="queryParams.teamId" clearable placeholder="全部">
|
||||
<el-option v-for="item in ProjectTeam" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
@ -38,26 +25,25 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['safety:questionUserAnswer:add']">新增 </el-button>
|
||||
<el-tooltip placement="top" effect="dark">
|
||||
<template #content>
|
||||
注:上传压缩包内的文件夹名称需设置为【姓名-身份证-满分-得分-及格分】, <br />
|
||||
例如:小明-5130112333654X-100-59-60
|
||||
</template>
|
||||
<file-upload
|
||||
:limit="1"
|
||||
v-model:model-value="filePath"
|
||||
isImportInfo
|
||||
:fileType="['zip']"
|
||||
uploadUrl="/safety/questionUserAnswer/upload/zip"
|
||||
:file-size="5000"
|
||||
:data="{ projectId: currentProject.id }"
|
||||
><el-button type="success" plain icon="Upload">上传线下安全考试</el-button></file-upload
|
||||
>
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['safety:questionUserAnswer:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['safety:questionUserAnswer:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['safety:questionUserAnswer:export']">导出 </el-button>
|
||||
<el-button type="primary" plain icon="Download" :disabled="single" @click="handleDownload()">批量下载</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@ -65,89 +51,61 @@
|
||||
|
||||
<el-table v-loading="loading" :data="questionUserAnswerList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键id" align="center" prop="id" v-if="true" />
|
||||
<el-table-column label="项目id" align="center" prop="projectId" />
|
||||
<el-table-column label="用户id" align="center" prop="userId" />
|
||||
<el-table-column label="题库id列表" align="center" prop="bankId" />
|
||||
<el-table-column label="答案列表" align="center" prop="answer" />
|
||||
<el-table-column label="得分" align="center" prop="score" />
|
||||
<el-table-column label="用时时间" align="center" prop="takeTime" />
|
||||
<el-table-column label="主键id" align="center" prop="id" v-if="false" />
|
||||
<el-table-column label="姓名" align="center" prop="userName" />
|
||||
<el-table-column label="及格线/总分" align="center" prop="pass" />
|
||||
<el-table-column label="文件地址" align="center" prop="file" />
|
||||
<el-table-column label="得分" align="center" prop="score" />
|
||||
<el-table-column label="计划时间" align="center" prop="examTime" />
|
||||
<el-table-column label="用时时间" align="center" prop="takeTime" />
|
||||
<el-table-column label="考试时间" align="center" prop="createTime" />
|
||||
<el-table-column label="类型" align="center" prop="examType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="user_exam_type" :value="scope.row.examType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:questionUserAnswer:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['safety:questionUserAnswer:remove']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-link type="primary" :underline="false" :href="scope.row.fileUrl[0]" target="_blank">
|
||||
<el-button link type="primary" icon="View">预览试卷</el-button>
|
||||
</el-link>
|
||||
|
||||
<el-button link type="primary" icon="Download" @click="handleDownload(scope.row)">下载试卷</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改用户试卷存储对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="questionUserAnswerFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="项目id" prop="projectId">
|
||||
<el-input v-model="form.projectId" placeholder="请输入项目id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户id" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入用户id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="题库id列表" prop="bankId">
|
||||
<el-input v-model="form.bankId" placeholder="请输入题库id列表" />
|
||||
</el-form-item>
|
||||
<el-form-item label="答案列表" prop="answer">
|
||||
<el-input v-model="form.answer" placeholder="请输入答案列表" />
|
||||
</el-form-item>
|
||||
<el-form-item label="得分" prop="score">
|
||||
<el-input v-model="form.score" placeholder="请输入得分" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用时时间" prop="takeTime">
|
||||
<el-input v-model="form.takeTime" placeholder="请输入用时时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="及格线/总分" prop="pass">
|
||||
<el-input v-model="form.pass" placeholder="请输入及格线/总分" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件地址" prop="file">
|
||||
<file-upload v-model="form.file" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="QuestionUserAnswer" lang="ts">
|
||||
import {
|
||||
addQuestionUserAnswer,
|
||||
delQuestionUserAnswer,
|
||||
getQuestionUserAnswer,
|
||||
listQuestionUserAnswer,
|
||||
updateQuestionUserAnswer
|
||||
getQuestionUserAnswer,
|
||||
delQuestionUserAnswer,
|
||||
addQuestionUserAnswer,
|
||||
updateQuestionUserAnswer,
|
||||
uploadQuestionUserAnswer
|
||||
} from '@/api/safety/questionUserAnswer';
|
||||
import { QuestionUserAnswerForm, QuestionUserAnswerQuery, QuestionUserAnswerVO } from '@/api/safety/questionUserAnswer/types';
|
||||
import { QuestionUserAnswerVO, QuestionUserAnswerQuery, QuestionUserAnswerForm } from '@/api/safety/questionUserAnswer/types';
|
||||
import { downLoadOss } from '@/api/system/oss';
|
||||
import download from '@/plugins/download';
|
||||
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { blobValidate } from '@/utils/ruoyi';
|
||||
import FileSaver from 'file-saver';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { user_exam_type } = toRefs<any>(proxy?.useDict('user_exam_type'));
|
||||
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const ProjectTeam = computed(() => userStore.ProjectTeamList);
|
||||
|
||||
const questionUserAnswerList = ref<QuestionUserAnswerVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
@ -156,7 +114,7 @@ const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const filePath = ref<string>('');
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const questionUserAnswerFormRef = ref<ElFormInstance>();
|
||||
|
||||
@ -169,30 +127,30 @@ const initFormData: QuestionUserAnswerForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
userId: undefined,
|
||||
bankIdList: undefined,
|
||||
bankId: undefined,
|
||||
answer: undefined,
|
||||
score: undefined,
|
||||
examTime: undefined,
|
||||
takeTime: undefined,
|
||||
pass: undefined,
|
||||
file: undefined
|
||||
file: undefined,
|
||||
teamId: undefined
|
||||
};
|
||||
const data = reactive<PageData<QuestionUserAnswerForm, QuestionUserAnswerQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
userId: undefined,
|
||||
bankIdList: undefined,
|
||||
answer: undefined,
|
||||
score: undefined,
|
||||
takeTime: undefined,
|
||||
pass: undefined,
|
||||
file: undefined,
|
||||
examType: undefined,
|
||||
teamId: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }]
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }],
|
||||
projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }],
|
||||
userId: [{ required: true, message: '用户id不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
@ -234,63 +192,48 @@ const resetQuery = () => {
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: QuestionUserAnswerVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
single.value = selection.length == 0;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加用户试卷存储';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: QuestionUserAnswerVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getQuestionUserAnswer(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改用户试卷存储';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
questionUserAnswerFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateQuestionUserAnswer(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addQuestionUserAnswer(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
// const handleUpdate = async (row?: QuestionUserAnswerVO) => {
|
||||
// reset();
|
||||
// const _id = row?.id || ids.value[0];
|
||||
// const res = await getQuestionUserAnswer(_id);
|
||||
// Object.assign(form.value, res.data);
|
||||
// dialog.visible = true;
|
||||
// dialog.title = '修改用户试卷存储';
|
||||
// };
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: QuestionUserAnswerVO) => {
|
||||
const handleDownload = async (row?: QuestionUserAnswerVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除用户试卷存储编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delQuestionUserAnswer(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
const res = await downLoadOss(_ids);
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'safety/questionUserAnswer/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`questionUserAnswer_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
// const fileWatch = watch(
|
||||
// () => filePath.value,
|
||||
// (nid, oid) => {
|
||||
// uploadQuestionUserAnswer({ file: filePath.value, projectId: currentProject.value.id }).then((res) => {
|
||||
// console.log(res);
|
||||
// });
|
||||
// }
|
||||
// );
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
|
236
src/views/safety/questionsCategory/index.vue
Normal file
236
src/views/safety/questionsCategory/index.vue
Normal file
@ -0,0 +1,236 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="题库类别" prop="categoryName">
|
||||
<el-input v-model="queryParams.categoryName" placeholder="请输入题库类别" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['safety:questionsCategory:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['safety:questionsCategory:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['safety:questionsCategory:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="questionsCategoryList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" type="index" width="100" />
|
||||
<el-table-column label="题库类别" align="center" prop="categoryName" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:questionsCategory:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['safety:questionsCategory:remove']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改题库类别对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="questionsCategoryFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="题库类别" prop="categoryName">
|
||||
<el-input v-model="form.categoryName" placeholder="请输入题库类别" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="QuestionsCategory" lang="ts">
|
||||
import {
|
||||
listQuestionsCategory,
|
||||
getQuestionsCategory,
|
||||
delQuestionsCategory,
|
||||
addQuestionsCategory,
|
||||
updateQuestionsCategory
|
||||
} from '@/api/safety/questionsCategory';
|
||||
import { QuestionsCategoryVO, QuestionsCategoryQuery, QuestionsCategoryForm } from '@/api/safety/questionsCategory/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const questionsCategoryList = ref<QuestionsCategoryVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const questionsCategoryFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: QuestionsCategoryForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
categoryName: undefined
|
||||
};
|
||||
const data = reactive<PageData<QuestionsCategoryForm, QuestionsCategoryQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
categoryName: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }],
|
||||
projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }],
|
||||
categoryName: [{ required: true, message: '题库类别不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询题库类别列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listQuestionsCategory(queryParams.value);
|
||||
questionsCategoryList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
questionsCategoryFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: QuestionsCategoryVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加题库类别';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: QuestionsCategoryVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getQuestionsCategory(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改题库类别';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
questionsCategoryFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
if (form.value.id) {
|
||||
await updateQuestionsCategory(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addQuestionsCategory(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: QuestionsCategoryVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除题库类别编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delQuestionsCategory(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
@ -5,52 +5,56 @@
|
||||
<el-col :span="12" style="text-align: left">填报人:{{ safetyInspectionDetail?.creatorName }}</el-col>
|
||||
<el-col :span="12" style="text-align: right">填报时间:{{ safetyInspectionDetail?.createTime }}</el-col>
|
||||
</el-row>
|
||||
<el-descriptions :column="2" border style="margin-top: 8px" label-width="160px">
|
||||
<el-descriptions-item label-align="center" label="检查项目" :span="2">{{ currentProject?.name }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查类型">
|
||||
<el-descriptions :column="2" border style="margin-top: 8px" label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="检查项目" :span="2" class-name="zebra">{{ currentProject?.name }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查类型" label-class-name="white">
|
||||
<dict-tag :options="safety_inspection_check_type" :value="safetyInspectionDetail?.checkType" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="违章类型">
|
||||
<el-descriptions-item label-align="center" label="违章类型" label-class-name="white">
|
||||
<dict-tag :options="safety_inspection_violation_type" :value="safetyInspectionDetail?.violationType" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查时间">{{ safetyInspectionDetail?.checkTime }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查人">{{ safetyInspectionDetail?.correctorName }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改人">{{ safetyInspectionDetail?.correctorName }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="要求整改期限">
|
||||
<el-descriptions-item label-align="center" label="检查时间" class-name="zebra">{{ safetyInspectionDetail?.checkTime }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查人" class-name="zebra">{{ safetyInspectionDetail?.creatorName }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改人" label-class-name="white">{{ safetyInspectionDetail?.correctorName }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="要求整改期限" label-class-name="white">
|
||||
{{ dayjs(safetyInspectionDetail?.rectificationDeadline).format('YYYY 年 MM 月 DD 日') }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div class="table-title">巡检结果</div>
|
||||
<el-descriptions :column="2" border label-width="160px">
|
||||
<el-descriptions-item label-align="center" label="内容" :span="2">{{ safetyInspectionDetail?.hiddenDanger }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查附件" :span="2">
|
||||
<el-descriptions border direction="vertical" size="large">
|
||||
<el-descriptions-item label-align="center" label="巡检结果" class-name="none"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="内容" :span="2" label-class-name="white">{{ safetyInspectionDetail?.hiddenDanger }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查附件" :span="2" label-class-name="white">
|
||||
<el-space wrap>
|
||||
<div v-for="item in checkFileList" :key="item.ossId">
|
||||
<span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileSuffix)">
|
||||
<image-preview :src="item.url" width="200px" />
|
||||
</span>
|
||||
<span v-else>
|
||||
<el-link :href="`${item.url}`" :underline="false" target="_blank">
|
||||
<el-link :href="`${item.url}`" type="primary" :underline="false" target="_blank">
|
||||
<span> {{ item.originalName }} </span>
|
||||
</el-link>
|
||||
</span>
|
||||
</div>
|
||||
</el-space>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查状态" :span="2">
|
||||
<el-descriptions-item label-align="center" label="检查状态" :span="2" label-class-name="white">
|
||||
<el-steps style="max-width: 200px" :active="Number(safetyInspectionDetail?.status)" finish-status="success">
|
||||
<el-step v-for="item in safety_inspection_type" :key="item.value" :title="item.label" />
|
||||
</el-steps>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div class="table-title">整改情况</div>
|
||||
<el-descriptions :column="2" border label-width="160px">
|
||||
<el-descriptions-item label-align="center" label="班组">{{ safetyInspectionDetail?.teamName }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改日期">{{ safetyInspectionDetail?.rectificationTime }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改措施及完成情况" :span="2">
|
||||
<el-descriptions border direction="vertical" size="large">
|
||||
<el-descriptions-item label-align="center" label="整改情况" class-name="none"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="班组" label-class-name="white">{{ safetyInspectionDetail?.teamName }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改日期" label-class-name="white">{{ safetyInspectionDetail?.rectificationTime }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改措施及完成情况" :span="2" label-class-name="white">
|
||||
{{ safetyInspectionDetail?.measure }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改附件" :span="2">
|
||||
<el-descriptions-item label-align="center" label="整改附件" :span="2" label-class-name="white">
|
||||
<el-space wrap>
|
||||
<div v-for="item in rectificationFileList" :key="item.ossId">
|
||||
<span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileSuffix)">
|
||||
@ -64,12 +68,14 @@
|
||||
</div>
|
||||
</el-space>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions size="large">
|
||||
<el-descriptions border direction="vertical" size="large">
|
||||
<el-descriptions-item label-align="center" label="复查结果" class-name="none"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div class="table-title">复查结果</div>
|
||||
<el-descriptions :column="2" border label-width="160px">
|
||||
<el-descriptions-item label-align="center" label="复查人">{{ safetyInspectionDetail?.creatorName }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="复查日期">{{ safetyInspectionDetail?.reviewTime }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="复查情况" :span="2">{{ safetyInspectionDetail?.review }} </el-descriptions-item>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="复查人" label-class-name="white">{{ safetyInspectionDetail?.creatorName }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="复查日期" label-class-name="white">{{ safetyInspectionDetail?.reviewTime }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="复查情况" :span="2" label-class-name="white">{{ safetyInspectionDetail?.review }} </el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</template>
|
||||
@ -134,14 +140,14 @@ watch(
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.table-title {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-end;
|
||||
height: 35px;
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
padding-bottom: 4px;
|
||||
<style scoped lang="scss">
|
||||
:deep(.white) {
|
||||
background: #fff!important;
|
||||
}
|
||||
:deep(.none) {
|
||||
display: none !important;
|
||||
}
|
||||
:deep(.zebra) {
|
||||
background: #f5f7fa;
|
||||
}
|
||||
</style>
|
||||
|
@ -86,7 +86,7 @@
|
||||
</el-button>
|
||||
<!-- <el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:safetyInspection:edit']">修改 </el-button> -->
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['safety:safetyInspection:remove']">
|
||||
修改
|
||||
删除
|
||||
</el-button>
|
||||
</el-space>
|
||||
</template>
|
||||
@ -117,7 +117,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="整改人" prop="correctorId">
|
||||
<el-select v-model="form.correctorId" placeholder="请选择整改人" disabled>
|
||||
<el-select v-model="form.correctorId" placeholder="请选择整改人" :disabled="!form.teamId">
|
||||
<el-option v-for="item in foremanOpt" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -165,11 +165,11 @@ import { SafetyInspectionForm, SafetyInspectionQuery, SafetyInspectionVO } from
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import SafetyInspectionDetailDialog from '@/views/safety/safetyInspection/component/SafetyInspectionDetailDialog.vue';
|
||||
import { listProjectTeamForeman } from '@/api/project/projectTeam';
|
||||
import { ProjectTeamForemanResp } from '@/api/project/projectTeam/types';
|
||||
import { foremanQuery, ProjectTeamForemanResp } from '@/api/project/projectTeam/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { safety_inspection_violation_type, review_type, reply_type, safety_inspection_type, safety_inspection_check_type } = toRefs<any>(
|
||||
proxy?.useDict('safety_inspection_violation_type', 'review_type', 'reply_type', 'safety_inspection_type', 'safety_inspection_check_type')
|
||||
const { safety_inspection_violation_type, review_type, safety_inspection_type, safety_inspection_check_type } = toRefs<any>(
|
||||
proxy?.useDict('safety_inspection_violation_type', 'review_type', 'safety_inspection_type', 'safety_inspection_check_type')
|
||||
);
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
@ -252,8 +252,8 @@ const data = reactive<PageData<SafetyInspectionForm, SafetyInspectionQuery>>({
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
const teamOpt = ref();
|
||||
const foremanOpt = ref();
|
||||
const teamOpt = ref([]);
|
||||
const foremanOpt = ref([]);
|
||||
const teamList = ref<ProjectTeamForemanResp[]>();
|
||||
/** 查询安全巡检工单列表 */
|
||||
const getList = async () => {
|
||||
@ -268,16 +268,17 @@ const getList = async () => {
|
||||
label: team.teamName,
|
||||
value: team.id
|
||||
}));
|
||||
foremanOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({
|
||||
label: team.foremanName,
|
||||
value: team.foremanId
|
||||
}));
|
||||
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
const changeForeman = (value: string | number) => {
|
||||
const team = teamList.value.find((team) => team.id === value);
|
||||
form.value.correctorId = team.foremanId;
|
||||
const team = teamList.value.filter((team) => team.id === value)[0];
|
||||
foremanOpt.value = team.foremanList?.map((foreman: foremanQuery) => ({
|
||||
label: foreman.foremanName,
|
||||
value: foreman.foremanId
|
||||
}));
|
||||
form.value.correctorId = '';
|
||||
};
|
||||
|
||||
/** 展开安全巡检工单详情对话框操作 */
|
||||
@ -342,6 +343,7 @@ const submitForm = () => {
|
||||
safetyInspectionFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
if (form.value.id) {
|
||||
await updateSafetyInspection(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -374,6 +376,20 @@ const handleExport = () => {
|
||||
);
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
@ -42,7 +42,7 @@
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="附件" :span="3">
|
||||
<el-space direction="vertical">
|
||||
<el-link v-for="item in fileList" :key="item.ossId" :href="`${item.url}`" :underline="false" target="_blank">
|
||||
<el-link v-for="item in fileList" :key="item.ossId" :href="`${item.url}`" type="primary" :underline="false" target="_blank">
|
||||
<span> {{ item.originalName }} </span>
|
||||
</el-link>
|
||||
</el-space>
|
||||
|
@ -70,7 +70,7 @@
|
||||
</el-card>
|
||||
<!-- 添加或修改安全日志对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="950px" append-to-body>
|
||||
<el-form ref="safetyLogFormRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form ref="safetyLogFormRef" :model="form" :rules="rules" label-width="250px">
|
||||
<el-form-item label="发生日期" prop="dateOfOccurrence">
|
||||
<el-date-picker clearable v-model="form.dateOfOccurrence" type="date" value-format="YYYY-MM-DD" placeholder="请选择发生日期">
|
||||
</el-date-picker>
|
||||
@ -283,6 +283,7 @@ const submitForm = () => {
|
||||
safetyLogFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
if (form.value.id) {
|
||||
await updateSafetyLog(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -315,6 +316,20 @@ const handleExport = () => {
|
||||
);
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
@ -231,6 +231,7 @@ const submitForm = () => {
|
||||
safetyWeeklyReportFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
if (form.value.id) {
|
||||
await updateSafetyWeeklyReport(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -263,6 +264,20 @@ const handleExport = () => {
|
||||
);
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
@ -268,6 +268,20 @@ const handleExport = () => {
|
||||
);
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
Reference in New Issue
Block a user