上传
This commit is contained in:
@ -67,10 +67,12 @@
|
||||
"vue-json-pretty": "2.4.0",
|
||||
"vue-print-nb": "^1.7.5",
|
||||
"vue-router": "4.4.5",
|
||||
"vue-simple-uploader": "^1.0.3",
|
||||
"vue-types": "5.1.3",
|
||||
"vue3-print-nb": "^0.1.4",
|
||||
"vue3-scroll-seamless": "^1.0.6",
|
||||
"vxe-table": "4.5.22"
|
||||
"vxe-table": "4.5.22",
|
||||
"xlsx": "^0.18.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "9.15.0",
|
||||
|
@ -4,6 +4,8 @@ import { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
// 获取路由
|
||||
export function getRouters(id: string): AxiosPromise<RouteRecordRaw[]> {
|
||||
console.log('🚀 ~ getRouters ~ id:', id);
|
||||
|
||||
return request({
|
||||
url: '/system/menu/getRouters/' + id,
|
||||
method: 'get'
|
||||
|
61
src/api/project/busSalaryDetails/index.ts
Normal file
61
src/api/project/busSalaryDetails/index.ts
Normal file
@ -0,0 +1,61 @@
|
||||
import request from '@/utils/request-go';
|
||||
// 查询员工工资考核记录列表
|
||||
export function listBusSalaryDetails(query: object) {
|
||||
return request({
|
||||
url: '/zm/api/v1/system/busSalaryDetails/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
// 查询员工工资考核记录详细
|
||||
export function getBusSalaryDetails(id: number) {
|
||||
return request({
|
||||
url: '/zm/api/v1/system/busSalaryDetails/get',
|
||||
method: 'get',
|
||||
params: {
|
||||
id: id.toString()
|
||||
}
|
||||
});
|
||||
}
|
||||
// 新增员工工资考核记录
|
||||
export function addBusSalaryDetails(data: object) {
|
||||
return request({
|
||||
url: '/zm/api/v1/system/busSalaryDetails/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
// 修改员工工资考核记录
|
||||
export function updateBusSalaryDetails(data: object) {
|
||||
return request({
|
||||
url: '/zm/api/v1/system/busSalaryDetails/edit',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
// 删除员工工资考核记录
|
||||
export function delBusSalaryDetails(ids: number[]) {
|
||||
return request({
|
||||
url: '/zm/api/v1/system/busSalaryDetails/delete',
|
||||
method: 'delete',
|
||||
data: {
|
||||
ids: ids
|
||||
}
|
||||
});
|
||||
}
|
||||
// 根据身份证获取当前考勤记录明细
|
||||
export function getByIdDetail(params) {
|
||||
return request({
|
||||
url: '/zm/api/v1/system/busSalaryDetails/getByIdDetail',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
// 工资条获取(可根据项目or班组or施工人员)
|
||||
export function salarySheet(params) {
|
||||
return request({
|
||||
url: '/zm/api/v1/system/busSalaryDetails/salarySheet',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
@ -75,3 +75,12 @@ export const delProjectTeam = (ids: string | number | Array<string | number>) =>
|
||||
params: { ids }
|
||||
});
|
||||
};
|
||||
|
||||
// 根据项目或班组导出出勤记录(班组)
|
||||
export function exportSalary(data: any) {
|
||||
return request({
|
||||
url: '/zm/api/v1/system/busConstructionUser/exportSalary',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ export const updateViolationLevel = (data: ViolationLevelForm) => {
|
||||
* @param id
|
||||
*/
|
||||
export const delViolationLevel = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
return request1({
|
||||
url: '/zm/api/v1/system/busViolationLevel/delete',
|
||||
method: 'delete',
|
||||
data: { ids: id }
|
||||
|
427
src/components/bigUploader/index.vue
Normal file
427
src/components/bigUploader/index.vue
Normal file
@ -0,0 +1,427 @@
|
||||
<template>
|
||||
<div class="uploader-container" v-show="panelShow">
|
||||
<div class="header">
|
||||
<span>文件列表</span>
|
||||
<span class="shrink" @click="closeHandle">
|
||||
<el-icon style="vertical-align: middle"><DArrowRight /></el-icon>
|
||||
</span>
|
||||
</div>
|
||||
<div class="box">
|
||||
<uploader
|
||||
ref="uploaderRef"
|
||||
:options="options"
|
||||
:file-status-text="handleFileStatusText"
|
||||
:autoStart="true"
|
||||
@file-added="onFileAdded"
|
||||
@file-success="onFileSuccess"
|
||||
@file-progress="onFileProgress"
|
||||
@file-error="onFileError"
|
||||
class="uploader-example"
|
||||
>
|
||||
<uploader-unsupport></uploader-unsupport>
|
||||
<div v-show="false">
|
||||
<uploader-btn ref="uploadBtn" :attrs="all">选择文件</uploader-btn>
|
||||
<!-- <uploader-btn :attrs="image">选择图片</uploader-btn>
|
||||
<uploader-btn :directory="true">选择文件夹</uploader-btn> -->
|
||||
</div>
|
||||
<uploader-list>
|
||||
<template v-slot="props">
|
||||
<ul class="file-list">
|
||||
<li v-for="file in props.fileList" :key="file.id">
|
||||
<uploader-file :ref="'file_' + file.id" :class="'file_' + file.id" :file="file" :list="true"></uploader-file>
|
||||
</li>
|
||||
<div class="no-file" v-if="!props.fileList.length">暂无待上传文件</div>
|
||||
</ul>
|
||||
</template>
|
||||
</uploader-list>
|
||||
</uploader>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SparkMD5 from 'spark-md5';
|
||||
import axios from 'axios';
|
||||
import { bigUpload } from '@/store/modules/bigUpload';
|
||||
const stores = bigUpload();
|
||||
import { ElMessage, ElLoading } from 'element-plus';
|
||||
const instance = axios.create({
|
||||
baseURL: '',
|
||||
timeout: 1000 * 60 * 60 * 24
|
||||
});
|
||||
import sign from '@/utils/sign.js';
|
||||
import { getGoToken } from '@/utils/auth';
|
||||
const BASE_URL = 'http://58.17.134.85:8919';
|
||||
const acceptConfig = ['.zip', '.rar']; //文件
|
||||
// const acceptConfig = {
|
||||
// // image: ['gif', 'jpg', 'jpeg', 'png', 'bmp', 'webp'],
|
||||
// // video: ['mp4', 'm3u8', 'rmvb', 'avi', 'swf', '3gp', 'mkv', 'flv'],
|
||||
// // audio: ['mp3', 'wav', 'wma', 'ogg', 'aac', 'flac'],
|
||||
// // document: ['doc', 'txt', 'docx', 'pages', 'epub', 'pdf', 'numbers', 'csv', 'xls', 'xlsx', 'keynote', 'ppt', 'pptx', 'zip'],
|
||||
// // document: ['.zip', '.rar'],
|
||||
// // all() {
|
||||
// // return [...this.document];
|
||||
// // },
|
||||
// };
|
||||
export default {
|
||||
name: 'bigUploader',
|
||||
data() {
|
||||
return {
|
||||
options: {
|
||||
target: BASE_URL + '/zm/api/v1/system/bigUpload/upload', // 目标上传 URL(线上不加baseURL)
|
||||
chunkSize: '2048000', // 分片大小
|
||||
fileParameterName: 'upfile', //上传文件时文件的参数名,默认 file
|
||||
maxChunkRetries: 3, //最大自动失败重试上传次数
|
||||
testChunks: true, //是否开启服务器分片校验
|
||||
// 服务器分片校验函数,秒传及断点续传基础
|
||||
// 可选的函数用于根据 XHR 响应内容检测每个块是否上传成功了,传入的参数是:Uploader.Chunk 实例以及请求响应信息。
|
||||
// 这样就没必要上传(测试)所有的块了
|
||||
checkChunkUploadedByResponse: function (chunk, message) {
|
||||
// try {
|
||||
// let objMessage = JSON.parse(message);
|
||||
// const { code, data } = objMessage;
|
||||
// console.log(code);
|
||||
// if (code === 0) {
|
||||
// if (data.skipUpload) {
|
||||
// return true;
|
||||
// }
|
||||
// console.log((data.uploaded || []).indexOf(chunk.offset + 1));
|
||||
// return (data.uploaded || []).indexOf(chunk.offset + 1) >= 0;
|
||||
// }
|
||||
// } catch (e) {
|
||||
// console.error(e);
|
||||
// }
|
||||
return false;
|
||||
},
|
||||
headers: {
|
||||
Authorization: null
|
||||
},
|
||||
query: (file, chunk) => {
|
||||
return {
|
||||
...file.params
|
||||
};
|
||||
}
|
||||
},
|
||||
image: {
|
||||
accept: 'image/*'
|
||||
},
|
||||
all: {
|
||||
accept: []
|
||||
},
|
||||
statusText: {
|
||||
success: '成功了',
|
||||
error: '出错了',
|
||||
uploading: '上传中',
|
||||
paused: '暂停中',
|
||||
waiting: '等待中'
|
||||
},
|
||||
uploadType: '', //
|
||||
uploadTypesList: [
|
||||
// 上传区分 安全考试
|
||||
{ id: 1000, label: '安全考试上传' },
|
||||
{ id: 1001, label: '工资资料上传' },
|
||||
{ id: 1002, label: '工资资料模板上传' },
|
||||
{ id: 1003, label: '竣工图上传' },
|
||||
{ id: 1003, label: '竣工图上传' },
|
||||
{ id: 1004, label: '倾斜模板上传' },
|
||||
{ id: 1005, label: '员工资料上传' },
|
||||
{ id: 1006, label: '可研及专题报告' },
|
||||
{ id: 1007, label: '施工图' },
|
||||
{ id: 10000, label: '大文件上传' },
|
||||
{ id: 1008, label: '质量会议上传' },
|
||||
{ id: 1010, label: '安全会议上传' }
|
||||
],
|
||||
acceptList: [], //需要上传的类型
|
||||
uploadTypes: ''
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
console.log('挂载', getGoToken());
|
||||
|
||||
this.mittBus.on('bigUploader.uploadFile', this.uploadFile);
|
||||
});
|
||||
},
|
||||
computed: {
|
||||
panelShow() {
|
||||
return stores.panelShow;
|
||||
},
|
||||
uploadBtn() {
|
||||
return this.$refs.uploadBtn && this.$refs.uploadBtn.btn;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openHandle() {
|
||||
stores.setPanelShow(true);
|
||||
},
|
||||
closeHandle() {
|
||||
this.$refs.uploaderRef.uploader.files = [];
|
||||
this.$refs.uploaderRef.uploader.fileList = [];
|
||||
stores.setPanelShow(false);
|
||||
},
|
||||
uploadFile(obj) {
|
||||
this.uploadType = obj.type;
|
||||
this.uploadTypes = obj.types;
|
||||
if (!this.options.headers.Authorization) {
|
||||
this.options.headers.Authorization = 'Bearer ' + getGoToken();
|
||||
}
|
||||
// 修改accept值
|
||||
if (this.uploadBtn) {
|
||||
this.uploadBtn.querySelector('input').accept = obj.accept;
|
||||
}
|
||||
if (this.uploadBtn) {
|
||||
this.$nextTick(() => {
|
||||
this.uploadBtn.click();
|
||||
});
|
||||
}
|
||||
},
|
||||
handleFileStatusText(status, response) {
|
||||
if (status === 'success') {
|
||||
const { code, data } = response;
|
||||
if (code === 0 && data.needMerge === true) {
|
||||
return '文件合并中...';
|
||||
} else {
|
||||
return this.statusText[status];
|
||||
}
|
||||
} else {
|
||||
return this.statusText[status];
|
||||
}
|
||||
},
|
||||
//上传过程中出错了
|
||||
onFileError(rootFile, file, response, chunk) {
|
||||
console.error(rootFile, file, response, chunk);
|
||||
},
|
||||
// 设置自定义状态
|
||||
setStatus(id, text) {
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs['file_' + id]) {
|
||||
const el = this.$refs['file_' + id][0].$el.getElementsByClassName('uploader-file-status')[0].getElementsByTagName('span')[0];
|
||||
const parent = el.parentNode;
|
||||
const para = document.createElement('span');
|
||||
para.appendChild(document.createTextNode(text));
|
||||
para.className = 'para';
|
||||
el.style.display = 'none';
|
||||
parent.appendChild(para);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 删除自定义状态
|
||||
removeStatus(id) {
|
||||
try {
|
||||
const els = this.$refs['file_' + id][0].$el.getElementsByClassName('uploader-file-status')[0].getElementsByClassName('para');
|
||||
if (els && els.length > 0) {
|
||||
const parent = els[0].parentNode;
|
||||
for (let i = 0; i < els.length; i++) {
|
||||
parent.removeChild(els[i]);
|
||||
}
|
||||
}
|
||||
const firstSpan = this.$refs['file_' + id][0].$el.getElementsByClassName('uploader-file-status')[0].getElementsByTagName('span')[0];
|
||||
firstSpan.style.display = '';
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
},
|
||||
/**
|
||||
文件上传成功事件
|
||||
第一个参数 rootFile 就是成功上传的文件所属的根 Uploader.File 对象,它应该包含或者等于成功上传文件;
|
||||
第二个参数 file 就是当前成功的 Uploader.File 对象本身;
|
||||
第三个参数 message 就是服务端响应内容,永远都是字符串;
|
||||
第四个参数 chunk 就是 Uploader.Chunk 实例, 它就是该文件的最后一个块实例,如果你想得到请求响应码的话,chunk.xhr.status 就是。
|
||||
*/
|
||||
onFileSuccess(rootFile, file, response, chunk) {
|
||||
try {
|
||||
let res = JSON.parse(response);
|
||||
const { code, data } = res;
|
||||
if (code === 0) {
|
||||
// 如果服务端返回需要合并
|
||||
if (data.needMerge) {
|
||||
// 文件合并操作
|
||||
let obj = {
|
||||
identifier: data.identifier,
|
||||
totalChunks: data.totalChunks,
|
||||
totalSize: data.totalSize,
|
||||
filename: data.filename,
|
||||
token: getGoToken()
|
||||
};
|
||||
if (this.uploadType) {
|
||||
//后台需要的参数
|
||||
obj.num = '1'.toString();
|
||||
}
|
||||
if (this.uploadType == 3 || this.uploadType == 100 || this.uploadType == 101 || this.uploadType == 102) {
|
||||
//后台需要的参数
|
||||
obj.num = '2'.toString();
|
||||
}
|
||||
let header = {
|
||||
Authorization: 'Bearer ' + getGoToken(),
|
||||
...sign(obj)
|
||||
};
|
||||
// 请求合并
|
||||
instance
|
||||
.post('/zm/api/v1/system/bigUpload/uploadMerge', obj, {
|
||||
headers: header
|
||||
})
|
||||
.then((res) => {
|
||||
const { status, data } = res;
|
||||
return data;
|
||||
})
|
||||
.then((res) => {
|
||||
let { code, data } = res;
|
||||
if (code === 0) {
|
||||
this.setStatus(file.id, this.statusText['success']);
|
||||
this.setMittBus(data, file);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 不需要合并
|
||||
// 秒传或普通上传
|
||||
this.setMittBus(data, file);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
},
|
||||
// 返回响应请求
|
||||
setMittBus(data, file) {
|
||||
let index = '';
|
||||
this.uploadTypesList.forEach((item) => {
|
||||
if (item.id == this.uploadTypes) {
|
||||
index = this.uploadTypes;
|
||||
}
|
||||
});
|
||||
console.log(data);
|
||||
console.log(file);
|
||||
this.mittBus.emit('bigUploader.uploadFileSuccess' + index, { ...data, fileType: file.fileType });
|
||||
},
|
||||
// 一个文件在上传中
|
||||
onFileProgress(rootFile, file, chunk) {
|
||||
// 上传过程中
|
||||
// console.log(`上传中 ${file.name},chunk:${chunk.startByte / 1024 / 1024} ~ ${chunk.endByte / 1024 / 1024}`);
|
||||
},
|
||||
// 这个事件一般用作文件校验,如果说返回了 false,那么这个文件就会被忽略,不会添加到文件上传列表中。
|
||||
onFileAdded(file) {
|
||||
this.computeMD5(file);
|
||||
// 将额外的参数赋值到每个文件上,解决了不同文件使用不同params的需求
|
||||
if (this.uploadType) {
|
||||
//后台需要的参数
|
||||
let num = '1'.toString();
|
||||
if (this.uploadType == 3) {
|
||||
//后台需要的参数
|
||||
num = '2'.toString();
|
||||
} else if (this.uploadType == 100 || this.uploadType == 101 || this.uploadType == 102) {
|
||||
//竣工图文件上传
|
||||
num = '2'.toString();
|
||||
}
|
||||
file.params = { ...this.params, num };
|
||||
} else {
|
||||
file.params = { ...this.params };
|
||||
}
|
||||
this.openHandle();
|
||||
},
|
||||
computeMD5(file) {
|
||||
let fileReader = new FileReader();
|
||||
let time = new Date().getTime();
|
||||
let blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;
|
||||
// 分片序号
|
||||
let currentChunk = 0;
|
||||
// 分片大小
|
||||
const chunkSize = 10 * 1024 * 1000;
|
||||
// 分片总数量
|
||||
let chunks = Math.ceil(file.size / chunkSize);
|
||||
let spark = new SparkMD5.ArrayBuffer();
|
||||
this.setStatus(file.id, 'md5计算中');
|
||||
file.pause();
|
||||
loadNext();
|
||||
fileReader.onload = (e) => {
|
||||
spark.append(e.target.result);
|
||||
if (currentChunk < chunks) {
|
||||
currentChunk++;
|
||||
loadNext();
|
||||
// 实时展示MD5的计算进度
|
||||
this.$nextTick(() => {
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: '正在文件检验中……',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
if (((currentChunk / chunks) * 100).toFixed(0) == 100) {
|
||||
loading.close();
|
||||
}
|
||||
// console.log('校验MD5 ' + ((currentChunk / chunks) * 100).toFixed(0) + '%');
|
||||
});
|
||||
} else {
|
||||
let md5 = spark.end();
|
||||
this.computeMD5Success(md5, file);
|
||||
this.removeStatus(file.id);
|
||||
// console.log(`MD5计算完毕:${file.name} \nMD5:${md5} \n分片:${chunks} 大小:${file.size} 用时:${new Date().getTime() - time} ms`);
|
||||
}
|
||||
};
|
||||
fileReader.onerror = function () {
|
||||
// console.error();
|
||||
ElMessage.error(`文件${file.name}读取出错,请检查该文件`);
|
||||
file.cancel();
|
||||
};
|
||||
function loadNext() {
|
||||
let start = currentChunk * chunkSize;
|
||||
let end = start + chunkSize >= file.size ? file.size : start + chunkSize;
|
||||
fileReader.readAsArrayBuffer(blobSlice.call(file.file, start, end));
|
||||
}
|
||||
},
|
||||
// md5 计算完毕
|
||||
computeMD5Success(md5, file) {
|
||||
file.uniqueIdentifier = md5;
|
||||
file.resume();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.uploader-min {
|
||||
background-color: #fff;
|
||||
z-index: 9999;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 10px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
|
||||
padding: 15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.uploader-container {
|
||||
background-color: #fff;
|
||||
z-index: 9999;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 10px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.header {
|
||||
background-color: #fff;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
display: flex;
|
||||
padding: 0 10px;
|
||||
justify-content: space-between;
|
||||
.shrink {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.box {
|
||||
max-height: 200px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.uploader-example {
|
||||
width: 550px;
|
||||
padding: 15px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.uploader-example .uploader-btn {
|
||||
margin-right: 4px;
|
||||
}
|
||||
.uploader-example .uploader-list {
|
||||
overflow-x: hidden;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
</style>
|
@ -61,6 +61,7 @@ setLocal('dockSocketUrl', 'ws://58.17.134.85:9512/websocket');
|
||||
ElDialog.props.closeOnClickModal.default = false;*/
|
||||
// **main.js**
|
||||
import { vue3ScrollSeamless } from 'vue3-scroll-seamless';
|
||||
import uploader from 'vue-simple-uploader';
|
||||
import bus from './utils/bus';
|
||||
import $message from '@/plugins/modal';
|
||||
|
||||
@ -74,6 +75,8 @@ app.use(print);
|
||||
app.use(i18n);
|
||||
app.use(VXETable);
|
||||
app.use(plugins);
|
||||
app.use(uploader);
|
||||
|
||||
app.use(bus);
|
||||
app.component('vue3ScrollSeamless', vue3ScrollSeamless);
|
||||
// 自定义指令
|
||||
|
@ -45,7 +45,9 @@ export const usePermissionStore = defineStore('permission', () => {
|
||||
sidebarRouters.value = routes;
|
||||
};
|
||||
const generateRoutes = async (): Promise<RouteRecordRaw[]> => {
|
||||
const res = await getRouters(useUserStoreHook().selectedProject?.id || '0');
|
||||
const id = useUserStoreHook().selectedProject ? useUserStoreHook().selectedProject.id : '0';
|
||||
console.log('🚀 ~ generateRoutes ~ useUserStoreHook().selectedProject?.id:', id);
|
||||
const res = await getRouters(id);
|
||||
const { data } = res;
|
||||
const sdata = JSON.parse(JSON.stringify(data));
|
||||
const rdata = JSON.parse(JSON.stringify(data));
|
||||
|
@ -10,6 +10,10 @@ export const setToken = (access_token: string) => (tokenStorage.value = access_t
|
||||
|
||||
export const removeToken = () => (tokenStorage.value = null);
|
||||
|
||||
export const getGoToken = () => {
|
||||
return getLocal('goToken');
|
||||
};
|
||||
|
||||
export const getDockSocketUrl = () => {
|
||||
return getLocal('dockSocketUrl');
|
||||
};
|
||||
|
212
src/utils/exportExcel.ts
Normal file
212
src/utils/exportExcel.ts
Normal file
@ -0,0 +1,212 @@
|
||||
import { exportSalary } from '@/api/project/projectTeam';
|
||||
import { exportDataToExcel } from '@/utils/exportDataToExcel.js';
|
||||
|
||||
export function useExcelExport() {
|
||||
// 数据整合函数
|
||||
const exportConfig = (obj, proxy, times) => {
|
||||
// 如果导出前要处理数据,需要深克隆一份表格数据,然后进行处理
|
||||
let time = proxy.parseTime(new Date(times), '{y}年{m}月'); // 当前年月
|
||||
let header1 = ['建筑施工企业现场人员考勤表(' + time + ')'];
|
||||
let projectName = '项目部名称:' + obj.projectName;
|
||||
let teamName = '班组类别:' + obj.teamName;
|
||||
let header2 = [];
|
||||
let header3 = [projectName + ' ' + teamName];
|
||||
const header = ['序号', '姓名/日期', '身份证号'];
|
||||
let columnsWidth = [6, 10, 26]; // 表格宽度
|
||||
let obj1 = { index: '', name: '', identity_card: '' };
|
||||
let fields = ['index', 'row', 'identity_card'];
|
||||
|
||||
// 计算当前月天数
|
||||
let years = times.split('-')[0];
|
||||
let month = times.split('-')[1];
|
||||
let listLength = new Date(years, month, 0).getDate();
|
||||
|
||||
for (let index = 0; index < listLength; index++) {
|
||||
obj1['day' + index] = '';
|
||||
fields.push('day' + index);
|
||||
header.push(index + 1);
|
||||
columnsWidth.push(4);
|
||||
}
|
||||
|
||||
header.push('合计');
|
||||
fields.push('sum');
|
||||
header.push('是否离场');
|
||||
fields.push('type');
|
||||
header.push('签字');
|
||||
fields.push('sign');
|
||||
|
||||
// 上方共用
|
||||
let data = [];
|
||||
if (!(obj.team && obj.team.length)) return;
|
||||
|
||||
obj.team.forEach((item, index) => {
|
||||
let obj = { row: '', index: '', identity_card: '' };
|
||||
|
||||
for (let key in item.attendance) {
|
||||
let j = parseInt(key.split('-')[2]) - 1;
|
||||
obj['day' + j] = item.attendance[key];
|
||||
}
|
||||
|
||||
obj.row = item.row;
|
||||
obj.index = index + 1;
|
||||
obj.identity_card = item.identity_card;
|
||||
|
||||
let start = ''; // 从表格那一列哪一行开始
|
||||
let end = ''; // 从表格那一列哪一行结束
|
||||
let cols = 5 + index; // 行数
|
||||
start = 'D' + cols;
|
||||
|
||||
// 判断当月天数 获取表格中最后一天的列标识
|
||||
if (listLength == 28) {
|
||||
end = 'AE' + cols;
|
||||
} else if (listLength == 29) {
|
||||
end = 'AF' + cols;
|
||||
} else if (listLength == 30) {
|
||||
end = 'AG' + cols;
|
||||
} else {
|
||||
end = 'AH' + cols;
|
||||
}
|
||||
|
||||
obj.sum = { formula: 'SUM(' + start + ':' + end + ')', result: 0 };
|
||||
obj.sign = '';
|
||||
obj.type = item.type ? '离场' : '未离场';
|
||||
data.push(obj);
|
||||
});
|
||||
|
||||
const merges = [
|
||||
// 单元格合并
|
||||
{ row: 0, col: 0, rowspan: 1, colspan: listLength + 5 },
|
||||
{ row: 2, col: 0, rowspan: 1, colspan: listLength + 5 },
|
||||
{ row: obj.team.length + 5, col: 0, rowspan: 1, colspan: 3 },
|
||||
{ row: obj.team.length + 5, col: 3, rowspan: 1, colspan: 10 },
|
||||
{ row: obj.team.length + 5, col: 13, rowspan: 1, colspan: 10 },
|
||||
{ row: obj.team.length + 5, col: 23, rowspan: 1, colspan: 10 }
|
||||
];
|
||||
|
||||
data.push({});
|
||||
// 表格尾部标题
|
||||
data.push({
|
||||
index: '制表人:',
|
||||
day0: '班组负责人',
|
||||
day10: '项目负责人',
|
||||
day20: '制表日期'
|
||||
});
|
||||
data.push({
|
||||
index: '注:',
|
||||
row: '1、本考勤表必须按照每日实际工时进行填写;'
|
||||
});
|
||||
data.push({
|
||||
row: '2、本考勤表作为工资计发的重要依据。'
|
||||
});
|
||||
|
||||
const config = {
|
||||
data,
|
||||
fields,
|
||||
headers: [header1, header2, header3, header],
|
||||
merges,
|
||||
attrs: [],
|
||||
view: [],
|
||||
columnsWidth,
|
||||
sheetName: obj.teamName
|
||||
};
|
||||
|
||||
// 设置全表单元格边框,居中布局
|
||||
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' }
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 设置表头字体加粗
|
||||
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' }
|
||||
}
|
||||
});
|
||||
|
||||
return config;
|
||||
};
|
||||
|
||||
// 导出函数
|
||||
const exportExcel = async (obj, proxy, name = undefined) => {
|
||||
try {
|
||||
const res = await exportSalary(obj);
|
||||
|
||||
if (res.code === 0 && res.data.AttendanceAllOne) {
|
||||
let config = [];
|
||||
let AttendanceAllOne = res.data.AttendanceAllOne;
|
||||
|
||||
// 处理每个表格
|
||||
AttendanceAllOne.forEach((item) => {
|
||||
let datas = exportConfig(item, proxy, obj.years);
|
||||
if (datas) {
|
||||
config.push(datas);
|
||||
}
|
||||
});
|
||||
|
||||
// 获取项目名
|
||||
let projectName = '';
|
||||
if (name) {
|
||||
projectName = res.data.AttendanceAllOne[0].projectName + '-' + name;
|
||||
} else {
|
||||
projectName = res.data.AttendanceAllOne[0].projectName;
|
||||
}
|
||||
|
||||
let year = obj.years.split('-')[0];
|
||||
let month = obj.years.split('-')[1];
|
||||
|
||||
// 导出Excel
|
||||
exportDataToExcel(config, `${projectName}-${year}年${month}月考勤表.xlsx`);
|
||||
} else if (res.code === 0) {
|
||||
ElMessage({
|
||||
message: '暂无考勤数据',
|
||||
type: 'warning'
|
||||
});
|
||||
} else {
|
||||
ElMessage({
|
||||
message: res.message || '导出失败',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
ElMessage({
|
||||
message: '导出过程出错',
|
||||
type: 'error'
|
||||
});
|
||||
console.error('Excel导出错误:', error);
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
exportConfig,
|
||||
exportExcel
|
||||
};
|
||||
}
|
@ -3,8 +3,8 @@
|
||||
<div class="move_pop" id="detial_pop">
|
||||
<!-- <span>{{ title }}</span> -->
|
||||
<div class="box">
|
||||
<img v-if="type == 2" src="../icon/suo.png" @click="onFull(1)" />
|
||||
<img v-else src="../icon/full.png" @click="onFull(2)" />
|
||||
<img v-if="type == 2" src="/image/suo.png" @click="onFull(1)" />
|
||||
<img v-else src="/image/full.png" @click="onFull(2)" />
|
||||
<span class="close" @click="onClose">✖</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -3,8 +3,8 @@
|
||||
<div class="move_pop" id="detial_edit">
|
||||
<!-- <span>{{ title }}</span> -->
|
||||
<div class="box">
|
||||
<img v-if="type == 2" src="../icon/full.png" @click="onFull(1)" />
|
||||
<img v-else src="../icon/suo.png" @click="onFull(2)" />
|
||||
<img v-if="type == 2" src="/image/full.png" @click="onFull(1)" />
|
||||
<img v-else src="/image/suo.png" @click="onFull(2)" />
|
||||
<span class="close" @click="onClose">✖</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -47,6 +47,11 @@
|
||||
</el-row> -->
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<span>
|
||||
<el-button type="primary" icon="MessageBox" @click="onExport">导出考勤列表</el-button>
|
||||
</span>
|
||||
</template>
|
||||
<el-table v-loading="loading" :data="attendanceList">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="人员姓名" align="center" prop="UserName" />
|
||||
@ -99,6 +104,16 @@
|
||||
</template>
|
||||
</el-calendar>
|
||||
</el-dialog>
|
||||
<el-dialog title="导出考勤列表" width="30%" v-model="exportDialogVisible">
|
||||
<el-form :model="exportForm" :rules="rules" ref="formRef" label-width="90px">
|
||||
<el-form-item label="导出时间" prop="years">
|
||||
<el-date-picker v-model="exportForm.years" type="month" value-format="YYYY-MM" placeholder="请选择导出时间" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button type="primary" @click="onSubmit">导出</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -115,10 +130,12 @@ import { pcSelectBelowProjectOfPersonnel, getSysProjectTeamList, pcCollectDataFo
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { type_of_work } = toRefs<any>(proxy?.useDict('clock_status_type', 'type_of_work'));
|
||||
import type { CalendarInstance } from 'element-plus';
|
||||
import { useExcelExport } from '@/utils/exportExcel';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const exportDialogVisible = ref(false);
|
||||
|
||||
const attendanceList = ref<AttendanceVO[]>([]);
|
||||
const attendanceTwoWeekList = ref<AttendanceTwoWeekVO[]>([]);
|
||||
@ -138,7 +155,15 @@ const dialog = reactive<DialogOption>({
|
||||
title: ''
|
||||
});
|
||||
const echartsOption = ref<any>({});
|
||||
const initFormData: AttendanceForm = {
|
||||
const exportForm = reactive({
|
||||
fuzzyQuery: undefined,
|
||||
typeOfWork: undefined,
|
||||
teamId: undefined,
|
||||
projectId: currentProject.value.goId,
|
||||
years: undefined,
|
||||
dateStr: undefined
|
||||
});
|
||||
const initFormData: any = {
|
||||
id: undefined,
|
||||
userId: undefined,
|
||||
facePic: undefined,
|
||||
@ -157,26 +182,23 @@ const initFormData: AttendanceForm = {
|
||||
typeOfWork: undefined,
|
||||
teamId: undefined
|
||||
};
|
||||
const data = reactive<PageData<AttendanceForm, AttendanceQuery>>({
|
||||
const data = reactive<PageData<AttendanceForm, any>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userName: undefined,
|
||||
dateStr: undefined,
|
||||
clockStatus: undefined,
|
||||
commuter: undefined,
|
||||
fuzzyQuery: undefined,
|
||||
projectId: currentProject.value.goId,
|
||||
typeOfWork: undefined,
|
||||
teamId: undefined,
|
||||
params: {}
|
||||
teamId: undefined
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }],
|
||||
userId: [{ required: true, message: '人员id不能为空', trigger: 'blur' }],
|
||||
facePic: [{ required: true, message: '人脸照不能为空', trigger: 'blur' }],
|
||||
projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }],
|
||||
dateStr: [{ required: true, message: '打卡日期不能为空', trigger: 'blur' }],
|
||||
years: [{ required: true, message: '导出时间不能为空', trigger: 'blur' }],
|
||||
clockStatus: [{ required: true, message: '1正常,2迟到,3早退,4缺勤,5补卡不能为空', trigger: 'change' }]
|
||||
}
|
||||
});
|
||||
@ -315,6 +337,14 @@ const handleDetails = async (row?: AttendanceVO) => {
|
||||
dialog.title = row?.userName || '';
|
||||
};
|
||||
|
||||
const onExport = () => {
|
||||
exportDialogVisible.value = true;
|
||||
exportForm.teamId = queryParams.value.teamId;
|
||||
exportForm.projectId = queryParams.value.projectId as string;
|
||||
exportForm.typeOfWork = queryParams.value.typeOfWork;
|
||||
exportForm.fuzzyQuery = queryParams.value.fuzzyQuery;
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
attendanceFormRef.value?.validate(async (valid: boolean) => {
|
||||
@ -341,6 +371,18 @@ const init = () => {
|
||||
handleQuery();
|
||||
});
|
||||
};
|
||||
const formRef = ref<HTMLElement | null>(null);
|
||||
const onSubmit = () => {
|
||||
const formWrap = unref(formRef) as any;
|
||||
if (!formWrap) return;
|
||||
formWrap.validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
exportForm.dateStr = exportForm.years;
|
||||
console.log('🚀 ~ onSubmit ~ exportForm:', exportForm);
|
||||
useExcelExport().exportExcel(exportForm, proxy, '考勤列表');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
|
169
src/views/project/busSalaryDetails/component/add.vue
Normal file
169
src/views/project/busSalaryDetails/component/add.vue
Normal file
@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<div class="system-busSalaryDetails-add">
|
||||
<!-- 添加或修改员工工资考核记录对话框 -->
|
||||
<el-dialog v-model="isShowDialog" width="600px" :close-on-click-modal="false" :destroy-on-close="true">
|
||||
<template #header>
|
||||
<div v-drag="['.system-busSalaryDetails-add .el-dialog', '.system-busSalaryDetails-add .el-dialog__header']">添加员工工资考核记录</div>
|
||||
</template>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="90px">
|
||||
<el-row>
|
||||
<el-col :span="16">
|
||||
<el-form-item label="户名" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入户名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="身份证" prop="sfzNumber">
|
||||
<el-input v-model="formData.sfzNumber" placeholder="请输入身份证" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="账户" prop="account">
|
||||
<el-input v-model="formData.account" placeholder="请输入账户" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="当月总时长" prop="sumDuration">
|
||||
<el-input v-model="formData.sumDuration" type="number" placeholder="请输入当月总时长" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="薪水(天)" prop="salary"> <el-input v-model="formData.salary" placeholder="请输入薪水(天)" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目" prop="projectId"> <el-input v-model="formData.projectId" placeholder="请输入项目" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班组" prop="teamId"> <el-input v-model="formData.teamId" placeholder="请输入班组" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发放年月" prop="dateOfIssue"> <el-input v-model="formData.dateOfIssue" placeholder="请输入发放年月" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="制表人" prop="lister"> <el-input v-model="formData.lister" placeholder="请输入制表人" /> </el-form-item
|
||||
></el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="onSubmit">确 定</el-button>
|
||||
<el-button @click="onCancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { reactive, toRefs, defineComponent, ref, unref, getCurrentInstance } from 'vue';
|
||||
import { ElMessageBox, ElMessage, FormInstance, UploadProps } from 'element-plus';
|
||||
import {
|
||||
listBusSalaryDetails,
|
||||
getBusSalaryDetails,
|
||||
delBusSalaryDetails,
|
||||
addBusSalaryDetails,
|
||||
updateBusSalaryDetails
|
||||
} from '@/api/project/busSalaryDetails';
|
||||
import { BusSalaryDetailsTableColumns, BusSalaryDetailsInfoData, BusSalaryDetailsTableDataState, BusSalaryDetailsEditState } from './model';
|
||||
export default defineComponent({
|
||||
name: 'apiV1SystemBusSalaryDetailsEdit',
|
||||
components: {},
|
||||
props: {},
|
||||
setup(props, { emit }) {
|
||||
const { proxy } = <any>getCurrentInstance();
|
||||
const formRef = ref<HTMLElement | null>(null);
|
||||
const menuRef = ref();
|
||||
const state = reactive<BusSalaryDetailsEditState>({
|
||||
loading: false,
|
||||
isShowDialog: false,
|
||||
formData: {
|
||||
id: undefined,
|
||||
sfzNumber: undefined,
|
||||
name: undefined,
|
||||
account: undefined,
|
||||
sumDuration: undefined,
|
||||
salary: undefined,
|
||||
projectId: undefined,
|
||||
teamId: undefined,
|
||||
projectName: undefined,
|
||||
teamName: undefined,
|
||||
dateOfIssue: undefined,
|
||||
lister: undefined,
|
||||
createdAt: undefined,
|
||||
updatedAt: undefined,
|
||||
deletedAt: undefined
|
||||
},
|
||||
// 表单校验
|
||||
rules: {}
|
||||
});
|
||||
// 打开弹窗
|
||||
const openDialog = () => {
|
||||
resetForm();
|
||||
state.isShowDialog = true;
|
||||
};
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
state.isShowDialog = false;
|
||||
};
|
||||
// 取消
|
||||
const onCancel = () => {
|
||||
closeDialog();
|
||||
};
|
||||
// 提交
|
||||
const onSubmit = () => {
|
||||
const formWrap = unref(formRef) as any;
|
||||
if (!formWrap) return;
|
||||
formWrap.validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
state.loading = true;
|
||||
//添加
|
||||
addBusSalaryDetails(state.formData)
|
||||
.then(() => {
|
||||
ElMessage.success('添加成功');
|
||||
closeDialog(); // 关闭弹窗
|
||||
emit('busSalaryDetailsList');
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
const resetForm = () => {
|
||||
state.formData = {
|
||||
id: undefined,
|
||||
sfzNumber: undefined,
|
||||
name: undefined,
|
||||
account: undefined,
|
||||
sumDuration: undefined,
|
||||
salary: undefined,
|
||||
projectId: undefined,
|
||||
teamId: undefined,
|
||||
projectName: undefined,
|
||||
teamName: undefined,
|
||||
dateOfIssue: undefined,
|
||||
lister: undefined,
|
||||
createdAt: undefined,
|
||||
updatedAt: undefined,
|
||||
deletedAt: undefined
|
||||
};
|
||||
};
|
||||
return {
|
||||
proxy,
|
||||
openDialog,
|
||||
closeDialog,
|
||||
onCancel,
|
||||
onSubmit,
|
||||
menuRef,
|
||||
formRef,
|
||||
...toRefs(state)
|
||||
};
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
//
|
||||
.system-busSalaryDetails-add {
|
||||
.el-col {
|
||||
margin: 10px 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
102
src/views/project/busSalaryDetails/component/detail.vue
Normal file
102
src/views/project/busSalaryDetails/component/detail.vue
Normal file
@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<!-- 员工工资考核记录详情抽屉 -->
|
||||
<div class="system-busSalaryDetails-detail">
|
||||
<el-drawer v-model="isShowDialog" size="40%" direction="ltr">
|
||||
<template #header>
|
||||
<h4>员工工资考核记录详情</h4>
|
||||
</template>
|
||||
<el-table v-loading="loading" :data="tableData">
|
||||
<el-table-column label="序号" align="center" type="index" width="60" />
|
||||
<el-table-column label="工作日期" align="center" min-width="100px">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.dateOfIssue + '-' + scope.row.working_date }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工作时长" align="center" prop="duration" min-width="100px" />
|
||||
<el-table-column label="发放年月" align="center" prop="dateOfIssue" min-width="100px" />
|
||||
</el-table>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { reactive, toRefs, defineComponent, ref, getCurrentInstance } from 'vue';
|
||||
import { getByIdDetail } from '@/api/project/busSalaryDetails';
|
||||
import { BusSalaryDetailsEditState } from './model';
|
||||
export default defineComponent({
|
||||
name: 'index',
|
||||
setup(props, { emit }) {
|
||||
const { proxy } = <any>getCurrentInstance();
|
||||
const formRef = ref<HTMLElement | null>(null);
|
||||
const menuRef = ref();
|
||||
const state = reactive<BusSalaryDetailsEditState>({
|
||||
loading: false,
|
||||
isShowDialog: false,
|
||||
formData: {
|
||||
sfzNumber: undefined,
|
||||
pageNum: 1,
|
||||
pageSize: 50
|
||||
},
|
||||
tableData: [], //考勤数据
|
||||
total: 0 //列表数量
|
||||
});
|
||||
// 打开弹窗
|
||||
const openDialog = (row) => {
|
||||
state.formData.pageNum = 1; //重置
|
||||
state.formData.sfzNumber = row.sfzNumber; //重置
|
||||
state.isShowDialog = true;
|
||||
getList();
|
||||
};
|
||||
// 获取列表
|
||||
const getList = () => {
|
||||
state.loading = true;
|
||||
getByIdDetail(state.formData).then((res: any) => {
|
||||
state.loading = false;
|
||||
if (res.code == 0 && res.data.list) {
|
||||
state.tableData = res.data.list.reverse();
|
||||
state.total = res.data.total;
|
||||
}
|
||||
});
|
||||
};
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
state.isShowDialog = false;
|
||||
};
|
||||
// 取消
|
||||
const onCancel = () => {
|
||||
closeDialog();
|
||||
};
|
||||
return {
|
||||
proxy,
|
||||
openDialog,
|
||||
closeDialog,
|
||||
onCancel,
|
||||
menuRef,
|
||||
getList,
|
||||
formRef,
|
||||
...toRefs(state)
|
||||
};
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
.system-busSalaryDetails-detail :deep(.el-form-item--large .el-form-item__label) {
|
||||
font-weight: bolder;
|
||||
}
|
||||
.pic-block {
|
||||
margin-right: 8px;
|
||||
}
|
||||
.file-block {
|
||||
width: 100%;
|
||||
border: 1px solid var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: var(--el-transition-duration-fast);
|
||||
margin-bottom: 5px;
|
||||
padding: 3px 6px;
|
||||
}
|
||||
.ml-2 {
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
146
src/views/project/busSalaryDetails/component/edit.vue
Normal file
146
src/views/project/busSalaryDetails/component/edit.vue
Normal file
@ -0,0 +1,146 @@
|
||||
<template>
|
||||
<div class="system-busSalaryDetails-edit">
|
||||
<!-- 添加或修改员工工资考核记录对话框 -->
|
||||
<el-dialog v-model="isShowDialog" width="769px" :close-on-click-modal="false" :destroy-on-close="true">
|
||||
<template #header>
|
||||
<div v-drag="['.system-busSalaryDetails-edit .el-dialog', '.system-busSalaryDetails-edit .el-dialog__header']">
|
||||
{{ (!formData.id || formData.id == 0 ? '添加' : '修改') + '员工工资考核记录' }}
|
||||
</div>
|
||||
</template>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="90px"> </el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="onSubmit">确 定</el-button>
|
||||
<el-button @click="onCancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { reactive, toRefs, defineComponent, ref, unref, getCurrentInstance } from 'vue';
|
||||
import { ElMessageBox, ElMessage, FormInstance, UploadProps } from 'element-plus';
|
||||
import {
|
||||
listBusSalaryDetails,
|
||||
getBusSalaryDetails,
|
||||
delBusSalaryDetails,
|
||||
addBusSalaryDetails,
|
||||
updateBusSalaryDetails
|
||||
} from '@/api/project/busSalaryDetails';
|
||||
import { BusSalaryDetailsTableColumns, BusSalaryDetailsInfoData, BusSalaryDetailsTableDataState, BusSalaryDetailsEditState } from './model';
|
||||
export default defineComponent({
|
||||
name: 'apiV1SystemBusSalaryDetailsEdit',
|
||||
components: {},
|
||||
props: {},
|
||||
setup(props, { emit }) {
|
||||
const { proxy } = <any>getCurrentInstance();
|
||||
const formRef = ref<HTMLElement | null>(null);
|
||||
const menuRef = ref();
|
||||
const state = reactive<BusSalaryDetailsEditState>({
|
||||
loading: false,
|
||||
isShowDialog: false,
|
||||
formData: {
|
||||
id: undefined,
|
||||
sfzNumber: undefined,
|
||||
name: undefined,
|
||||
account: undefined,
|
||||
sumDuration: undefined,
|
||||
salary: undefined,
|
||||
projectId: undefined,
|
||||
teamId: undefined,
|
||||
projectName: undefined,
|
||||
teamName: undefined,
|
||||
dateOfIssue: undefined,
|
||||
lister: undefined,
|
||||
createdAt: undefined,
|
||||
updatedAt: undefined,
|
||||
deletedAt: undefined
|
||||
},
|
||||
// 表单校验
|
||||
rules: {}
|
||||
});
|
||||
// 打开弹窗
|
||||
const openDialog = (row?: BusSalaryDetailsInfoData) => {
|
||||
resetForm();
|
||||
if (row) {
|
||||
getBusSalaryDetails(row.id!).then((res: any) => {
|
||||
const data = res.data;
|
||||
state.formData = data;
|
||||
});
|
||||
}
|
||||
state.isShowDialog = true;
|
||||
};
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
state.isShowDialog = false;
|
||||
};
|
||||
// 取消
|
||||
const onCancel = () => {
|
||||
closeDialog();
|
||||
};
|
||||
// 提交
|
||||
const onSubmit = () => {
|
||||
const formWrap = unref(formRef) as any;
|
||||
if (!formWrap) return;
|
||||
formWrap.validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
state.loading = true;
|
||||
if (!state.formData.id || state.formData.id === 0) {
|
||||
//添加
|
||||
addBusSalaryDetails(state.formData)
|
||||
.then(() => {
|
||||
ElMessage.success('添加成功');
|
||||
closeDialog(); // 关闭弹窗
|
||||
emit('busSalaryDetailsList');
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
} else {
|
||||
//修改
|
||||
updateBusSalaryDetails(state.formData)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功');
|
||||
closeDialog(); // 关闭弹窗
|
||||
emit('busSalaryDetailsList');
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
const resetForm = () => {
|
||||
state.formData = {
|
||||
id: undefined,
|
||||
sfzNumber: undefined,
|
||||
name: undefined,
|
||||
account: undefined,
|
||||
sumDuration: undefined,
|
||||
salary: undefined,
|
||||
projectId: undefined,
|
||||
teamId: undefined,
|
||||
projectName: undefined,
|
||||
teamName: undefined,
|
||||
dateOfIssue: undefined,
|
||||
lister: undefined,
|
||||
createdAt: undefined,
|
||||
updatedAt: undefined,
|
||||
deletedAt: undefined
|
||||
};
|
||||
};
|
||||
return {
|
||||
proxy,
|
||||
openDialog,
|
||||
closeDialog,
|
||||
onCancel,
|
||||
onSubmit,
|
||||
menuRef,
|
||||
formRef,
|
||||
...toRefs(state)
|
||||
};
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style scoped></style>
|
57
src/views/project/busSalaryDetails/component/model.ts
Normal file
57
src/views/project/busSalaryDetails/component/model.ts
Normal file
@ -0,0 +1,57 @@
|
||||
export interface BusSalaryDetailsTableColumns {
|
||||
id:number
|
||||
sfzNumber:string; // 身份证
|
||||
name:string; // 户名
|
||||
account:string; // 账户
|
||||
sumDuration:number; // 当月总时长
|
||||
salary:number; // 薪水(天)
|
||||
dateOfIssue:string; // 发放年月
|
||||
lister:string; // 制表人
|
||||
createdAt:string; // 创建时间
|
||||
}
|
||||
|
||||
|
||||
export interface BusSalaryDetailsInfoData {
|
||||
id:number|undefined; // 主键ID
|
||||
sfzNumber:string|undefined; // 身份证
|
||||
name:string|undefined; // 户名
|
||||
account:string|undefined; // 账户
|
||||
sumDuration:number|undefined; // 当月总时长
|
||||
salary:number|undefined; // 薪水(天)
|
||||
projectId:number|undefined; // 项目id
|
||||
teamId:number|undefined; // 班组id
|
||||
projectName:string|undefined; // 项目名称
|
||||
teamName:string|undefined; // 班组名称
|
||||
dateOfIssue:string|undefined; // 发放年月
|
||||
lister:string|undefined; // 制表人
|
||||
createdAt:string|undefined; // 创建时间
|
||||
updatedAt:string|undefined; // 更新时间
|
||||
deletedAt:string|undefined; // 删除时间
|
||||
}
|
||||
|
||||
|
||||
export interface BusSalaryDetailsTableDataState {
|
||||
ids:any[];
|
||||
tableData: {
|
||||
data: Array<BusSalaryDetailsTableColumns>;
|
||||
total: number;
|
||||
loading: boolean;
|
||||
param: {
|
||||
pageNum: number;
|
||||
pageSize: number;
|
||||
id: number|undefined;
|
||||
sfzNumber: string|undefined;
|
||||
projectId: number|undefined;
|
||||
teamId: number|undefined;
|
||||
dateRange: string[];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
export interface BusSalaryDetailsEditState{
|
||||
loading:boolean;
|
||||
isShowDialog: boolean;
|
||||
formData:BusSalaryDetailsInfoData;
|
||||
rules: object;
|
||||
}
|
590
src/views/project/busSalaryDetails/index.vue
Normal file
590
src/views/project/busSalaryDetails/index.vue
Normal file
@ -0,0 +1,590 @@
|
||||
<template>
|
||||
<div class="system-busSalaryDetails-container">
|
||||
<el-card shadow="hover">
|
||||
<div class="system-busSalaryDetails-search mb15">
|
||||
<el-form :model="tableData.param" ref="queryRef" :inline="true" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="4" class="colBlock">
|
||||
<el-form-item label="身份证" prop="sfzNumber">
|
||||
<el-input v-model="tableData.param.sfzNumber" placeholder="请输入身份证" clearable @keyup.enter.native="busSalaryDetailsList" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="项目选择" prop="projectId">
|
||||
<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-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="班组选择" prop="teamId">
|
||||
<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-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="发放年月" prop="dateOfIssue">
|
||||
<el-date-picker
|
||||
v-model="tableData.param.dateOfIssue"
|
||||
@change="onChangeOfIssue"
|
||||
value-format="YYYY-MM"
|
||||
type="month"
|
||||
placeholder="选择月份"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="busSalaryDetailsList"
|
||||
><el-icon><Search /></el-icon>搜索</el-button
|
||||
>
|
||||
<el-button @click="resetQuery(queryRef)"
|
||||
><el-icon><Refresh /></el-icon>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-button type="danger" :disabled="multiple" @click="handleDelete(null)" v-auth="'api/v1/system/busSalaryDetails/delete'"
|
||||
><el-icon><Delete /></el-icon>批量删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<span>
|
||||
<label for="file" class="input-button" title="选择您的excel表格进行上传">导入考勤表格</label>
|
||||
<input type="file" id="file" placeholder="选择文件2" />
|
||||
</span>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-button type="success" @click="exportSalary(null)"
|
||||
><el-icon><Download /></el-icon>导出员工工资表</el-button
|
||||
></el-col
|
||||
>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<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 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="name" min-width="100px" />
|
||||
<el-table-column label="账户" align="center" prop="account" min-width="100px" />
|
||||
<el-table-column label="当月总天数" align="center" prop="sumDuration" 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="lister" min-width="100px" /> -->
|
||||
<el-table-column label="总额(元)" align="center" prop="" min-width="100px">
|
||||
<template #default="scope">
|
||||
<span>{{ (Number(scope.row.sumDuration) * Number(scope.row.salary)).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上传时间" align="center" prop="createdAt" min-width="100px">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.createdAt }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding" min-width="200px" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link @click="handleView(scope.row)" v-auth="'api/v1/system/busSalaryDetails/view'"
|
||||
><el-icon><View /></el-icon>详情</el-button
|
||||
>
|
||||
<el-button type="success" link @click="exportSalary(scope.row)"
|
||||
><el-icon><Download /></el-icon>导出工资表</el-button
|
||||
>
|
||||
<el-button type="danger" link @click="handleDelete(scope.row)" v-auth="'api/v1/system/busSalaryDetails/delete'"
|
||||
><el-icon><DeleteFilled /></el-icon>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="tableData.total > 0"
|
||||
:total="tableData.total"
|
||||
v-model:page="tableData.param.pageNum"
|
||||
v-model:limit="tableData.param.pageSize"
|
||||
@pagination="busSalaryDetailsList"
|
||||
/>
|
||||
</el-card>
|
||||
<apiV1SystemBusSalaryDetailsAdd ref="addRef" @busSalaryDetailsList="busSalaryDetailsList"></apiV1SystemBusSalaryDetailsAdd>
|
||||
<apiV1SystemBusSalaryDetailsEdit ref="editRef" @busSalaryDetailsList="busSalaryDetailsList"></apiV1SystemBusSalaryDetailsEdit>
|
||||
<apiV1SystemBusSalaryDetailsDetail ref="detailRef" @busSalaryDetailsList="busSalaryDetailsList"></apiV1SystemBusSalaryDetailsDetail>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { toRefs, reactive, onMounted, ref, defineComponent, computed, getCurrentInstance, toRaw } from 'vue';
|
||||
import { ElMessageBox, ElMessage, FormInstance, ElLoading } from 'element-plus';
|
||||
import { listBusSalaryDetails, delBusSalaryDetails, addBusSalaryDetails, salarySheet } from '@/api/project/busSalaryDetails';
|
||||
import { BusSalaryDetailsTableColumns, BusSalaryDetailsTableDataState } from './component/model';
|
||||
import apiV1SystemBusSalaryDetailsAdd from './component/add.vue';
|
||||
import apiV1SystemBusSalaryDetailsEdit from './component/edit.vue';
|
||||
import apiV1SystemBusSalaryDetailsDetail from './component/detail.vue';
|
||||
import * as xlsx from 'xlsx';
|
||||
|
||||
import { exportDataToExcel } from '@/utils/exportDataToExcel.js';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { listProjectTeam } from '@/api/project/projectTeam';
|
||||
import { listProject } from '@/api/project/project';
|
||||
export default defineComponent({
|
||||
name: 'index',
|
||||
components: {
|
||||
apiV1SystemBusSalaryDetailsAdd,
|
||||
apiV1SystemBusSalaryDetailsEdit,
|
||||
apiV1SystemBusSalaryDetailsDetail
|
||||
},
|
||||
setup() {
|
||||
const stores = useUserStoreHook();
|
||||
const { proxy } = <any>getCurrentInstance();
|
||||
const loading = ref(false);
|
||||
const queryRef = ref();
|
||||
const addRef = ref();
|
||||
const editRef = ref();
|
||||
const detailRef = ref();
|
||||
// 是否显示所有搜索选项
|
||||
const showAll = ref(false);
|
||||
// 非单个禁用
|
||||
const single = ref(true);
|
||||
// 非多个禁用
|
||||
const multiple = ref(true);
|
||||
const word = computed(() => {
|
||||
if (showAll.value === false) {
|
||||
//对文字进行处理
|
||||
return '展开搜索';
|
||||
} else {
|
||||
return '收起搜索';
|
||||
}
|
||||
});
|
||||
// 字典选项数据
|
||||
const {} = proxy.useDict();
|
||||
const state = reactive<BusSalaryDetailsTableDataState>({
|
||||
ids: [],
|
||||
projectList: [], //项目列表
|
||||
projectListMap: new Map(),
|
||||
TeamList: [], //班组列表
|
||||
TeamListMap: new Map(), //班组列表
|
||||
tableData: {
|
||||
data: [],
|
||||
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 = () => {
|
||||
listProject({ 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,这里取了第一个sheet:workBook.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,
|
||||
addRef,
|
||||
editRef,
|
||||
detailRef,
|
||||
showAll,
|
||||
loading,
|
||||
single,
|
||||
onChangeProject,
|
||||
onChangeTeam,
|
||||
multiple,
|
||||
handleSelectionChange,
|
||||
word,
|
||||
onChangeOfIssue,
|
||||
queryRef,
|
||||
resetQuery,
|
||||
busSalaryDetailsList,
|
||||
exportSalary,
|
||||
toggleSearch,
|
||||
handleDelete,
|
||||
handleView,
|
||||
...toRefs(state)
|
||||
};
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.colBlock {
|
||||
display: block;
|
||||
}
|
||||
.colNone {
|
||||
display: none;
|
||||
}
|
||||
.system-busSalaryDetails-container {
|
||||
input[type='file'] {
|
||||
display: none;
|
||||
}
|
||||
label {
|
||||
display: inline-block;
|
||||
background-color: #007bff; /*设置背景色*/
|
||||
color: #fff; /*设置字体颜色*/
|
||||
padding: 3px 10px; /*设置内边距*/
|
||||
border-radius: 5px; /*设置圆角*/
|
||||
cursor: pointer; /*将鼠标光标设置为手型*/
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -3,8 +3,8 @@
|
||||
<div class="move_pop" id="detial_pop">
|
||||
<!-- <span>{{ title }}</span> -->
|
||||
<div class="box">
|
||||
<img v-if="type == 2" src="../icon/suo.png" @click="onFull(1)" />
|
||||
<img v-else src="../icon/full.png" @click="onFull(2)" />
|
||||
<img v-if="type == 2" src="/image/suo.png" @click="onFull(1)" />
|
||||
<img v-else src="/image/full.png" @click="onFull(2)" />
|
||||
<span class="close" @click="onClose">✖</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -63,7 +63,7 @@
|
||||
:preview-src-list="[item.filenPathCoding]"
|
||||
fit="cover"
|
||||
/>
|
||||
<img :src="'/image/' + item.suffix + '.png'" v-else />
|
||||
<img :src="'/image/' + item.suffix.replace('.', '').toUpperCase() + '.png'" v-else />
|
||||
</div>
|
||||
<span @click="onFileName(item)" title="点击重命名">{{ item.name }}</span>
|
||||
<div :class="{ fileActive: toolStart }" v-if="toolStart" @click="onToolAll(item)"></div>
|
||||
@ -86,6 +86,7 @@
|
||||
<RecyclingStation ref="RecyclingStationRef"></RecyclingStation>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<bigUploader></bigUploader>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
@ -140,8 +141,8 @@ export default defineComponent({
|
||||
parentPid: '0', //父级的id 默认为0
|
||||
fileType: 0, //文件 或压缩文件
|
||||
list: [
|
||||
{ id: 3, name: '文件详情', callback: onExport, auth: 'zm/api/v1/system/documentProductionDrawing/get' },
|
||||
{ id: 1, name: '文件下载', callback: onExport, auth: 'zm/api/v1/system/documentQualityMeeting/qualityDataUniFileDownload' },
|
||||
// { id: 3, name: '文件详情', callback: onExport, auth: 'zm/api/v1/system/documentProductionDrawing/get' },
|
||||
// { id: 1, name: '文件下载', callback: onExport, auth: 'zm/api/v1/system/documentQualityMeeting/qualityDataUniFileDownload' },
|
||||
{ id: 2, name: '文件删除', callback: onDeleteFile, auth: 'zm/api/v1/system/documentCompletion/delete' }
|
||||
],
|
||||
relativePath: '', //文件下载需要相对路径
|
||||
@ -178,7 +179,7 @@ export default defineComponent({
|
||||
}
|
||||
let obj = {
|
||||
filePath: {
|
||||
url,
|
||||
url: '/file/' + url,
|
||||
name: filename,
|
||||
size: totalSize,
|
||||
fileType: '.' + fileType1 //后缀名
|
||||
@ -475,7 +476,7 @@ export default defineComponent({
|
||||
left: 0;
|
||||
display: none;
|
||||
border-radius: 6px;
|
||||
padding: 14px 0;
|
||||
padding: 4px 0;
|
||||
> div {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
|
@ -44,9 +44,9 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding" width="220px" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button type="success" link @click="onExport(scope.row)"
|
||||
<!-- <el-button type="success" link @click="onExport(scope.row)"
|
||||
><el-icon><Download /></el-icon>下载</el-button
|
||||
>
|
||||
> -->
|
||||
<el-button type="primary" link @click="onBook(scope.row)"
|
||||
><el-icon><View /></el-icon>查看</el-button
|
||||
>
|
||||
@ -86,9 +86,9 @@
|
||||
</el-tooltip>
|
||||
<span v-else>{{ node.label }}</span>
|
||||
<span style="margin-left: 15px" class="set-tool">
|
||||
<el-button type="primary" v-auth="'/zm/api/v1/system/documentData/onlineImport'" link @click.stop="onExportFile(node, data)"
|
||||
<!-- <el-button type="primary" v-auth="'/zm/api/v1/system/documentData/onlineImport'" link @click.stop="onExportFile(node, data)"
|
||||
>下载</el-button
|
||||
>
|
||||
> -->
|
||||
<el-button
|
||||
type="success"
|
||||
v-auth="'/zm/api/v1/system/documentData/get'"
|
||||
|
@ -3,8 +3,8 @@
|
||||
<div class="move_pop" id="detial_pop">
|
||||
<!-- <span>{{ title }}</span> -->
|
||||
<div class="box">
|
||||
<img v-if="type == 2" src="../icon/suo.png" @click="onFull(1)" />
|
||||
<img v-else src="../icon/full.png" @click="onFull(2)" />
|
||||
<img v-if="type == 2" src="/image/suo.png" @click="onFull(1)" />
|
||||
<img v-else src="/image/full.png" @click="onFull(2)" />
|
||||
<span class="close" @click="onClose">✖</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -3,8 +3,8 @@
|
||||
<div class="move_pop" id="detial_edit">
|
||||
<!-- <span>{{ title }}</span> -->
|
||||
<div class="box">
|
||||
<img v-if="type == 2" src="../icon/full.png" @click="onFull(1)" />
|
||||
<img v-else src="../icon/suo.png" @click="onFull(2)" />
|
||||
<img v-if="type == 2" src="/image/full.png" @click="onFull(1)" />
|
||||
<img v-else src="/image/suo.png" @click="onFull(2)" />
|
||||
<span class="close" @click="onClose">✖</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -25,9 +25,9 @@
|
||||
<el-option v-for="item in options" :key="item.id" :label="item.label" :value="item.id" />
|
||||
</el-select>
|
||||
</div>
|
||||
<el-button type="primary" v-auth="'/zm/api/v1/system/documentProject/dataCompressedDownload'" :disabled="!parentPid" @click="onExport"
|
||||
<!-- <el-button type="primary" v-auth="'/zm/api/v1/system/documentProject/dataCompressedDownload'" :disabled="!parentPid" @click="onExport"
|
||||
><el-icon><Download /></el-icon>下载</el-button
|
||||
>
|
||||
> -->
|
||||
<el-button type="primary" @click="onBook" v-auth="'/zm/api/v1/system/documentData/dataFileQuery'"
|
||||
><el-icon><View /></el-icon>查看全项目文件</el-button
|
||||
>
|
||||
@ -127,9 +127,9 @@
|
||||
@click="updataView(scope.row)"
|
||||
><el-icon><EditPen /></el-icon>修改文件</el-button
|
||||
>
|
||||
<el-button type="primary" v-auth="'/zm/api/v1/system/documentData/uniFolderDownload'" link @click="onExportView(scope.row)"
|
||||
<!-- <el-button type="primary" v-auth="'/zm/api/v1/system/documentData/uniFolderDownload'" link @click="onExportView(scope.row)"
|
||||
><el-icon><Download /></el-icon>下载</el-button
|
||||
>
|
||||
> -->
|
||||
<el-button type="success" v-auth="'/zm/api/v1/system/documentData/edit'" link @click="updateName(scope.row)"
|
||||
><el-icon><EditPen /></el-icon>修改名称</el-button
|
||||
>
|
||||
|
@ -28,9 +28,9 @@
|
||||
<el-option v-for="item in options" :key="item.id" :label="item.label" :value="item.id" />
|
||||
</el-select>
|
||||
</div>
|
||||
<el-button type="primary" v-auth="'/zm/api/v1/system/document/compressedDownload'" :disabled="!parentPid" @click="onExport"
|
||||
<!-- <el-button type="primary" v-auth="'/zm/api/v1/system/document/compressedDownload'" :disabled="!parentPid" @click="onExport"
|
||||
><el-icon><Download /></el-icon>下载</el-button
|
||||
>
|
||||
> -->
|
||||
</div>
|
||||
<div class="file_upload check_select">
|
||||
<el-input class="input_left" v-model="filterText" size="small" placeholder="请输入文件名称" />
|
||||
@ -102,9 +102,9 @@
|
||||
<el-button type="success" link v-auth="'/zm/api/v1/system/document/complaintBoxAdd'" @click="updataView(scope.row)"
|
||||
><el-icon><EditPen /></el-icon>修改模板</el-button
|
||||
>
|
||||
<el-button type="primary" v-auth="'/zm/api/v1/system/document/compressedDownload'" link @click="onExportView(scope.row)"
|
||||
<!-- <el-button type="primary" v-auth="'/zm/api/v1/system/document/compressedDownload'" link @click="onExportView(scope.row)"
|
||||
><el-icon><Download /></el-icon>下载</el-button
|
||||
>
|
||||
> -->
|
||||
<el-button type="success" v-auth="'/zm/api/v1/system/document/edit'" link @click="updateName(scope.row)"
|
||||
><el-icon><EditPen /></el-icon>修改名称</el-button
|
||||
>
|
||||
@ -227,7 +227,7 @@ export default defineComponent({
|
||||
let fileType1 = arr[arr.length - 1];
|
||||
let obj = {
|
||||
filePath: {
|
||||
url,
|
||||
url: '/file/' + url,
|
||||
name: filename,
|
||||
size: totalSize,
|
||||
fileType: '.' + fileType1 //后缀名
|
||||
|
@ -28,7 +28,7 @@
|
||||
><el-space wrap>
|
||||
<div>
|
||||
<span>
|
||||
<image-preview :src="BASE_URL + safetyInspectionDetail?.path" width="200px" />
|
||||
<image-preview :src="'http://58.17.134.85:8919' + safetyInspectionDetail?.path" width="200px" />
|
||||
</span>
|
||||
</div>
|
||||
</el-space>
|
||||
@ -63,7 +63,6 @@ const currentProject = computed(() => userStore.selectedProject);
|
||||
interface Props {
|
||||
qualityConstructionId?: string | number;
|
||||
}
|
||||
const BASE_URL = import.meta.env.VITE_BASE_URL_GO;
|
||||
const props = defineProps<Props>();
|
||||
|
||||
//获取详情
|
||||
|
@ -40,7 +40,7 @@
|
||||
<el-descriptions-item label-align="center" label="检查附件" :span="2" label-class-name="white">
|
||||
<el-space wrap>
|
||||
<div v-for="item in safetyInspectionDetail?.inspectionccessories" :key="item.id">
|
||||
<span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileType)">
|
||||
<span v-if="['png', 'jpg', 'jpeg'].includes(item.fileType)">
|
||||
<image-preview :src="BASE + item.path" width="200px" />
|
||||
</span>
|
||||
<span v-else>
|
||||
@ -71,7 +71,7 @@
|
||||
<image-preview :src="item.url" width="200px" />
|
||||
</span>
|
||||
<span v-else>
|
||||
<el-link :href="`${item.url}`" :underline="false" type="primary" target="_blank">
|
||||
<el-link :href="`http://58.17.134.85:8919${item.url}`" :underline="false" type="primary" target="_blank">
|
||||
<span> {{ item.originalName }} </span>
|
||||
</el-link>
|
||||
</span>
|
||||
|
@ -126,7 +126,7 @@
|
||||
isGo
|
||||
upload-url="/zm/api/v1/system/busInspectionTicket/add"
|
||||
:data="form"
|
||||
:accept="['doc', 'docx', 'pdf', 'png', 'jpg', 'jpeg']"
|
||||
:fileType="['doc', 'docx', 'pdf', 'png', 'jpg', 'jpeg']"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
@ -86,6 +86,7 @@
|
||||
<RecyclingStation ref="RecyclingStationRef"></RecyclingStation>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<bigUploader></bigUploader>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
@ -141,7 +142,7 @@ export default defineComponent({
|
||||
parentPid: '0', //父级的id 默认为0
|
||||
fileType: 0, //文件 或压缩文件
|
||||
list: [
|
||||
{ id: 1, name: '文件下载', callback: onExport, auth: 'api/v1/system/documentSafetyMeeting/safetyDataUniFileDownload' },
|
||||
// { id: 1, name: '文件下载', callback: onExport, auth: 'api/v1/system/documentSafetyMeeting/safetyDataUniFileDownload' },
|
||||
{ id: 2, name: '文件删除', callback: onDeleteFile, auth: 'api/v1/system/documentSafetyMeeting/delete' }
|
||||
],
|
||||
relativePath: '', //文件下载需要相对路径
|
||||
@ -177,7 +178,7 @@ export default defineComponent({
|
||||
}
|
||||
let obj = {
|
||||
filePath: {
|
||||
url,
|
||||
url: '/file/' + url,
|
||||
name: filename,
|
||||
size: totalSize,
|
||||
fileType: '.' + fileType1 //后缀名
|
||||
@ -466,12 +467,12 @@ export default defineComponent({
|
||||
z-index: 999;
|
||||
background-color: rgb(0 0 0 / 56%);
|
||||
width: 120px;
|
||||
height: 100px;
|
||||
height: 50px;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: none;
|
||||
border-radius: 6px;
|
||||
padding: 14px 4px;
|
||||
padding: 4px 4px;
|
||||
> div {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
|
@ -3,8 +3,8 @@
|
||||
<div class="move_pop" id="detial_pop">
|
||||
<!-- <span>{{ title }}</span> -->
|
||||
<div class="box">
|
||||
<img v-if="type == 2" src="../icon/suo.png" @click="onFull(1)" />
|
||||
<img v-else src="../icon/full.png" @click="onFull(2)" />
|
||||
<img v-if="type == 2" src="/image/suo.png" @click="onFull(1)" />
|
||||
<img v-else src="/image/full.png" @click="onFull(2)" />
|
||||
<span class="close" @click="onClose">✖</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -3,8 +3,8 @@
|
||||
<div class="move_pop" id="detial_edit">
|
||||
<!-- <span>{{ title }}</span> -->
|
||||
<div class="box">
|
||||
<img v-if="type == 2" src="../icon/full.png" @click="onFull(1)" />
|
||||
<img v-else src="../icon/suo.png" @click="onFull(2)" />
|
||||
<img v-if="type == 2" src="/image/full.png" @click="onFull(1)" />
|
||||
<img v-else src="/image/suo.png" @click="onFull(2)" />
|
||||
<span class="close" @click="onClose">✖</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -11,13 +11,13 @@
|
||||
<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" />
|
||||
{{ safetyInspectionDetail?.studyTypeName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="违章类型" label-class-name="white">
|
||||
<dict-tag :options="safety_inspection_violation_type" :value="safetyInspectionDetail?.violationType" />
|
||||
{{ safetyInspectionDetail?.tourTypeName }}
|
||||
</el-descriptions-item>
|
||||
<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="检查人" class-name="zebra">{{ safetyInspectionDetail?.abarbeitung }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改人" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.abarbeitung }}
|
||||
</el-descriptions-item>
|
||||
@ -30,7 +30,7 @@
|
||||
</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 }}
|
||||
>{{ safetyInspectionDetail?.inspectionResult }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查附件" :span="2" label-class-name="white">
|
||||
<el-space wrap>
|
||||
@ -69,7 +69,7 @@
|
||||
<el-space wrap>
|
||||
<div v-for="item in safetyInspectionDetail.checkAttachment" :key="item.id">
|
||||
<span v-if="['png', 'jpg', 'jpeg'].includes(item.fileType)">
|
||||
<image-preview :src="item.path" width="200px" />
|
||||
<image-preview :src="'http://58.17.134.85:8919' + item.path" width="200px" />
|
||||
</span>
|
||||
<span v-else>
|
||||
<el-link :href="`${'http://58.17.134.85:8919' + item.url}`" :underline="false" target="_blank">
|
||||
@ -96,16 +96,16 @@
|
||||
</div>
|
||||
|
||||
<!-- </el-card> -->
|
||||
<div class="dialog-footer">
|
||||
<!-- <div class="dialog-footer">
|
||||
<div class="btn-item" @click="handleExport">
|
||||
<img src="../../../../assets/icons/svg/derived.png" />
|
||||
<span>导出</span>
|
||||
</div>
|
||||
<!-- <div class="btn-item" v-print="'#printMe'">
|
||||
<div class="btn-item" v-print="'#printMe'">
|
||||
<img src="../../../../assets/icons/svg/print.png" />
|
||||
<span>打印</span>
|
||||
</div> -->
|
||||
</div>
|
||||
</div> -->
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -198,7 +198,7 @@ watch(
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
height: 200px;
|
||||
height: 100px;
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
|
@ -65,9 +65,9 @@
|
||||
<span>{{ filterType(scope.row.studyType) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="违章类型" align="center" prop="violationType">
|
||||
<el-table-column label="违章类型" align="center" prop="tourType">
|
||||
<template #default="scope">
|
||||
<span>{{ filterTypeS(scope.row.violationType) }}</span>
|
||||
<span>{{ filterTypeS(scope.row.tourType) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="巡检结果" align="center" prop="inspectionResult">
|
||||
|
@ -18,13 +18,11 @@
|
||||
{{ safetyInspectionDetail?.level }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查时间" class-name="zebra"
|
||||
>{{ safetyInspectionDetail?.violationTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查人" class-name="zebra"
|
||||
>{{ safetyInspectionDetail?.createByName }}
|
||||
>{{ safetyInspectionDetail?.reviewTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查人" class-name="zebra">{{ safetyInspectionDetail?.reviewName }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改人" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.handlerName }}
|
||||
>{{ safetyInspectionDetail?.openidName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="要求整改期限" label-class-name="white">
|
||||
{{ safetyInspectionDetail?.disposeDeadline ? dayjs(safetyInspectionDetail?.disposeDeadline).format('YYYY - MM - DD ') : '' }}
|
||||
@ -119,7 +117,7 @@ const inspectionType = computed(() => {
|
||||
|
||||
const get = async () => {
|
||||
loading.value = true;
|
||||
const res = await getViolationRecord({ id: props.violationRecordId });
|
||||
const res = await getViolationRecord(props.violationRecordId as string);
|
||||
if (res.data && res.code === 0) {
|
||||
safetyInspectionDetail.value = res.data;
|
||||
}
|
||||
@ -181,7 +179,7 @@ watch(
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
height: 200px;
|
||||
height: 100px;
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
|
Reference in New Issue
Block a user