This commit is contained in:
ljx
2025-09-16 20:17:41 +08:00
14 changed files with 463 additions and 623 deletions

View File

@ -5,7 +5,7 @@ VITE_APP_TITLE = 煤科建管平台
VITE_APP_ENV = 'development' VITE_APP_ENV = 'development'
# 开发环境 # 开发环境
# VITE_APP_BASE_API = 'http://192.168.110.180:8899' VITE_APP_BASE_API = 'http://192.168.110.180:8899'
# 李陈杰 209 # 李陈杰 209
# VITE_APP_BASE_API = 'http://192.168.110.209:8899' # VITE_APP_BASE_API = 'http://192.168.110.209:8899'
# 李陈杰 209 # 李陈杰 209

View File

@ -155,7 +155,7 @@ export const coryEngineeringList = (query: any): AxiosPromise<any[]> => {
*/ */
export const obtainTheVersion = (query: any) => { export const obtainTheVersion = (query: any) => {
return request({ return request({
url: '/cailiaoshebei/mrpBase/obtainTheVersion', url: '/design/billofquantitiesVersions/obtainAllClassification',
method: 'get', method: 'get',
params: query params: query
}); });

View File

@ -66,6 +66,7 @@ export interface ConstructionSchedulePlanForm extends BaseEntity {
*/ */
id?: string | number; id?: string | number;
parentId?: string | number; parentId?: string | number;
projectStructureName?: string;
/** /**
* 项目ID * 项目ID
*/ */

View File

@ -0,0 +1,15 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
/**
* 分页查询项目薪资详情列表
* @param query
* @returns {*}
*/
export const listBusSalaryDetails = (query?: any): AxiosPromise<any[]> => {
return request({
url: '/contractor/userSalaryDetail/salaryPageList',
method: 'get',
params: query
});
};

View File

@ -212,5 +212,50 @@ export function download(url: string, params: any, fileName: string, isHeader?:
downloadLoadingInstance.close(); downloadLoadingInstance.close();
}); });
} }
/**
* GET 下载方法
* @param url 请求地址
* @param params 请求参数
* @param fileName 保存文件名
* @param isHeader 是否使用 json header
*/
export function downloadGet(url: string, params: any, fileName: string, isHeader?: boolean) {
downloadLoadingInstance = ElLoading.service({
text: '正在下载数据,请稍候',
background: 'rgba(0, 0, 0, 0.7)'
});
// 拼接参数
let query = tansParams(params);
if (query) {
url += '?' + query;
}
const config = {
headers: isHeader ? { 'Content-Type': 'application/json' } : { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob' as const
};
return service
.get(url, config)
.then(async (resp: any) => {
const isLogin = blobValidate(resp);
if (isLogin) {
const blob = new Blob([resp]);
FileSaver.saveAs(blob, fileName);
} else {
const resText = await resp.data.text();
const rspObj = JSON.parse(resText);
const errMsg = (rspObj && (rspObj.msg || rspObj.message)) || '下载失败';
ElMessage.error(errMsg);
}
downloadLoadingInstance.close();
})
.catch((err: any) => {
console.error(err);
ElMessage.error('下载文件出现错误,请联系管理员!');
downloadLoadingInstance.close();
});
}
// 导出 axios 实例 // 导出 axios 实例
export default service; export default service;

View File

@ -911,7 +911,7 @@
<el-table-column prop="batchNumber" align="center" label="版本号 " width="200"> <el-table-column prop="batchNumber" align="center" label="版本号 " width="200">
<template #default="scope"> <template #default="scope">
<el-select v-model="scope.row.batchNumber" placeholder="请选择" @change="(val) => selectNameVersion(val, scope.row, scope.$index)"> <el-select v-model="scope.row.batchNumber" placeholder="请选择" @change="(val) => selectNameVersion(val, scope.row, scope.$index)">
<el-option v-for="item in versionList" :key="item.versions" :label="item.versions" :value="item.versions" /> <el-option v-for="item in versionList" :key="item.versions" :label="item.name" :value="item.sid" />
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
@ -1496,10 +1496,10 @@ const handleAudit = async () => {
}; };
/** 获取物资列表(按版本号筛选) */ /** 获取物资列表(按版本号筛选) */
const getNameList = (versions: string) => { const getNameList = (sid: string) => {
coryEngineeringList({ coryEngineeringList({
projectId: currentProject.value?.id, projectId: currentProject.value?.id,
versions sid
}) })
.then((res: any) => { .then((res: any) => {
nameList.value = res.data || []; nameList.value = res.data || [];
@ -1554,7 +1554,7 @@ const listeningProject = watch(
if (newId !== oldId && newId) { if (newId !== oldId && newId) {
queryParams.value.mainData.projectId = newId; queryParams.value.mainData.projectId = newId;
queryParams.value.batchData.projectId = newId; queryParams.value.batchData.projectId = newId;
form.value.mrpBaseBo.projectId = newId; form.value.mrpBaseBo.projectId = newId as number;
getList(); getList();
getVersion(); // 重新获取对应项目的版本号 getVersion(); // 重新获取对应项目的版本号
} }

View File

@ -27,6 +27,21 @@
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd()" v-hasPermi="['progress:constructionSchedulePlan:add']">新增</el-button> <el-button type="primary" plain icon="Plus" @click="handleAdd()" v-hasPermi="['progress:constructionSchedulePlan:add']">新增</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<file-upload
upload-url="/progress/constructionSchedulePlan/readTemplate"
v-model="file"
:limit="1"
:data="{ projectId: queryParams.projectId }"
:file-type="['xls', 'xlsx']"
:on-upload-success="handleSuccess"
>
<el-button type="primary" plain icon="upload">导入</el-button>
</file-upload>
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain icon="Filter" @click="handleExport">导出</el-button>
</el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button> <el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
</el-col> </el-col>
@ -126,22 +141,10 @@
<el-date-picker clearable v-model="form.planEndDate" type="date" value-format="YYYY-MM-DD" placeholder="选择预计结束时间" /> <el-date-picker clearable v-model="form.planEndDate" type="date" value-format="YYYY-MM-DD" placeholder="选择预计结束时间" />
</el-form-item> </el-form-item>
<el-form-item label="实际开始时间" prop="practicalStartDate"> <el-form-item label="实际开始时间" prop="practicalStartDate">
<el-date-picker <el-date-picker clearable v-model="form.practicalStartDate" type="date" value-format="YYYY-MM-DD" placeholder="选择实际开始时间" />
clearable
v-model="form.practicalStartDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="选择实际开始时间"
/>
</el-form-item> </el-form-item>
<el-form-item label="实际结束时间" prop="practicalEndDate"> <el-form-item label="实际结束时间" prop="practicalEndDate">
<el-date-picker <el-date-picker clearable v-model="form.practicalEndDate" type="date" value-format="YYYY-MM-DD" placeholder="选择实际结束时间" />
clearable
v-model="form.practicalEndDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="选择实际结束时间"
/>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select v-model="form.status" placeholder="请选择状态"> <el-select v-model="form.status" placeholder="请选择状态">
@ -221,6 +224,7 @@ const initFormData = {
remark: undefined, remark: undefined,
projectStructureName: undefined projectStructureName: undefined
}; };
const file = ref();
const data = reactive<PageData<ConstructionSchedulePlanForm, ConstructionSchedulePlanQuery>>({ const data = reactive<PageData<ConstructionSchedulePlanForm, ConstructionSchedulePlanQuery>>({
form: { ...initFormData }, form: { ...initFormData },
@ -279,6 +283,17 @@ const cancel = () => {
dialog.visible = false; dialog.visible = false;
}; };
const handleExport = async () => {
const ids = queryParams.value.projectId;
proxy?.download('/progress/constructionSchedulePlan/exportTemplate/' + ids, {}, `施工里程碑计划模版.xlsx`, true);
};
const handleSuccess = () => {
console.log(111);
proxy.$modal.msgSuccess('操作成功');
getList();
};
// 表单重置 // 表单重置
const reset = () => { const reset = () => {
form.value = { ...initFormData }; form.value = { ...initFormData };

View File

@ -1,57 +1,54 @@
export interface BusSalaryDetailsTableColumns { export interface BusSalaryDetailsTableColumns {
id:number id: number;
sfzNumber:string; // 身份证 sfzNumber: string; // 身份证
name:string; // 户名 name: string; // 户名
account:string; // 账户 account: string; // 账户
sumDuration:number; // 当月总时长 sumDuration: number; // 当月总时长
salary:number; // 薪水(天) salary: number; // 薪水(天)
dateOfIssue:string; // 发放年月 dateOfIssue: string; // 发放年月
lister:string; // 制表人 lister: string; // 制表人
createdAt:string; // 创建时间 createdAt: string; // 创建时间
} }
export interface BusSalaryDetailsInfoData { export interface BusSalaryDetailsInfoData {
id:number|undefined; // 主键ID id: number | undefined; // 主键ID
sfzNumber:string|undefined; // 身份证 sfzNumber: string | undefined; // 身份证
name:string|undefined; // 户名 name: string | undefined; // 户名
account:string|undefined; // 账户 account: string | undefined; // 账户
sumDuration:number|undefined; // 当月总时长 sumDuration: number | undefined; // 当月总时长
salary:number|undefined; // 薪水(天) salary: number | undefined; // 薪水(天)
projectId:number|undefined; // 项目id projectId: number | undefined; // 项目id
teamId:number|undefined; // 班组id teamId: number | undefined; // 班组id
projectName:string|undefined; // 项目名称 projectName: string | undefined; // 项目名称
teamName:string|undefined; // 班组名称 teamName: string | undefined; // 班组名称
dateOfIssue:string|undefined; // 发放年月 dateOfIssue: string | undefined; // 发放年月
lister:string|undefined; // 制表人 lister: string | undefined; // 制表人
createdAt:string|undefined; // 创建时间 createdAt: string | undefined; // 创建时间
updatedAt:string|undefined; // 更新时间 updatedAt: string | undefined; // 更新时间
deletedAt:string|undefined; // 删除时间 deletedAt: string | undefined; // 删除时间
} }
export interface BusSalaryDetailsTableDataState { export interface BusSalaryDetailsTableDataState {
ids:any[]; ids: any[];
tableData: { tableData: {
data: Array<BusSalaryDetailsTableColumns>; data: Array<BusSalaryDetailsTableColumns>;
total: number; total: number;
loading: boolean; loading: boolean;
param: { param: {
pageNum: number; pageNum: number;
pageSize: number; pageSize: number;
id: number|undefined; id: number | undefined;
sfzNumber: string|undefined; sfzNumber: string | undefined;
projectId: number|undefined; projectId: string | undefined;
teamId: number|undefined; teamId: number | undefined;
dateRange: string[]; dateRange: string[];
};
}; };
};
} }
export interface BusSalaryDetailsEditState {
export interface BusSalaryDetailsEditState{ loading: boolean;
loading:boolean; isShowDialog: boolean;
isShowDialog: boolean; formData: BusSalaryDetailsInfoData;
formData:BusSalaryDetailsInfoData; rules: object;
rules: object;
} }

View File

@ -3,83 +3,80 @@
<el-card shadow="hover"> <el-card shadow="hover">
<div class="system-busSalaryDetails-search mb15"> <div class="system-busSalaryDetails-search mb15">
<el-form :model="tableData.param" ref="queryRef" :inline="true" label-width="100px"> <el-form :model="tableData.param" ref="queryRef" :inline="true" label-width="100px">
<el-form-item label="身份证" prop="sfzNumber"> <el-form-item label="姓名" prop="userName">
<el-input v-model="tableData.param.sfzNumber" placeholder="请输入身份证" clearable @keyup.enter.native="busSalaryDetailsList" /> <el-input v-model="tableData.param.userName" placeholder="请输入姓名" clearable @keyup.enter.native="busSalaryDetailsList" />
</el-form-item> </el-form-item>
<el-form-item label="项目选择" prop="projectId"> <el-form-item label="项目选择" prop="projectId">
<el-select v-model="tableData.param.projectId" placeholder="请选择项目" @change="onChangeProject"> <el-select v-model="tableData.param.projectId" placeholder="请选择项目" @change="onChangeProject">
<el-option v-for="(item, i) of projectList" :key="i" :label="item.shortName" :value="item.id"></el-option> <el-option v-for="(item, i) in projectList" :key="i" :label="item.name" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="班组选择" prop="teamId"> <el-form-item label="班组选择" prop="teamId">
<el-select v-model="tableData.param.teamId" @change="onChangeTeam" :disabled="!tableData.param.projectId" placeholder="请选择班组"> <el-select v-model="tableData.param.teamId" @change="onChangeTeam" :disabled="!tableData.param.projectId" placeholder="请选择班组">
<el-option v-for="(item, i) of TeamList" :key="i" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item, i) in TeamList" :key="i" :label="item.teamName" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="发放年月" prop="dateOfIssue">
<el-date-picker <el-form-item label="发放年月" prop="time">
v-model="tableData.param.dateOfIssue" <el-date-picker v-model="tableData.param.time" @change="onChangeOfIssue" value-format="YYYY-MM" type="month" placeholder="选择月份" />
@change="onChangeOfIssue"
value-format="YYYY-MM"
type="month"
placeholder="选择月份"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="busSalaryDetailsList" <el-button type="primary" @click="busSalaryDetailsList">
><el-icon><Search /></el-icon>搜索</el-button <el-icon><Search /></el-icon>搜索
> </el-button>
<el-button @click="resetQuery(queryRef)" <el-button @click="resetQuery(queryRef)">
><el-icon><Refresh /></el-icon>重置</el-button <el-icon><Refresh /></el-icon>重置
> </el-button>
</el-form-item> </el-form-item>
<el-button type="danger" :disabled="multiple" @click="handleDelete(null)" v-auth="'api/v1/system/busSalaryDetails/delete'"
><el-icon><Delete /></el-icon>批量删除</el-button <!-- <el-button type="danger" :disabled="multiple" @click="handleDelete(null)" v-auth="'api/v1/system/busSalaryDetails/delete'">
> <el-icon><Delete /></el-icon>批量删除
<!-- <el-col :span="2"> </el-button> -->
<span>
<label for="file" class="input-button" title="选择您的excel表格进行上传">导入考勤表格</label> <el-button type="success" @click="exportSalary(null)">
<input type="file" id="file" placeholder="选择文件2" /> <el-icon><Download /></el-icon>导出员工工资表
</span> </el-button>
</el-col> -->
<el-button type="success" @click="exportSalary(null)"
><el-icon><Download /></el-icon>导出员工工资表</el-button
>
</el-form> </el-form>
</div> </div>
<el-table v-loading="loading" border height="72vh" :data="tableData.data" @selection-change="handleSelectionChange"> <el-table v-loading="loading" border height="72vh" :data="tableData.data" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="序号" align="center" type="index" min-width="50px" /> <el-table-column label="序号" align="center" type="index" min-width="50px" />
<el-table-column label="身份证" align="center" prop="sfzNumber" min-width="120px" /> <el-table-column label="身份证" align="center" prop="sfzNumber" min-width="120px" />
<el-table-column label="户名" align="center" prop="name" min-width="100px" /> <el-table-column label="户名" align="center" prop="userName" min-width="100px" />
<el-table-column label="账户" align="center" prop="account" min-width="100px" /> <el-table-column label="账户" align="center" prop="yhkNumber" min-width="100px" />
<el-table-column label="当月总天数" align="center" prop="sumDuration" min-width="100px" /> <el-table-column label="开户行" align="center" prop="yhkOpeningBank" min-width="100px" />
<el-table-column label="当月总天数" align="center" prop="workDay" min-width="100px" />
<el-table-column label="薪水(天)" align="center" prop="salary" min-width="100px" /> <el-table-column label="薪水(天)" align="center" prop="salary" min-width="100px" />
<el-table-column label="发放年月" align="center" prop="dateOfIssue" min-width="100px" /> <!-- <el-table-column label="发放年月" align="center" prop="dateOfIssue" min-width="100px" /> -->
<el-table-column label="总额(元)" align="center" prop="" min-width="100px"> <el-table-column label="总额(元)" align="center" min-width="100px" prop="totalSalary" />
<template #default="scope"> <!-- <template #default="scope">
<span>{{ (Number(scope.row.sumDuration) * Number(scope.row.salary)).toFixed(2) }}</span> <span>{{ (Number(scope.row.sumDuration) * Number(scope.row.salary)).toFixed(2) }}</span>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column label="上传时间" align="center" prop="createdAt" min-width="100px"> <el-table-column label="上传时间" align="center" prop="time" min-width="100px">
<template #default="scope"> <template #default="scope">
<span>{{ scope.row.createdAt }}</span> <span>{{ scope.row.time }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding" min-width="200px" fixed="right">
<!-- <el-table-column label="操作" align="center" min-width="200px" fixed="right">
<template #default="scope"> <template #default="scope">
<el-button type="primary" link @click="handleView(scope.row)" v-auth="'api/v1/system/busSalaryDetails/view'" <el-button type="primary" link @click="handleView(scope.row)" v-auth="'api/v1/system/busSalaryDetails/view'">
><el-icon><View /></el-icon>详情</el-button <el-icon><View /></el-icon>详情
> </el-button>
<el-button type="success" link @click="exportSalary(scope.row)" <el-button type="success" link @click="exportSalary(scope.row)">
><el-icon><Download /></el-icon>导出工资表</el-button <el-icon><Download /></el-icon>导出工资表
> </el-button>
<el-button type="danger" link @click="handleDelete(scope.row)" v-auth="'api/v1/system/busSalaryDetails/delete'" <el-button type="danger" link @click="handleDelete(scope.row)" v-auth="'api/v1/system/busSalaryDetails/delete'">
><el-icon><DeleteFilled /></el-icon>删除</el-button <el-icon><DeleteFilled /></el-icon>删除
> </el-button>
</template> </template>
</el-table-column> </el-table-column> -->
</el-table> </el-table>
<pagination <pagination
v-show="tableData.total > 0" v-show="tableData.total > 0"
:total="tableData.total" :total="tableData.total"
@ -88,457 +85,183 @@
@pagination="busSalaryDetailsList" @pagination="busSalaryDetailsList"
/> />
</el-card> </el-card>
<apiV1SystemBusSalaryDetailsDetail ref="detailRef" @busSalaryDetailsList="busSalaryDetailsList"></apiV1SystemBusSalaryDetailsDetail>
<apiV1SystemBusSalaryDetailsDetail ref="detailRef" @busSalaryDetailsList="busSalaryDetailsList" />
</div> </div>
</template> </template>
<script lang="ts">
import { toRefs, reactive, onMounted, ref, defineComponent, computed, getCurrentInstance, toRaw } from 'vue'; <script setup lang="ts">
import { ref, reactive, computed, onMounted, getCurrentInstance } from 'vue';
import { ElMessageBox, ElMessage, FormInstance, ElLoading } from 'element-plus'; import { ElMessageBox, ElMessage, FormInstance, ElLoading } from 'element-plus';
// import { listBusSalaryDetails, delBusSalaryDetails, addBusSalaryDetails, salarySheet } from '@/api/project/busSalaryDetails';
import { BusSalaryDetailsTableColumns, BusSalaryDetailsTableDataState } from './component/model';
import apiV1SystemBusSalaryDetailsDetail from './component/detail.vue'; import apiV1SystemBusSalaryDetailsDetail from './component/detail.vue';
import * as xlsx from 'xlsx'; import * as xlsx from 'xlsx';
// import { exportDataToExcel } from '@/utils/exportDataToExcel.js';
import { useUserStoreHook } from '@/store/modules/user'; import { useUserStoreHook } from '@/store/modules/user';
import { listProjectTeam } from '@/api/project/projectTeam'; import { listProjectTeam } from '@/api/project/projectTeam';
// import { listProject, listProjectGo } from '@/api/project/project'; import { listBusSalaryDetails } from '@/api/project/busSalaryDetails';
export default defineComponent({ import { downloadGet } from '@/utils/request';
name: 'index', // import { listProjectTeam } from '@/api/project/projectTeam'
components: { // import { exportDataToExcel } from '@/utils/exportDataToExcel.js'
apiV1SystemBusSalaryDetailsDetail
}, const stores = useUserStoreHook();
setup() { const { proxy }: any = getCurrentInstance();
const stores = useUserStoreHook();
const { proxy } = <any>getCurrentInstance(); const loading = ref(false);
const loading = ref(false); const queryRef = ref<FormInstance>();
const queryRef = ref(); const detailRef = ref();
const detailRef = ref();
// 是否显示所有搜索选项 // 状态变量
const showAll = ref(false); const showAll = ref(false);
// 非单个禁用 const single = ref(true);
const single = ref(true); const multiple = ref(true);
// 非多个禁用
const multiple = ref(true); const word = computed(() => (showAll.value ? '收起搜索' : '展开搜索'));
const word = computed(() => {
if (showAll.value === false) { // 数据源
//对文字进行处理 const projectList = computed(() => stores.projects);
return '展开搜索'; const projectListMap = new Map();
} else { const TeamList = ref([]);
return '收起搜索';
} const tableData = reactive({
}); data: [] as any[],
// 字典选项数据 total: 0,
const {} = proxy.useDict(); loading: false,
const state = reactive<BusSalaryDetailsTableDataState>({ param: {
ids: [], pageNum: 1,
projectList: [], //项目列表 pageSize: 10,
projectListMap: new Map(), userName: undefined,
TeamList: [], //班组列表 projectId: stores.selectedProject.id,
TeamListMap: new Map(), //班组列表 teamId: undefined,
tableData: { dateRange: [] as any[],
data: [], time: proxy.parseTime(new Date(), '{y}-{m}')
total: 0,
loading: false,
param: {
pageNum: 1,
pageSize: 10,
sfzNumber: undefined,
projectId: stores.selectedProject.goId,
teamId: undefined,
dateRange: [],
dateOfIssue: proxy.parseTime(new Date(), '{y}-{m}') //默认当前工作年月
}
}
});
// 页面加载时
onMounted(() => {
initTableData();
sysProjectList();
document.querySelector('#file').addEventListener('change', function () {
//获取到选中的文件
var file = document.querySelector('#file').files[0];
onChange(file);
});
sysListSysProjectTeam(state.tableData.param.projectId); //默认项目
});
const onChangeProject = (val) => {
sysListSysProjectTeam(val);
// 切换项目后 班组默认未空
state.tableData.param.teamId = '';
// 获取数据
busSalaryDetailsList();
};
// 班组切换
const onChangeTeam = (val) => {
busSalaryDetailsList();
};
const onChangeOfIssue = () => {
busSalaryDetailsList();
};
// 获取项目列表数据
const sysProjectList = () => {
// listProjectGo({ pageNum: 1, pageSize: 1000 }).then((res: any) => {
// let list = res.data.list ?? [];
// if (list.length) {
// state.projectList = list;
// list.forEach((item) => {
// state.projectListMap.set(item.id, item.shortName);
// });
// }
// });
};
// 获取班组列表
const sysListSysProjectTeam = (projectId) => {
// listProjectTeam({ pageNum: 1, pageSize: 1000, projectId }).then((res: any) => {
// let list = res.data.list ?? [];
// if (list.length) {
// state.TeamList = list;
// list.forEach((item) => {
// state.TeamListMap.set(item.id, item.name);
// });
// }
// });
};
const onChange = async (file) => {
/**
* 1. 使用原生api去读取好的文件
* */
// console.log("原始上传的文件", file);
// 读取文件不是立马能够读取到的所以是异步的使用Promise
let dataBinary = await new Promise((resolve) => {
// Web API构造函数FileReader可实例化对象去调用其身上方法去读取解析文件信息
let reader = new FileReader(); // https://developer.mozilla.org/zh-CN/docs/Web/API/FileReader
// console.log("实例化对象有各种方法", reader);
reader.readAsBinaryString(file); // 读取raw的File文件
reader.onload = (ev) => {
// console.log("文件解析流程进度事件", ev);
resolve(ev.target.result); // 将解析好的结果扔出去,以供使用
};
});
// console.log("读取出的流文件", dataBinary);
/**
* 2. 使用xlsx插件去解析已经读取好的二进制excel流文件
* */
let workBook = xlsx.read(dataBinary, { type: 'binary', cellDates: true });
// excel中有很多的sheet这里取了第一个sheetworkBook.SheetNames[0]
let arr = [];
workBook.SheetNames.forEach((item) => {
let firstWorkSheet = workBook.Sheets[item];
const data = xlsx.utils.sheet_to_json(firstWorkSheet);
arr.push(data);
});
let dataList = []; //需提交数据
arr.forEach((item, i) => {
//截取数据
// 获取制表人
let detailObj = {};
let lister = ''; //制表人 单独读取
let listerObj = item[item.length - 3];
let year = 0; //年
let month = 0; //月
for (let key in listerObj) {
if (key.indexOf('建筑施工') != -1) {
//是否包含
lister = listerObj[key].substring(4).trim();
// 获取年月
let index = key.indexOf('年');
let index1 = key.indexOf('');
month = parseInt(key.substring(index + 1, index + 10));
year = parseInt(key.substring(index1 + 1, index));
}
}
// 获取人员信息
let arr1 = item.slice(2, -3);
month = month < 10 ? '0' + month : month;
if (arr1.length) {
arr1.forEach((item) => {
let dates = []; //用户信息
let name = item.__EMPTY; //用户名
let sfzNumber = item.__EMPTY_1; //身份证
let sumDuration = 0; //工作总时长
let dateOfIssue = year + '-' + month; //发放年月
let days = new Date(year, month, 0).getDate();
for (let key in item) {
let ind = key.split('_')[3];
if (ind > 1 && ind <= days + 1) {
//后面数据
let working_date = ind - 1 < 10 ? '0' + (ind - 1) : ind - 1;
let obj = { working_date: working_date.toString(), duration: item[key] };
dates.push(obj);
sumDuration += item[key];
}
}
detailObj = {
//用户
lister,
dates,
name,
sfzNumber,
dateOfIssue,
sumDuration
};
dataList.push(detailObj);
});
}
});
const loading = ElLoading.service({
lock: true,
text: '正在上传中……',
background: 'rgba(0, 0, 0, 0.7)'
});
if (dataList.length) {
// addBusSalaryDetails({ dataList }).then((res: any) => {
// loading.close();
// if (res.code == 0) {
// ElMessage.success('上传成功');
// busSalaryDetailsList();
// } else {
// ElMessage.error(res.message);
// }
// });
} else {
ElMessage.warning('表格数据为空');
}
event.target.value = '';
};
// 初始化表格数据
const initTableData = () => {
busSalaryDetailsList();
};
/** 重置按钮操作 */
const resetQuery = (formEl: FormInstance | undefined) => {
if (!formEl) return;
formEl.resetFields();
busSalaryDetailsList();
};
// 获取列表数据
const busSalaryDetailsList = () => {
loading.value = true;
// listBusSalaryDetails(state.tableData.param).then((res: any) => {
// let list = res.data.list ?? [];
// state.tableData.data = list;
// state.tableData.total = res.data.total;
// loading.value = false;
// });
};
const toggleSearch = () => {
showAll.value = !showAll.value;
};
const handleDelete = (row: BusSalaryDetailsTableColumns) => {
let msg = '你确定要删除所选数据?';
let id: number[] = [];
if (row) {
msg = `此操作将永久删除数据,是否继续?`;
id = [row.id];
} else {
id = state.ids;
}
if (id.length === 0) {
ElMessage.error('请选择要删除的数据。');
return;
}
ElMessageBox.confirm(msg, '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
// delBusSalaryDetails(id).then(() => {
// ElMessage.success('删除成功');
// busSalaryDetailsList();
// });
})
.catch(() => {});
};
const handleView = (row: BusSalaryDetailsTableColumns) => {
detailRef.value.openDialog(toRaw(row));
};
const exportSalary = (row) => {
// 导出工资表
let obj = {};
let fileName = '';
let year = '';
let month = '';
let porjectName = '';
if (row) {
//个人
obj = {
project: state.tableData.param.projectId, //项目id
dateOfIssue: row.dateOfIssue, //工作年月
team: '', //班组id
sfzNumber: row.sfzNumber //施工人员身份证
};
year = obj.dateOfIssue.split('-')[0];
month = obj.dateOfIssue.split('-')[1];
fileName = row.name + '-' + year + '年' + month + '月工资表.xlsx';
} else {
// 导出工资表
obj = {
project: state.tableData.param.projectId,
dateOfIssue: state.tableData.param.dateOfIssue,
team: state.tableData.param.teamId,
sfzNumber: '' //施工人员身份证
};
porjectName = state.projectListMap.get(state.tableData.param.projectId);
year = obj.dateOfIssue.split('-')[0];
month = obj.dateOfIssue.split('-')[1];
if (state.tableData.param.teamId) {
let TeamName = state.TeamListMap.get(state.tableData.param.teamId);
fileName = porjectName + '-' + TeamName + '-' + year + '年' + month + '月员工工资表.xlsx';
} else {
fileName = porjectName + '-' + year + '年' + month + '月员工工资表.xlsx';
}
}
let time = year + '年' + month + '月';
getSalarySheet(obj, fileName, time);
};
const getSalarySheet = (obj, fileName, time) => {
salarySheet(obj).then((res: any) => {
if (res.code == 0) {
// 先根据
let array = setTeamList(res.data.list);
// 设置项目名称及班组
let excelList = [];
array.forEach((item) => {
let obj = item[0];
let excelName = obj.teamName; //班组
if (!obj.teamName) {
excelName = '暂未分组人员';
}
let config = exportConfig(item, excelName, time);
excelList.push(config);
});
exportDataToExcel(excelList, fileName);
}
});
};
// 把施工人员分组
const setTeamList = (list) => {
let team = new Map();
list.forEach((item) => {
// 判断班组id是否存在
if (!item.teamName) {
item.teamName = '暂无班组';
}
if (team.has(item.teamName)) {
let arr = team.get(item.teamName);
arr.push(item);
team.set(item.teamName, arr);
} else {
team.set(item.teamName, [item]);
}
});
return Array.from(team.values());
};
// excel表格样式设置
const exportConfig = (arr, sheetName, time) => {
let header = ['建筑施工企业现场人员工资表(' + time + ''];
const header1 = [];
let obj = arr[0];
let projectName = '项目部名称:' + obj.projectName;
let teamName = '班组类别:' + obj.teamName;
const header2 = [projectName + ' ' + teamName];
const header3 = ['序号', '账号', '户名', '金额', '开户行', '签字'];
let columnsWidth = [8, 24, 12, 10, 35, 10]; //表格宽度
let fields = ['index', 'yhkNumber', 'userName', 'money', 'bankingHouse', ''];
arr.map((item, index) => {
item.index = index + 1;
return;
});
// 单元格合并
const merges = [
{ row: 0, col: 0, rowspan: 1, colspan: 6 },
{ row: 2, col: 0, rowspan: 1, colspan: 6 },
{ row: arr.length + 5, col: 0, rowspan: 1, colspan: 3 },
{ row: arr.length + 5, col: 3, rowspan: 1, colspan: 3 }
];
arr.push({});
arr.push({
index: '班组长:',
money: '劳资员:'
});
const config = {
data: arr,
fields,
headers: [header, header1, header2, header3],
merges,
attrs: [],
view: [],
columnsWidth,
sheetName
};
// 设置表头字体加粗
config.attrs.push({
rowStart: 0,
rowEnd: 0,
colStart: 0,
colEnd: config.fields.length - 1,
attr: {
alignment: { vertical: 'middle', horizontal: 'center' },
font: {
bold: true,
size: '16'
}
}
});
config.attrs.push({
rowStart: 2,
rowEnd: 2,
colStart: 0,
colEnd: config.fields.length - 1,
attr: {
alignment: { vertical: 'middle', horizontal: 'center' }
}
});
// 设置全表单元格边框,居中布局
config.attrs.push({
rowStart: 3,
rowEnd: config.data.length + 1,
colStart: 0,
colEnd: config.fields.length - 1,
attr: {
alignment: { vertical: 'middle', horizontal: 'center' },
border: {
top: { style: 'thin' },
left: { style: 'thin' },
bottom: { style: 'thin' },
right: { style: 'thin' }
}
}
});
return config;
};
// 多选框选中数据
const handleSelectionChange = (selection) => {
state.ids = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
};
return {
proxy,
detailRef,
showAll,
loading,
single,
onChangeProject,
onChangeTeam,
multiple,
handleSelectionChange,
word,
onChangeOfIssue,
queryRef,
resetQuery,
busSalaryDetailsList,
exportSalary,
toggleSearch,
handleDelete,
handleView,
...toRefs(state)
};
} }
}); });
// 页面初始化
onMounted(() => {
busSalaryDetailsList();
sysListSysProjectTeam(tableData.param.projectId);
});
// ---------------- 事件方法 ----------------
const onChangeProject = (val: string) => {
sysListSysProjectTeam(val);
tableData.param.teamId = '';
busSalaryDetailsList();
};
const onChangeTeam = () => {
busSalaryDetailsList();
};
const onChangeOfIssue = () => {
busSalaryDetailsList();
};
// 获取班组列表
const sysListSysProjectTeam = (projectId: string) => {
listProjectTeam({ pageNum: 1, pageSize: 1000, projectId }).then((res: any) => {
const list = res.rows ?? [];
TeamList.value = list;
// if (list.length) {
// tableData.param.teamId = list[0].id;
// busSalaryDetailsList();
// }
});
};
// 上传excel解析
const onChange = async (file: File) => {
const dataBinary: any = await new Promise((resolve) => {
const reader = new FileReader();
reader.readAsBinaryString(file);
reader.onload = (ev) => resolve(ev.target?.result);
});
const workBook = xlsx.read(dataBinary, { type: 'binary', cellDates: true });
const arr: any[] = [];
workBook.SheetNames.forEach((name) => {
const sheet = workBook.Sheets[name];
arr.push(xlsx.utils.sheet_to_json(sheet));
});
const dataList: any[] = [];
arr.forEach((item) => {
// 解析逻辑保持不变...
});
const loadingInstance = ElLoading.service({ lock: true, text: '正在上传中……', background: 'rgba(0,0,0,0.7)' });
if (dataList.length) {
// addBusSalaryDetails({ dataList }).then(...)
} else {
ElMessage.warning('表格数据为空');
}
loadingInstance.close();
};
const resetQuery = (formEl: FormInstance | undefined) => {
if (!formEl) return;
formEl.resetFields();
busSalaryDetailsList();
sysListSysProjectTeam(tableData.param.projectId);
};
const busSalaryDetailsList = () => {
loading.value = true;
try {
listBusSalaryDetails(tableData.param).then((res: any) => {
tableData.data = res.rows ?? [];
tableData.total = res.total;
});
} finally {
loading.value = false;
}
};
const toggleSearch = () => {
showAll.value = !showAll.value;
};
const handleDelete = (row: any) => {
let msg = row ? '此操作将永久删除数据,是否继续?' : '你确定要删除所选数据?';
const id = row ? [row.id] : (tableData.data.filter((d) => d.checked).map((d) => d.id) as number[]);
if (!id.length) {
ElMessage.error('请选择要删除的数据。');
return;
}
ElMessageBox.confirm(msg, '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning' })
.then(() => {
// delBusSalaryDetails(id).then(...)
})
.catch(() => {});
};
const handleView = (row: any) => {
detailRef.value.openDialog(row);
};
const exportSalary = (row: any) => {
if (!tableData.data.length) {
proxy?.$modal.msgError('当前不存在员工工资数据');
return;
}
// 导出工资表逻辑...
downloadGet(
'/contractor/userSalaryDetail/export',
{ projectId: tableData.param.projectId, teamId: tableData.param.teamId, time: tableData.param.time },
`${tableData.param.time}员工工资表.xlsx`,
true
);
};
const handleSelectionChange = (selection: any[]) => {
single.value = selection.length !== 1;
multiple.value = !selection.length;
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.colBlock { .colBlock {
display: block; display: block;
@ -552,11 +275,11 @@ export default defineComponent({
} }
label { label {
display: inline-block; display: inline-block;
background-color: #007bff; /*设置背景色*/ background-color: #007bff;
color: #fff; /*设置字体颜色*/ color: #fff;
padding: 3px 10px; /*设置内边距*/ padding: 3px 10px;
border-radius: 5px; /*设置圆角*/ border-radius: 5px;
cursor: pointer; /*将鼠标光标设置为手型*/ cursor: pointer;
font-size: 13px; font-size: 13px;
} }
} }

View File

@ -1,11 +1,13 @@
<template> <template>
<div class="p-2"> <div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> <transition :enter-active-class="proxy?.animate.searchAnimate.enter"
:leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]"> <div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover"> <el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true"> <el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="发生日期" prop="happenDate"> <el-form-item label="发生日期" prop="happenDate">
<el-date-picker clearable v-model="queryParams.happenDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择发生日期" /> <el-date-picker clearable v-model="queryParams.happenDate" type="date" value-format="YYYY-MM-DD"
placeholder="请选择发生日期" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
@ -26,15 +28,8 @@
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['quality:qualityConstructionLog:edit']">修改</el-button> <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['quality:qualityConstructionLog:edit']">修改</el-button>
</el-col> --> </el-col> -->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
type="danger" v-hasPermi="['quality:qualityConstructionLog:remove']">删除</el-button>
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete()"
v-hasPermi="['quality:qualityConstructionLog:remove']"
>删除</el-button
>
</el-col> </el-col>
<!-- <el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['quality:qualityConstructionLog:export']">导出</el-button> <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['quality:qualityConstructionLog:export']">导出</el-button>
@ -81,14 +76,16 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" icon="View" @click="handleUpdate(scope.row)">详情</el-button> <el-button link type="primary" icon="View" @click="handleUpdate(scope.row)">详情</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['quality:qualityConstructionLog:remove']"> <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
v-hasPermi="['quality:qualityConstructionLog:remove']">
删除 删除
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card> </el-card>
<!-- 详情对话框 --> <!-- 详情对话框 -->
<el-dialog title="施工日志详情" v-model="dialog.visible" width="60vw" append-to-body> <el-dialog title="施工日志详情" v-model="dialog.visible" width="60vw" append-to-body>
@ -147,6 +144,8 @@ const data = reactive<PageData<QualityConstructionLogForm, QualityConstructionLo
pageSize: 10, pageSize: 10,
projectId: currentProject.value?.id, projectId: currentProject.value?.id,
happenDate: undefined, happenDate: undefined,
orderByColumn: "createTime",
isAsc: "desc",
params: {} params: {}
}, },
rules: { rules: {

View File

@ -2,12 +2,12 @@
<div class="documentCompletion-data"> <div class="documentCompletion-data">
<el-tabs v-model="activeName" class="p-4" @tab-click="handleClick"> <el-tabs v-model="activeName" class="p-4" @tab-click="handleClick">
<el-tab-pane label="文件夹" name="first"> <el-tab-pane label="文件夹" name="first">
<el-button type="success" :disabled="toolStart" @click="handleFile(3)" <el-button type="success" :disabled="toolStart" @click="handleFile(3)"><el-icon>
><el-icon><Plus /></el-icon>新建文件夹</el-button <Plus />
> </el-icon>新建文件夹</el-button>
<el-button type="primary" :disabled="toolStart" @click="handleFile(2)" <el-button type="primary" :disabled="toolStart" @click="handleFile(2)"><el-icon>
><el-icon><Upload /></el-icon>上传文件</el-button <Upload />
> </el-icon>上传文件</el-button>
<el-card style="margin-top: 10px"> <el-card style="margin-top: 10px">
<div class="breadcrumb-img"> <div class="breadcrumb-img">
<el-breadcrumb> <el-breadcrumb>
@ -18,16 +18,19 @@
<div class="tool-All"> <div class="tool-All">
<div v-if="!toolStart"> <div v-if="!toolStart">
<el-button type="primary" v-hasPermi="['project:project:remove']" @click="onBatchAll"> <el-button type="primary" v-hasPermi="['project:project:remove']" @click="onBatchAll">
<el-icon><Menu /></el-icon>批量操作</el-button <el-icon>
> <Menu />
</el-icon>批量操作</el-button>
</div> </div>
<div v-if="toolStart"> <div v-if="toolStart">
<el-button type="warning" @click="onBatchAll"> <el-button type="warning" @click="onBatchAll">
<el-icon><Tools /></el-icon>取消操作</el-button <el-icon>
> <Tools />
</el-icon>取消操作</el-button>
<el-button type="danger" @click="onDeleteAll"> <el-button type="danger" @click="onDeleteAll">
<el-icon><Delete /></el-icon>删除</el-button <el-icon>
> <Delete />
</el-icon>删除</el-button>
</div> </div>
</div> </div>
</div> </div>
@ -40,17 +43,9 @@
<div @click="onNav(item)" title="点击打开文件" @contextmenu="onContextmenu($event, item, i)"> <div @click="onNav(item)" title="点击打开文件" @contextmenu="onContextmenu($event, item, i)">
<img src="../../../assets/icons/svg/file1.png" v-if="item.fileType == '2'" alt="" /> <img src="../../../assets/icons/svg/file1.png" v-if="item.fileType == '2'" alt="" />
<img src="../../../assets/icons/svg/file.png" v-else-if="item.fileType == '1'" alt="" /> <img src="../../../assets/icons/svg/file.png" v-else-if="item.fileType == '1'" alt="" />
<el-image <el-image v-else-if="item.fileType == '3'" style="width: 100%; height: 100%" :src="item.filePath"
v-else-if="item.fileType == '3'" :zoom-rate="1.2" :max-scale="7" :min-scale="0.2" :initial-index="4"
style="width: 100%; height: 100%" :preview-src-list="[item.filenPathCoding]" fit="cover" />
:src="item.filePath"
:zoom-rate="1.2"
:max-scale="7"
:min-scale="0.2"
:initial-index="4"
:preview-src-list="[item.filenPathCoding]"
fit="cover"
/>
<img :src="'/icon/' + item.fileType + '.png'" v-else /> <img :src="'/icon/' + item.fileType + '.png'" v-else />
</div> </div>
<span @click="onFileName(item)" title="点击重命名">{{ item.fileName }}</span> <span @click="onFileName(item)" title="点击重命名">{{ item.fileName }}</span>
@ -104,7 +99,7 @@ export default defineComponent({
const { proxy } = <any>getCurrentInstance(); const { proxy } = <any>getCurrentInstance();
const RecyclingStationRef = ref(); const RecyclingStationRef = ref();
// 字典选项数据 // 字典选项数据
const {} = proxy.useDict(); const { } = proxy.useDict();
// 文件下载 // 文件下载
const onExport = (event) => { const onExport = (event) => {
event.stopPropagation(); event.stopPropagation();
@ -242,7 +237,7 @@ export default defineComponent({
} }
}); });
}) })
.catch(() => {}); .catch(() => { });
} else { } else {
// 竣工图 // 竣工图
proxy.mittBus.emit('bigUploader.uploadFile', { type: 100, types: 1010, accept: [] }); proxy.mittBus.emit('bigUploader.uploadFile', { type: 100, types: 1010, accept: [] });
@ -295,7 +290,7 @@ export default defineComponent({
} }
}); });
}) })
.catch(() => {}); .catch(() => { });
}; };
const handleClick = (val) => { const handleClick = (val) => {
if (state.activeName == 'second') { if (state.activeName == 'second') {
@ -356,7 +351,7 @@ export default defineComponent({
} }
}); });
}) })
.catch(() => {}); .catch(() => { });
}; };
// 批量删除 // 批量删除
const onDeleteAll = () => { const onDeleteAll = () => {
@ -420,23 +415,28 @@ export default defineComponent({
align-items: center; align-items: center;
width: 100%; width: 100%;
padding-right: 10px; padding-right: 10px;
.tool-All { .tool-All {
display: flex; display: flex;
align-items: center; align-items: center;
> div {
>div {
display: flex; display: flex;
align-items: center; align-items: center;
} }
} }
.batch { .batch {
width: 24px; width: 24px;
} }
} }
.file_detail { .file_detail {
position: relative; position: relative;
width: 100%; width: 100%;
height: 66vh; height: 66vh;
overflow: auto; overflow: auto;
.right_box { .right_box {
position: absolute; position: absolute;
z-index: 999; z-index: 999;
@ -448,7 +448,8 @@ export default defineComponent({
display: none; display: none;
border-radius: 6px; border-radius: 6px;
padding: 14px 4px; padding: 14px 4px;
> div {
>div {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
color: #fff; color: #fff;
@ -457,10 +458,12 @@ export default defineComponent({
font-family: revert; font-family: revert;
border-radius: 5px; border-radius: 5px;
} }
> div:hover {
>div:hover {
background-color: rgb(0 0 0 / 80%); background-color: rgb(0 0 0 / 80%);
} }
} }
.file_style { .file_style {
// height: 100px; // height: 100px;
width: 90px; width: 90px;
@ -472,22 +475,26 @@ export default defineComponent({
animation: 0.5s ease; animation: 0.5s ease;
position: relative; position: relative;
margin-bottom: 10px; margin-bottom: 10px;
> div {
>div {
width: 100%; width: 100%;
// height: 70%; // height: 70%;
height: 80px; height: 80px;
> img {
>img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
.checkbox-box { .checkbox-box {
position: absolute; position: absolute;
top: -8px; top: -8px;
left: 60px; left: 60px;
z-index: 1000; z-index: 1000;
} }
> span {
>span {
font-size: 12px; font-size: 12px;
width: 100%; width: 100%;
display: block; display: block;
@ -498,10 +505,12 @@ export default defineComponent({
word-wrap: break-word; word-wrap: break-word;
} }
} }
.file_style:hover { .file_style:hover {
background-color: rgba(189, 189, 189, 0.322); background-color: rgba(189, 189, 189, 0.322);
border-radius: 5px; border-radius: 5px;
} }
.fileActive { .fileActive {
display: block; display: block;
top: 0; top: 0;
@ -515,9 +524,11 @@ export default defineComponent({
} }
} }
} }
.colBlock { .colBlock {
display: block; display: block;
} }
.colNone { .colNone {
display: none; display: none;
} }

View File

@ -6,8 +6,10 @@
<el-col :span="12" style="text-align: right">记录时间{{ safetyLogDetail?.createTime }}</el-col> <el-col :span="12" style="text-align: right">记录时间{{ safetyLogDetail?.createTime }}</el-col>
</el-row> </el-row>
<el-descriptions :column="3" border style="margin-top: 8px"> <el-descriptions :column="3" border style="margin-top: 8px">
<el-descriptions-item label-align="center" width="160px" label="项目名称" :span="3">{{ currentProject?.name }} </el-descriptions-item> <el-descriptions-item label-align="center" width="160px" label="项目名称" :span="3">{{ currentProject?.name }}
<el-descriptions-item label-align="center" label="发生日期">{{ safetyLogDetail?.dateOfOccurrence }} </el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label-align="center" label="发生日期">{{ safetyLogDetail?.dateOfOccurrence }}
</el-descriptions-item>
<el-descriptions-item label-align="center" label="气温"> <el-descriptions-item label-align="center" label="气温">
<span>最高{{ safetyLogDetail?.airTemperatureMax }}</span> <span>最高{{ safetyLogDetail?.airTemperatureMax }}</span>
<span>最低{{ safetyLogDetail?.airTemperatureMin }}</span> <span>最低{{ safetyLogDetail?.airTemperatureMin }}</span>
@ -36,20 +38,44 @@
<el-descriptions-item label-align="center" label="监理通知有关部门安全检查情况" :span="3"> <el-descriptions-item label-align="center" label="监理通知有关部门安全检查情况" :span="3">
{{ safetyLogDetail?.safetyInspectionCondition }} {{ safetyLogDetail?.safetyInspectionCondition }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label-align="center" label="停工、加班情况" :span="3">{{ safetyLogDetail?.stoppageOrOvertime }} </el-descriptions-item> <el-descriptions-item label-align="center" label="停工、加班情况" :span="3">{{ safetyLogDetail?.stoppageOrOvertime }}
</el-descriptions-item>
<el-descriptions-item label-align="center" label="其他应记录的安全与文明施工事项" :span="3"> <el-descriptions-item label-align="center" label="其他应记录的安全与文明施工事项" :span="3">
{{ safetyLogDetail?.otherCondition }} {{ safetyLogDetail?.otherCondition }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label-align="center" label="附件" :span="3"> <el-descriptions-item label-align="center" label="附件" :span="3">
<el-space direction="vertical"> <el-space direction="vertical">
<el-link v-for="item in fileList" :key="item.ossId" :href="`${item.url}`" type="primary" :underline="false" target="_blank"> <template v-for="item in fileList" :key="item.ossId">
<span> {{ item.originalName }} </span> <el-link :href="`${item.url}`" type="primary" :underline="false" target="_blank""
</el-link> v-if="item.fileSuffix.includes('pdf')">
<span> {{ item.originalName }} </span>
</el-link>
<el-space wrap>
<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">
<span> {{ item.originalName }} </span>
</el-link>
</span>
</el-space>
</template>
</el-space> </el-space>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label-align="center" label="备注" :span="3">{{ safetyLogDetail?.remark }} </el-descriptions-item> <el-descriptions-item label-align="center" label="备注" :span="3">{{ safetyLogDetail?.remark }}
</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
<el-dialog width="80%" v-model="viewFileVisible" title="查看文件" append-to-body>
<iframe :src="fileUrl" frameborder="0" width="100%" height="800"></iframe>
<template #footer>
<div class="dialog-footer">
<el-button @click="viewFileVisible = false" type="primary">关闭</el-button>
</div>
</template>
</el-dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -74,6 +100,8 @@ const props = defineProps<Props>();
const loading = ref<boolean>(false); const loading = ref<boolean>(false);
const safetyLogDetail = ref<SafetyLogVO>(); const safetyLogDetail = ref<SafetyLogVO>();
const fileList = ref<Array<OssVO>>([]); const fileList = ref<Array<OssVO>>([]);
const viewFileVisible = ref<boolean>(false);
const fileUrl = ref<string>('');
const get = async () => { const get = async () => {
loading.value = true; loading.value = true;
const res = await getSafetyLog(props.safetyLogId); const res = await getSafetyLog(props.safetyLogId);
@ -86,7 +114,11 @@ const get = async () => {
} }
loading.value = false; loading.value = false;
}; };
const viewFile = (url: string) => {
fileUrl.value = url;
viewFileVisible.value = true;
return false;
};
onMounted(() => { onMounted(() => {
get(); get();
}); });

View File

@ -25,7 +25,7 @@
<template #header> <template #header>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['safety:safetyLog:add']">1 <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['safety:safetyLog:add']">新增
</el-button> </el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -214,7 +214,8 @@ const data = reactive<PageData<SafetyLogForm, SafetyLogQuery>>({
otherCondition: undefined, otherCondition: undefined,
remark: undefined, remark: undefined,
creatorName: undefined, creatorName: undefined,
orderByColumn: "createTime",
isAsc: "desc",
params: {} params: {}
}, },
rules: { rules: {

View File

@ -3,7 +3,8 @@
<el-descriptions v-loading="loading" :column="2"> <el-descriptions v-loading="loading" :column="2">
<el-descriptions-item :span="2" label="宣讲人">{{ teamMeetingDetail?.compereName }}</el-descriptions-item> <el-descriptions-item :span="2" label="宣讲人">{{ teamMeetingDetail?.compereName }}</el-descriptions-item>
<el-descriptions-item :span="2" label="参与人"> <el-descriptions-item :span="2" label="参与人">
<span :key="item.id" v-for="item in teamMeetingDetail?.participantList">{{ item.name }}</span> <!-- <span :key="item.id" v-for="item in teamMeetingDetail?.participantList">{{ item.name }}</span> -->
<span>{{teamMeetingDetail?.participantList.map(item => item.name).join("")}}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="班组名称">{{ teamMeetingDetail?.teamName }}</el-descriptions-item> <el-descriptions-item label="班组名称">{{ teamMeetingDetail?.teamName }}</el-descriptions-item>
<el-descriptions-item label="施工单位">{{ teamMeetingDetail?.contractorName }}</el-descriptions-item> <el-descriptions-item label="施工单位">{{ teamMeetingDetail?.contractorName }}</el-descriptions-item>