|
|
@@ -1,7 +1,8 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <!-- 左侧树形结构 -->
|
|
|
<el-container>
|
|
|
+
|
|
|
+ <!-- 左侧树形结构 -->
|
|
|
<el-scrollbar max-height="80vh">
|
|
|
<el-aside width="280px">
|
|
|
<div class="JKWTree-tree">
|
|
|
@@ -23,7 +24,8 @@
|
|
|
<el-row :span="6">
|
|
|
<el-input
|
|
|
v-model="searchInfo"
|
|
|
- placeholder="输入工单编号或产品名称"
|
|
|
+ placeholder="输入员工编号或姓名"
|
|
|
+ @keyup.enter="onSearch()"
|
|
|
/>
|
|
|
</el-row>
|
|
|
<!-- 按钮区域 -->
|
|
|
@@ -31,32 +33,36 @@
|
|
|
type="primary"
|
|
|
:icon="Search"
|
|
|
@click="onSearch"
|
|
|
- >搜索</el-button>
|
|
|
+ >搜索
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
:icon="Refresh"
|
|
|
- >重置</el-button>
|
|
|
+ >重置
|
|
|
+ </el-button>
|
|
|
<div style="margin-left: auto;">
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
:icon="Download"
|
|
|
@click="exportExcel"
|
|
|
- >导出到Excel</el-button>
|
|
|
+ >导出到Excel
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 上半数据展示 -->
|
|
|
<el-table
|
|
|
- ref="multipleTable"
|
|
|
+ ref="tab1"
|
|
|
style="width: 100%;height:30vh;"
|
|
|
tooltip-effect="dark"
|
|
|
:data="tableData1"
|
|
|
row-key="ID"
|
|
|
- highlight-current-row="true"
|
|
|
+ highlight-current-row
|
|
|
border
|
|
|
:row-style="{ height: '20px' }"
|
|
|
:cell-style="{ padding: '0px' }"
|
|
|
:header-row-style="{ height: '20px' }"
|
|
|
:header-cell-style="{ padding: '0px' }"
|
|
|
+ @cell-dblclick="handleDblclick1"
|
|
|
@selection-change="handleSelectionChange"
|
|
|
>
|
|
|
<el-table-column
|
|
|
@@ -77,7 +83,7 @@
|
|
|
</el-table>
|
|
|
<br>
|
|
|
<el-table
|
|
|
- ref="multipleTable"
|
|
|
+ ref="tab2"
|
|
|
style="width: 100%;height: 40vh;"
|
|
|
tooltip-effect="dark"
|
|
|
:data="tableData2"
|
|
|
@@ -116,13 +122,12 @@
|
|
|
<script setup>
|
|
|
|
|
|
// 全量引入格式化工具 请按需保留
|
|
|
-import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
-import { Search, Refresh, Download } from '@element-plus/icons-vue'
|
|
|
-import { ref, reactive, onMounted, onBeforeMount } from 'vue'
|
|
|
-import { getSide, getUpData, getDownData, getDetail, getLocal } from '@/api/mes_api_gty/overTimePayVerification'
|
|
|
+import { Download, Refresh, Search } from '@element-plus/icons-vue'
|
|
|
+import { reactive, ref } from 'vue'
|
|
|
+import { getDownData, getSide, getUpData } from '@/api/mes_api_gty/overTimePayVerification'
|
|
|
|
|
|
defineOptions({
|
|
|
- name: '06PackingDocuments'
|
|
|
+ name: '06PackingDocuments',
|
|
|
})
|
|
|
|
|
|
// 侧边栏数据请求
|
|
|
@@ -144,47 +149,50 @@ getSideData()
|
|
|
const tableCols1 = [
|
|
|
{ label: '员工编号', prop: 'bh', width: '100' },
|
|
|
{ label: '员工姓名', prop: '员工姓名', width: '100' },
|
|
|
- { label: '工资表类别', prop: '工资表类别', width: '400' },
|
|
|
- { label: '聘用日期', prop: '聘用日期', width: '100' },
|
|
|
+ { label: '工资表类别', prop: '工资表类别', width: '150' },
|
|
|
+ { label: '聘用日期', prop: '聘用日期', width: '150' },
|
|
|
{ label: '法定天数', prop: '法定天数', width: '100' },
|
|
|
{ label: '当月定额', prop: '当月定额', width: '100' },
|
|
|
- { label: '月度合计产量', prop: '月度合计产量', width: '100' },
|
|
|
- { label: '个人计件工资', prop: '个人计件工资', width: '250' },
|
|
|
- { label: '个人加班工资', prop: '个人加班工资', width: '250' },
|
|
|
- { label: '月计时时数', prop: '月计时时数', width: '250' },
|
|
|
- { label: '计时补差', prop: '计时补差', width: '250' },
|
|
|
+ { label: '月度合计产量', prop: '月度合计产量', width: '150' },
|
|
|
+ { label: '个人计件工资', prop: '个人计件工资', width: '150' },
|
|
|
+ { label: '个人加班工资', prop: '个人加班工资', width: '150' },
|
|
|
+ { label: '月计时时数', prop: '月计时时数', width: '150' },
|
|
|
+ { label: '计时补差', prop: '计时补差', width: '150' },
|
|
|
]
|
|
|
const tableCols2 = [
|
|
|
- { label: '工单编号', prop: 'qczl_gdbh', width: '100' },
|
|
|
- { label: '印件号', prop: 'qczl_yjno', width: '100' },
|
|
|
- { label: '印件名称', prop: 'Gd_cpmc', width: '400', showOverflowTooltip: true },
|
|
|
- { label: '日期', prop: 'qczl_rq', width: '100' },
|
|
|
- { label: '流程单号', prop: 'qczl_num', width: '100' },
|
|
|
- { label: '流程单备注', prop: 'qczl_NumDesc', width: '100' },
|
|
|
- { label: '总废品', prop: 'qczl_fp', width: '100' },
|
|
|
- { label: '废品1', prop: 'sl_lb1', width: '250' },
|
|
|
- { label: '废品2', prop: 'sl_lb2', width: '250' },
|
|
|
- { label: '废品3', prop: 'sl_lb3', width: '250' },
|
|
|
- { label: '废品4', prop: 'sl_lb4', width: '250' },
|
|
|
- { label: '废品5', prop: 'sl_lb5', width: '250' },
|
|
|
- { label: '废品6', prop: 'sl_lb6', width: '250' },
|
|
|
- { label: '废品7', prop: 'sl_lb7', width: '250' },
|
|
|
- { label: '废品8', prop: 'sl_lb8', width: '250' },
|
|
|
- { label: '废品9', prop: 'sl_lb9', width: '250' },
|
|
|
- { label: '废品10', prop: 'sl_lb10', width: '250' },
|
|
|
- { label: '废品11', prop: 'sl_lb11', width: '250' },
|
|
|
- { label: '废品12', prop: 'sl_lb12', width: '250' },
|
|
|
- { label: '废品13', prop: 'sl_lb13', width: '250' },
|
|
|
- { label: '废品14', prop: 'sl_lb14', width: '250' },
|
|
|
- { label: '废品15', prop: 'sl_lb15', width: '250' },
|
|
|
- { label: '废品16', prop: 'sl_lb16', width: '250' },
|
|
|
- { label: '废品17', prop: 'sl_lb17', width: '250' },
|
|
|
- { label: '创建用户', prop: 'sys_id', width: '200' },
|
|
|
+ { label: '日期', prop: 'sczl_rq', width: '100' },
|
|
|
+ { label: '工单编号', prop: 'sczl_gdbh', width: '100' },
|
|
|
+ { label: '成品名称', prop: 'Gd_cpmc', width: '300' },
|
|
|
+ { label: '印件及工序', prop: 'sczl_type', width: '300' },
|
|
|
+ { label: '车头产量', prop: '班组车头产量', width: '100' },
|
|
|
+ { label: '机台编号', prop: 'sczl_jtbh', width: '100' },
|
|
|
+ { label: '产量系数', prop: '产量系数', width: '100' },
|
|
|
+ { label: '计件产量', prop: '计件产量', width: '100' },
|
|
|
+ { label: '补产产量', prop: '补产产量', width: '100' },
|
|
|
+ { label: '核算产量', prop: '核算产量', width: '100' },
|
|
|
+ { label: '日定额', prop: '日定额', width: '100' },
|
|
|
+ { label: '达标定额', prop: '达标定额', width: '100' },
|
|
|
+ { label: '千件工价', prop: '千件工价', width: '100' },
|
|
|
+ { label: '补产标准', prop: '补产标准', width: '100' },
|
|
|
+ { label: '个人计件工资', prop: '个人计件工资', width: '120' },
|
|
|
+ { label: '个人加班工资', prop: '个人加班工资', width: '120' },
|
|
|
+ { label: '个人比例', prop: '个人比例', width: '100' },
|
|
|
+ { label: '装版工时', prop: '装版工时', width: '100' },
|
|
|
+ { label: '保养工时', prop: '保养工时', width: '100' },
|
|
|
+ { label: '打样工时', prop: '打样工时', width: '100' },
|
|
|
+ { label: '分摊计时', prop: '分摊计时', width: '100' },
|
|
|
+ { label: '计时补差', prop: '计时补差', width: '100' },
|
|
|
]
|
|
|
const tableData1 = reactive([])
|
|
|
const tableData2 = reactive([])
|
|
|
+let originData = []
|
|
|
|
|
|
const searchInfo = ref('')
|
|
|
+const params = {
|
|
|
+ date: '',
|
|
|
+ department: '',
|
|
|
+ code: '',
|
|
|
+}
|
|
|
|
|
|
const handleNodeClick = async(node, check) => {
|
|
|
if (!node.children) {
|
|
|
@@ -192,17 +200,72 @@ const handleNodeClick = async(node, check) => {
|
|
|
date: node.gdbh,
|
|
|
department: node.label.slice(0, node.label.indexOf('(')),
|
|
|
}
|
|
|
+ params.date = val.date
|
|
|
+ params.department = val.department
|
|
|
const res = await getUpData(val)
|
|
|
if (res.code === 0) {
|
|
|
- console.log(res.data)
|
|
|
- tableData1.splice(0, tableData1.length, ...res.data)
|
|
|
+ const data = res.data
|
|
|
+ let totalPersonalPieceWage = 0
|
|
|
+ let totalOvertimeWage = 0
|
|
|
+
|
|
|
+ data.forEach(employee => {
|
|
|
+ const personalPieceWage = parseFloat(employee['个人计件工资']) || 0
|
|
|
+ const overtimeWage = parseFloat(employee['个人加班工资']) || 0
|
|
|
+
|
|
|
+ totalPersonalPieceWage += personalPieceWage
|
|
|
+ totalOvertimeWage += overtimeWage
|
|
|
+ })
|
|
|
+ data.push({
|
|
|
+ '员工姓名': '合计',
|
|
|
+ '个人计件工资': totalPersonalPieceWage.toFixed(2),
|
|
|
+ '个人加班工资': totalOvertimeWage.toFixed(2),
|
|
|
+ })
|
|
|
+
|
|
|
+ tableData1.splice(0, tableData1.length, ...data)
|
|
|
+ originData = [...tableData1]
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const handleDblclick1 = async(row) => {
|
|
|
+ params.code = row.bh
|
|
|
+ const { date, code } = params
|
|
|
+ const res = await getDownData({ date, code })
|
|
|
+ if (res.code === 0) {
|
|
|
+ const data = res.data
|
|
|
+ let totalPersonalPieceWage = 0
|
|
|
+ let totalOvertimeWage = 0
|
|
|
+
|
|
|
+ data.forEach(employee => {
|
|
|
+ const personalPieceWage = parseFloat(employee['个人计件工资']) || 0
|
|
|
+ const overtimeWage = parseFloat(employee['个人加班工资']) || 0
|
|
|
+
|
|
|
+ totalPersonalPieceWage += personalPieceWage
|
|
|
+ totalOvertimeWage += overtimeWage
|
|
|
+ })
|
|
|
+ data.push({
|
|
|
+ 'Gd_cpmc': '合计',
|
|
|
+ '个人计件工资': totalPersonalPieceWage.toFixed(2),
|
|
|
+ '个人加班工资': totalOvertimeWage.toFixed(2),
|
|
|
+ })
|
|
|
+
|
|
|
+ tableData2.splice(0, tableData2.length, ...data)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// 搜索
|
|
|
-function onSearch() {
|
|
|
+const onSearch = () => {
|
|
|
+ if (searchInfo.value === '') {
|
|
|
+ tableData1.splice(0, tableData1.length, ...originData)
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
+ const val = originData.filter(item => {
|
|
|
+ const bh = item.bh
|
|
|
+ const name = item.员工姓名
|
|
|
+ return (bh?.match(searchInfo.value) || name?.match(searchInfo.value))
|
|
|
+ })
|
|
|
+ tableData1.splice(0, tableData1.length, ...val)
|
|
|
}
|
|
|
|
|
|
// 导出excel
|
|
|
@@ -238,4 +301,8 @@ function exportExcel() {
|
|
|
:deep(.el-table__body tr.current-row) > td {
|
|
|
background: #ff80ff !important;
|
|
|
}
|
|
|
+
|
|
|
+:deep(.el-table td .cell) {
|
|
|
+ line-height: 30px !important;
|
|
|
+}
|
|
|
</style>
|