劳务工资统计
parent
ddf8ffb418
commit
00b199b034
|
@ -48,7 +48,7 @@
|
|||
"dayjs": "^1.11.9",
|
||||
"diagram-js": "^11.4.1",
|
||||
"echarts": "5.4.0",
|
||||
"element-ui": "^2.15.13",
|
||||
"element-ui": "^2.15.14",
|
||||
"file-saver": "2.0.5",
|
||||
"fuse.js": "6.4.3",
|
||||
"highlight.js": "9.18.5",
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<svg viewBox="0 0 79 86" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><linearGradient id="linearGradient-1-2" x1="38.8503086%" y1="0%" x2="61.1496914%" y2="100%"><stop stop-color="#FCFCFD" offset="0%"></stop><stop stop-color="#EEEFF3" offset="100%"></stop></linearGradient><linearGradient id="linearGradient-2-2" x1="0%" y1="9.5%" x2="100%" y2="90.5%"><stop stop-color="#FCFCFD" offset="0%"></stop><stop stop-color="#E9EBEF" offset="100%"></stop></linearGradient><rect id="path-3-2" x="0" y="0" width="17" height="36"></rect></defs><g id="Illustrations" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="B-type" transform="translate(-1268.000000, -535.000000)"><g id="Group-2" transform="translate(1268.000000, 535.000000)"><path id="Oval-Copy-2" d="M39.5,86 C61.3152476,86 79,83.9106622 79,81.3333333 C79,78.7560045 57.3152476,78 35.5,78 C13.6847524,78 0,78.7560045 0,81.3333333 C0,83.9106622 17.6847524,86 39.5,86 Z" fill="#F7F8FC"></path><polygon id="Rectangle-Copy-14" fill="#E5E7E9" transform="translate(27.500000, 51.500000) scale(1, -1) translate(-27.500000, -51.500000) " points="13 58 53 58 42 45 2 45"></polygon><g id="Group-Copy" transform="translate(34.500000, 31.500000) scale(-1, 1) rotate(-25.000000) translate(-34.500000, -31.500000) translate(7.000000, 10.000000)"><polygon id="Rectangle-Copy-10" fill="#E5E7E9" transform="translate(11.500000, 5.000000) scale(1, -1) translate(-11.500000, -5.000000) " points="2.84078316e-14 3 18 3 23 7 5 7"></polygon><polygon id="Rectangle-Copy-11" fill="#EDEEF2" points="-3.69149156e-15 7 38 7 38 43 -3.69149156e-15 43"></polygon><rect id="Rectangle-Copy-12" fill="url(#linearGradient-1-2)" transform="translate(46.500000, 25.000000) scale(-1, 1) translate(-46.500000, -25.000000) " x="38" y="7" width="17" height="36"></rect><polygon id="Rectangle-Copy-13" fill="#F8F9FB" transform="translate(39.500000, 3.500000) scale(-1, 1) translate(-39.500000, -3.500000) " points="24 7 41 7 55 -3.63806207e-12 38 -3.63806207e-12"></polygon></g><rect id="Rectangle-Copy-15" fill="url(#linearGradient-2-2)" x="13" y="45" width="40" height="36"></rect><g id="Rectangle-Copy-17" transform="translate(53.000000, 45.000000)"><mask id="mask-4-2" fill="white"><use xlink:href="#path-3-2"></use></mask><use id="Mask" fill="#E0E3E9" transform="translate(8.500000, 18.000000) scale(-1, 1) translate(-8.500000, -18.000000) " xlink:href="#path-3-2"></use><polygon id="Rectangle-Copy" fill="#D5D7DE" mask="url(#mask-4-2)" transform="translate(12.000000, 9.000000) scale(-1, 1) translate(-12.000000, -9.000000) " points="7 0 24 0 20 18 -1.70530257e-13 16"></polygon></g><polygon id="Rectangle-Copy-18" fill="#F8F9FB" transform="translate(66.000000, 51.500000) scale(-1, 1) translate(-66.000000, -51.500000) " points="62 45 79 45 70 58 53 58"></polygon></g></g></g></svg>
|
After Width: | Height: | Size: 2.8 KiB |
|
@ -1,10 +1,12 @@
|
|||
<template>
|
||||
<div class="day-pay">
|
||||
<div v-if="type!='index'">
|
||||
<span>请选择日期:</span>
|
||||
<el-date-picker v-model="queryParams.attendanceTime"
|
||||
style="margin:0px 10px;" type="date" placeholder="选择日期" @change="doQuery">
|
||||
</el-date-picker>
|
||||
<el-button type="primary" @click="doQuery">搜索</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-table v-loading="loading" :data="attendanceList" height="60vh" class="my-table">
|
||||
<el-table-column label="照片" align="center" prop="id">
|
||||
|
@ -27,6 +29,9 @@
|
|||
<el-table-column label="日工资" align="center" prop="pay">
|
||||
<template slot-scope="{ row }">{{(row.pay/100.0).toFixed(2)}}</template>
|
||||
</el-table-column>
|
||||
<div slot="empty">
|
||||
<el-empty v-if="total==0" image="./images/empty.svg"></el-empty>
|
||||
</div>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
|
@ -41,6 +46,9 @@ export default {
|
|||
props:{
|
||||
getPrjInfo:{
|
||||
type:Function
|
||||
},
|
||||
type:{
|
||||
type:String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -65,6 +73,9 @@ export default {
|
|||
}
|
||||
},
|
||||
created(){
|
||||
if(this.type=="index"){
|
||||
return;
|
||||
}
|
||||
this.$api.publics.findAttendanceCfgList({}).then((response) => {
|
||||
this.cfgList = response.data || [];
|
||||
this.doQuery();
|
||||
|
@ -82,17 +93,21 @@ export default {
|
|||
this.loading = true;
|
||||
let postData = {};
|
||||
if (this.queryParams.attendanceTime) {
|
||||
postData.attendanceTime = this.$dt(this.queryParams.attendanceTime).format(
|
||||
"YYYY-MM-DD"
|
||||
);
|
||||
postData.attendanceTime = this.$dt(this.queryParams.attendanceTime).format("YYYY-MM-DD");
|
||||
}
|
||||
let prj=this.getPrjInfo();
|
||||
let tmps = this.cfgList.filter(
|
||||
(d) =>
|
||||
d.projectId == prj.id &&
|
||||
d.subDeptId == prj.deptId
|
||||
);
|
||||
postData.cfgid = tmps.length > 0?tmps[0].id:0;
|
||||
if(this.type=="index"){
|
||||
postData.projectId=prj.projectId;
|
||||
postData.deptId=prj.deptId||'';
|
||||
postData.attendanceTime=this.$dt(prj.attendanceTime).format( "YYYY-MM-DD");
|
||||
}else{
|
||||
let tmps = this.cfgList.filter(
|
||||
(d) =>
|
||||
d.projectId == prj.id &&
|
||||
d.subDeptId == prj.deptId
|
||||
);
|
||||
postData.cfgid = tmps.length > 0?tmps[0].id:0;
|
||||
}
|
||||
postData.pageNum = this.queryParams.pageNum;
|
||||
postData.pageSize = this.queryParams.pageSize;
|
||||
if (this.queryParams.workerName) {
|
||||
|
@ -125,6 +140,7 @@ export default {
|
|||
});
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
this.$emit("update",this.total,this.attendanceList)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,298 +1,157 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="配置ID" prop="cfgId">
|
||||
<el-input v-model="queryParams.cfgId" placeholder="请输入配置ID" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
|
||||
<el-form-item label="项目名称" prop="projectId">
|
||||
<el-select v-model="queryParams.projectId" filterable placeholder="请选择项目" @change="doQuerySub">
|
||||
<el-option v-for="(item, index) in projectOptions" :key="index" :label="item.projectName" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班组ID" prop="groupId">
|
||||
<el-input v-model="queryParams.groupId" placeholder="请输入班组ID" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-form-item label="总包单位" prop="subDeptId">
|
||||
<el-select v-model="queryParams.subDeptId" filterable placeholder="请选择总包单位" clearable>
|
||||
<el-option v-for="(item, index) in depts" :key="index" :label="item.deptName" :value="item.deptId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班组名称" prop="groupName">
|
||||
<el-input v-model="queryParams.groupName" placeholder="请输入班组名称" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-form-item label="日期" prop="subDeptId" v-if="activeName == 'day'">
|
||||
<el-date-picker v-model="queryParams.attendanceDay" style="margin:0px 10px;" type="date" placeholder="选择日期"
|
||||
@change="handleQuery">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="工种编码" prop="workTypeCode">
|
||||
<el-input v-model="queryParams.workTypeCode" placeholder="请输入工种编码" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工种" prop="workTypeName">
|
||||
<el-input v-model="queryParams.workTypeName" placeholder="请输入工种" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工资" prop="unitPay">
|
||||
<el-input v-model="queryParams.unitPay" placeholder="请输入工资" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="isDel">
|
||||
<el-input v-model="queryParams.isDel" placeholder="请输入${comment}" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-form-item label="月份" prop="subDeptId" v-if="activeName == 'month'">
|
||||
<el-date-picker v-model="queryParams.attendanceMonth" style="margin:0px 10px;" type="month" placeholder="请选择月份"
|
||||
@change="handleQuery">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<el-button type="success" v-if="total>0" @click="doExport">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['project:unitpay:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['project:unitpay:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['project:unitpay:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
v-hasPermi="['project:unitpay:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="unitpayList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="${comment}" align="center" prop="id" />
|
||||
<el-table-column label="配置ID" align="center" prop="cfgId" />
|
||||
<el-table-column label="班组ID" align="center" prop="groupId" />
|
||||
<el-table-column label="班组名称" align="center" prop="groupName" />
|
||||
<el-table-column label="工种编码" align="center" prop="workTypeCode" />
|
||||
<el-table-column label="工种" align="center" prop="workTypeName" />
|
||||
<el-table-column label="工资" align="center" prop="unitPay" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="${comment}" align="center" prop="isDel" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['project:unitpay:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['project:unitpay:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 添加或修改劳资管理对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="配置ID" prop="cfgId">
|
||||
<el-input v-model="form.cfgId" placeholder="请输入配置ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="班组ID" prop="groupId">
|
||||
<el-input v-model="form.groupId" placeholder="请输入班组ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="班组名称" prop="groupName">
|
||||
<el-input v-model="form.groupName" placeholder="请输入班组名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工种编码" prop="workTypeCode">
|
||||
<el-input v-model="form.workTypeCode" placeholder="请输入工种编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工种" prop="workTypeName">
|
||||
<el-input v-model="form.workTypeName" placeholder="请输入工种" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工资" prop="unitPay">
|
||||
<el-input v-model="form.unitPay" placeholder="请输入工资" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="isDel">
|
||||
<el-input v-model="form.isDel" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-tabs type="card" v-model="activeName" @tab-click="doTabClick">
|
||||
<el-tab-pane label="日工资列表" name="day">
|
||||
<DayPay ref="day" @update="dataChange" :getPrjInfo="getPrjInfo" type="index" v-if="activeName == 'day'"></DayPay>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="月工资列表" name="month">
|
||||
<MonthPay ref="month" @update="dataChange" :getPrjInfo="getPrjInfo" type="index" v-if="activeName == 'month'"></MonthPay>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listUnitpay, getUnitpay, delUnitpay, addUnitpay, updateUnitpay } from "@/api/project/unitpay";
|
||||
|
||||
import DayPay from './dayPay.vue'
|
||||
import MonthPay from './monthPay.vue'
|
||||
export default {
|
||||
components:{
|
||||
DayPay,MonthPay
|
||||
},
|
||||
name: "Unitpay",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 劳资管理表格数据
|
||||
unitpayList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
activeName: 'day',
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
cfgId: null,
|
||||
groupId: null,
|
||||
groupName: null,
|
||||
workTypeCode: null,
|
||||
workTypeName: null,
|
||||
unitPay: null,
|
||||
isDel: null,
|
||||
projectId: null,
|
||||
subDeptId: null,
|
||||
attendanceDay:new Date(),
|
||||
attendanceMonth:new Date(),
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
cfgId: [
|
||||
{ required: true, message: "配置ID不能为空", trigger: "blur" }
|
||||
],
|
||||
groupId: [
|
||||
{ required: true, message: "班组ID不能为空", trigger: "blur" }
|
||||
],
|
||||
groupName: [
|
||||
{ required: true, message: "班组名称不能为空", trigger: "blur" }
|
||||
],
|
||||
workTypeCode: [
|
||||
{ required: true, message: "工种编码不能为空", trigger: "blur" }
|
||||
],
|
||||
workTypeName: [
|
||||
{ required: true, message: "工种不能为空", trigger: "blur" }
|
||||
],
|
||||
unitPay: [
|
||||
{ required: true, message: "工资不能为空", trigger: "blur" }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: "备注不能为空", trigger: "blur" }
|
||||
],
|
||||
isDel: [
|
||||
{ required: true, message: "$comment不能为空", trigger: "blur" }
|
||||
],
|
||||
createBy: [
|
||||
{ required: true, message: "$comment不能为空", trigger: "blur" }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: "$comment不能为空", trigger: "blur" }
|
||||
],
|
||||
updateBy: [
|
||||
{ required: true, message: "$comment不能为空", trigger: "blur" }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: "$comment不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
projectOptions: [],
|
||||
depts: [],
|
||||
total:0,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
/** 查询劳资管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listUnitpay(this.queryParams).then(response => {
|
||||
this.unitpayList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
dataChange(total){
|
||||
this.total=total;
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
getPrjInfo(){
|
||||
return {
|
||||
projectId:this.queryParams.projectId,
|
||||
deptId:this.queryParams.subDeptId,
|
||||
attendanceTime:this.activeName=="day"?this.queryParams.attendanceDay:this.queryParams.attendanceMonth
|
||||
}
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
cfgId: null,
|
||||
groupId: null,
|
||||
groupName: null,
|
||||
workTypeCode: null,
|
||||
workTypeName: null,
|
||||
unitPay: null,
|
||||
remark: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加劳资管理";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getUnitpay(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改劳资管理";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateUnitpay(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addUnitpay(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
doQuerySub() {
|
||||
let prjId = this.queryParams.projectId;
|
||||
let tmps = this.prjDept2 && this.prjDept2[prjId] ? this.prjDept2[prjId] || [] : [];
|
||||
if (tmps.length > 0 || !prjId) {
|
||||
this.depts = tmps;
|
||||
if (tmps.length == 1) {
|
||||
this.queryParams.subDeptId = tmps[0].deptId;
|
||||
} else {
|
||||
this.queryParams.subDeptId = '';
|
||||
}
|
||||
return;
|
||||
}
|
||||
this.$api.publics.queryUnitList({
|
||||
projectId: prjId,
|
||||
unitTypes: "2".split(","),
|
||||
}).then((d) => {
|
||||
let objs = d.rows || [];
|
||||
if (!this.prjDept2) {
|
||||
this.prjDept2 = {};
|
||||
}
|
||||
this.prjDept2[prjId] = objs;
|
||||
this.depts = objs;
|
||||
if (objs.length == 1) {
|
||||
this.queryParams.subDeptId = objs[0].deptId;
|
||||
} else {
|
||||
this.queryParams.subDeptId = '';
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除劳资管理编号为"' + ids + '"的数据项?').then(function () {
|
||||
return delUnitpay(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
init() {
|
||||
if (this.projectOptions && this.projectOptions.length > 0) {
|
||||
return;
|
||||
}
|
||||
this.$api.publics.getMyProjectList({}).then((response) => {
|
||||
this.projectOptions = response.rows || [];
|
||||
if (this.projectOptions.length > 0) {
|
||||
this.queryParams.projectId = this.projectOptions[0].id;
|
||||
this.doQuerySub();
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('project/unitpay/export', {
|
||||
...this.queryParams
|
||||
}, `unitpay_${new Date().getTime()}.xlsx`)
|
||||
handleQuery() {
|
||||
if(this.activeName=='day'){
|
||||
this.$refs.day.doQuery();
|
||||
}else{
|
||||
this.$refs.month.doQuery();
|
||||
}
|
||||
},
|
||||
doTabClick(){
|
||||
setTimeout(this.handleQuery,1000);
|
||||
},
|
||||
doExport(){
|
||||
let postData=this.getPrjInfo();
|
||||
let tmps=this.projectOptions.filter(d=>d.id==this.queryParams.projectId);
|
||||
let name=tmps.length>0?tmps[0].projectName:"";
|
||||
if(this.queryParams.subDeptId){
|
||||
tmps=this.depts.filter(d=>d.deptId==this.queryParams.subDeptId);
|
||||
if(tmps.length>0){
|
||||
name+="_"+tmps[0].deptName;
|
||||
}
|
||||
}
|
||||
name+="_"+this.$dt(postData.attendanceTime).format(this.activeName=="day"?"YYYY年MM月DD日":"YYYY年MM月");
|
||||
name+=`_[${new Date().getTime()}].xlsx`
|
||||
postData.attendanceTime=this.$dt(postData.attendanceTime).format("YYYY-MM-DD");
|
||||
let url=this.activeName=="day"?"project/unitpay/exportDay":"project/unitpay/exportMonth";
|
||||
this.download(
|
||||
url,
|
||||
{
|
||||
...postData,
|
||||
},
|
||||
name
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
<template>
|
||||
<div class="month-pay">
|
||||
<div v-if="type!='index'">
|
||||
<span class="label">请选择月份:</span>
|
||||
<el-date-picker v-model="queryParams.attendanceTime" style="margin:0px 10px;" type="month"
|
||||
placeholder="请选择月份" @change="doQuery">
|
||||
</el-date-picker>
|
||||
<el-button type="primary" @click="doQuery">搜索</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-table v-loading="loading" :data="attendanceList" height="60vh" class="my-table">
|
||||
<el-table-column label="照片" align="center" prop="id">
|
||||
|
@ -32,6 +34,9 @@
|
|||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<div slot="empty">
|
||||
<el-empty v-if="total==0" image="./images/empty.svg"></el-empty>
|
||||
</div>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
|
@ -46,6 +51,9 @@ export default {
|
|||
props:{
|
||||
getPrjInfo:{
|
||||
type:Function
|
||||
},
|
||||
type:{
|
||||
type:String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -70,6 +78,9 @@ export default {
|
|||
}
|
||||
},
|
||||
created(){
|
||||
if(this.type=="index"){
|
||||
return;
|
||||
}
|
||||
this.$api.publics.findAttendanceCfgList({}).then((response) => {
|
||||
this.cfgList = response.data || [];
|
||||
this.doQuery();
|
||||
|
@ -92,12 +103,18 @@ export default {
|
|||
);
|
||||
}
|
||||
let prj=this.getPrjInfo();
|
||||
let tmps = this.cfgList.filter(
|
||||
(d) =>
|
||||
d.projectId == prj.id &&
|
||||
d.subDeptId == prj.deptId
|
||||
);
|
||||
postData.cfgid = tmps.length > 0?tmps[0].id:0;
|
||||
if(this.type=="index"){
|
||||
postData.projectId=prj.projectId;
|
||||
postData.deptId=prj.deptId||'';
|
||||
postData.attendanceTime=this.$dt(prj.attendanceTime).format( "YYYY-MM-DD");
|
||||
}else{
|
||||
let tmps = this.cfgList.filter(
|
||||
(d) =>
|
||||
d.projectId == prj.id &&
|
||||
d.subDeptId == prj.deptId
|
||||
);
|
||||
postData.cfgid = tmps.length > 0?tmps[0].id:0;
|
||||
}
|
||||
postData.pageNum = this.queryParams.pageNum;
|
||||
postData.pageSize = this.queryParams.pageSize;
|
||||
if (this.queryParams.workerName) {
|
||||
|
@ -130,6 +147,7 @@ export default {
|
|||
});
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
this.$emit("update",this.total,this.attendanceList)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
<el-input v-model="row.unitPay" placeholder="请输入岗位工资" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<div slot="empty">
|
||||
<el-empty v-if="total==0" image="./images/empty.svg"></el-empty>
|
||||
</div>
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.yanzhu.jh.project.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -9,6 +10,8 @@ import cn.hutool.core.date.DateUtil;
|
|||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||
import com.yanzhu.jh.project.domain.vo.ExportAttendancDay;
|
||||
import com.yanzhu.jh.project.domain.vo.ExportAttendancMonth;
|
||||
import com.yanzhu.jh.project.service.ISurProjectAttendanceDataService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -116,12 +119,58 @@ public class SurProjectAttendanceUnitpayController extends BaseController
|
|||
*/
|
||||
@PreAuthorize("@ss.hasPermi('project:unitpay:export')")
|
||||
@Log(title = "劳资管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SurProjectAttendanceUnitpay surProjectAttendanceUnitpay)
|
||||
@PostMapping("/exportDay")
|
||||
public void exportDay(HttpServletResponse response, SurProjectAttendanceData attWhere)
|
||||
{
|
||||
List<SurProjectAttendanceUnitpay> list = surProjectAttendanceUnitpayService.selectSurProjectAttendanceUnitpayList(surProjectAttendanceUnitpay);
|
||||
ExcelUtil<SurProjectAttendanceUnitpay> util = new ExcelUtil<SurProjectAttendanceUnitpay>(SurProjectAttendanceUnitpay.class);
|
||||
util.exportExcel(response, list, "劳资管理数据");
|
||||
Date dt=DateUtil.parse(attWhere.getAttendanceTime());
|
||||
attWhere.setAttendanceOutTime(attWhere.getAttendanceOutTime());
|
||||
String tmp=attWhere.getAttendanceTime();
|
||||
if(StrUtil.isNotEmpty(tmp)){
|
||||
int year= DateUtil.parse(tmp).year();
|
||||
attWhere.setYear(year);
|
||||
}
|
||||
List<SurProjectAttendanceData> list = surProjectAttendanceDataService.selectSurProjectAttendanceDataListByDate(attWhere);
|
||||
SurProjectAttendanceUnitpay payWhere=new SurProjectAttendanceUnitpay();
|
||||
payWhere.setCfgId(attWhere.getCfgid());
|
||||
List<SurProjectAttendanceUnitpay> payList= surProjectAttendanceUnitpayService.selectSurProjectAttendanceUnitpayList(payWhere);
|
||||
List<ExportAttendancDay> exportList=new ArrayList<ExportAttendancDay>();
|
||||
for(SurProjectAttendanceData it :list){
|
||||
it.setDays(1l);
|
||||
it.setPay(surProjectAttendanceUnitpayService.getPay(payList,it));
|
||||
exportList.add(ExportAttendancDay.NEW(it));
|
||||
}
|
||||
|
||||
ExcelUtil<ExportAttendancDay> util = new ExcelUtil<ExportAttendancDay>(ExportAttendancDay.class);
|
||||
util.exportExcel(response, exportList, "劳务工资-日工资"+DateUtil.format(dt,"YYYY年MM月DD月"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出劳资管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('project:unitpay:export')")
|
||||
@Log(title = "劳资管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportMonth")
|
||||
public void exportMonth(HttpServletResponse response, SurProjectAttendanceData attWhere)
|
||||
{
|
||||
Date dt=DateUtil.parse(attWhere.getAttendanceTime());
|
||||
attWhere.setAttendanceTime( DateUtil.formatDate(DateUtil.beginOfMonth(dt)) );
|
||||
attWhere.setAttendanceOutTime( DateUtil.formatDate(DateUtil.endOfMonth(dt)));
|
||||
String tmp=attWhere.getAttendanceTime();
|
||||
if(StrUtil.isNotEmpty(tmp)){
|
||||
int year= DateUtil.parse(tmp).year();
|
||||
attWhere.setYear(year);
|
||||
}
|
||||
List<SurProjectAttendanceData> list = surProjectAttendanceDataService.selectSurProjectAttendanceDataListByMonth(attWhere);
|
||||
SurProjectAttendanceUnitpay payWhere=new SurProjectAttendanceUnitpay();
|
||||
payWhere.setCfgId(attWhere.getCfgid());
|
||||
List<SurProjectAttendanceUnitpay> payList= surProjectAttendanceUnitpayService.selectSurProjectAttendanceUnitpayList(payWhere);
|
||||
List<ExportAttendancMonth> exportList=new ArrayList<>();
|
||||
for(SurProjectAttendanceData it :list){
|
||||
it.setPay(surProjectAttendanceUnitpayService.getPay(payList,it));
|
||||
exportList.add(ExportAttendancMonth.NEW(it));
|
||||
}
|
||||
ExcelUtil<ExportAttendancMonth> util = new ExcelUtil<ExportAttendancMonth>(ExportAttendancMonth.class);
|
||||
util.exportExcel(response, exportList, "劳务工资-月工资"+DateUtil.format(dt,"YYYY年MM月"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,127 @@
|
|||
package com.yanzhu.jh.project.domain.vo;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 考勤导出日数据
|
||||
*/
|
||||
public class ExportAttendancDay {
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
@Excel(name = "部门名称")
|
||||
private String deptName;
|
||||
@Excel(name = "姓名")
|
||||
private String workerName;
|
||||
@Excel(name = "籍贯")
|
||||
private String nativePlace;
|
||||
@Excel(name = "性别")
|
||||
private String sex;
|
||||
@Excel(name = "分包商名称")
|
||||
private String companyName;
|
||||
@Excel(name = "所属班组")
|
||||
private String groupName;
|
||||
@Excel(name = "工种")
|
||||
private String workTypeName;
|
||||
@Excel(name = "日工资")
|
||||
private BigDecimal pay;
|
||||
@Excel(name = "工种日工资")
|
||||
private BigDecimal unitPay;
|
||||
|
||||
public static ExportAttendancDay NEW(SurProjectAttendanceData it) {
|
||||
ExportAttendancDay d=new ExportAttendancDay();
|
||||
d.projectName = it.getProjectName();
|
||||
d.deptName = it.getDeptName();
|
||||
d.workerName = it.getWorkerName();
|
||||
d.nativePlace = it.getNativePlace();
|
||||
d.sex=it.getWorkerGender().intValue()==0?"男":"女";
|
||||
d.companyName=it.getCompanyName();
|
||||
d.groupName=it.getGroupName();
|
||||
d.workTypeName = it.getWorkTypeName();
|
||||
d.pay=BigDecimal.valueOf(it.getPay()/100.0);
|
||||
d.unitPay=BigDecimal.valueOf(it.getUnitPay()/100.0);
|
||||
return d;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getWorkerName() {
|
||||
return workerName;
|
||||
}
|
||||
|
||||
public void setWorkerName(String workerName) {
|
||||
this.workerName = workerName;
|
||||
}
|
||||
|
||||
public String getNativePlace() {
|
||||
return nativePlace;
|
||||
}
|
||||
|
||||
public void setNativePlace(String nativePlace) {
|
||||
this.nativePlace = nativePlace;
|
||||
}
|
||||
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getCompanyName() {
|
||||
return companyName;
|
||||
}
|
||||
|
||||
public void setCompanyName(String companyName) {
|
||||
this.companyName = companyName;
|
||||
}
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
public String getWorkTypeName() {
|
||||
return workTypeName;
|
||||
}
|
||||
|
||||
public void setWorkTypeName(String workTypeName) {
|
||||
this.workTypeName = workTypeName;
|
||||
}
|
||||
|
||||
public BigDecimal getPay() {
|
||||
return pay;
|
||||
}
|
||||
|
||||
public void setPay(BigDecimal pay) {
|
||||
this.pay = pay;
|
||||
}
|
||||
|
||||
public BigDecimal getUnitPay() {
|
||||
return unitPay;
|
||||
}
|
||||
|
||||
public void setUnitPay(BigDecimal unitPay) {
|
||||
this.unitPay = unitPay;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,139 @@
|
|||
package com.yanzhu.jh.project.domain.vo;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 考勤导出月数据
|
||||
*/
|
||||
public class ExportAttendancMonth {
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
@Excel(name = "部门名称")
|
||||
private String deptName;
|
||||
@Excel(name = "姓名")
|
||||
private String workerName;
|
||||
@Excel(name = "籍贯")
|
||||
private String nativePlace;
|
||||
@Excel(name = "性别")
|
||||
private String sex;
|
||||
@Excel(name = "分包商名称")
|
||||
private String companyName;
|
||||
@Excel(name = "所属班组")
|
||||
private String groupName;
|
||||
@Excel(name = "工种")
|
||||
private String workTypeName;
|
||||
@Excel(name = "月工资")
|
||||
private BigDecimal pay;
|
||||
@Excel(name = "月出勤天数")
|
||||
private long days;
|
||||
@Excel(name = "工种日工资")
|
||||
private BigDecimal unitPay;
|
||||
|
||||
public static ExportAttendancMonth NEW(SurProjectAttendanceData it) {
|
||||
ExportAttendancMonth d=new ExportAttendancMonth();
|
||||
d.projectName = it.getProjectName();
|
||||
d.projectName = it.getProjectName();
|
||||
d.deptName = it.getDeptName();
|
||||
d.workerName = it.getWorkerName();
|
||||
d.nativePlace = it.getNativePlace();
|
||||
d.sex=it.getWorkerGender().intValue()==0?"男":"女";
|
||||
d.companyName=it.getCompanyName();
|
||||
d.groupName=it.getGroupName();
|
||||
d.workTypeName = it.getWorkTypeName();
|
||||
d.pay=BigDecimal.valueOf(it.getPay()/100.0);
|
||||
d.days=it.getDays();
|
||||
d.unitPay=BigDecimal.valueOf(it.getUnitPay()/100.0);
|
||||
return d;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getWorkerName() {
|
||||
return workerName;
|
||||
}
|
||||
|
||||
public void setWorkerName(String workerName) {
|
||||
this.workerName = workerName;
|
||||
}
|
||||
|
||||
public String getNativePlace() {
|
||||
return nativePlace;
|
||||
}
|
||||
|
||||
public void setNativePlace(String nativePlace) {
|
||||
this.nativePlace = nativePlace;
|
||||
}
|
||||
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getCompanyName() {
|
||||
return companyName;
|
||||
}
|
||||
|
||||
public void setCompanyName(String companyName) {
|
||||
this.companyName = companyName;
|
||||
}
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
public String getWorkTypeName() {
|
||||
return workTypeName;
|
||||
}
|
||||
|
||||
public void setWorkTypeName(String workTypeName) {
|
||||
this.workTypeName = workTypeName;
|
||||
}
|
||||
|
||||
public BigDecimal getPay() {
|
||||
return pay;
|
||||
}
|
||||
|
||||
public void setPay(BigDecimal pay) {
|
||||
this.pay = pay;
|
||||
}
|
||||
|
||||
public long getDays() {
|
||||
return days;
|
||||
}
|
||||
|
||||
public void setDays(long days) {
|
||||
this.days = days;
|
||||
}
|
||||
|
||||
public BigDecimal getUnitPay() {
|
||||
return unitPay;
|
||||
}
|
||||
|
||||
public void setUnitPay(BigDecimal unitPay) {
|
||||
this.unitPay = unitPay;
|
||||
}
|
||||
}
|
|
@ -456,8 +456,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<where>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
<if test="projectId != null ">and cfgid in (select id from sur_project_attendance_cfg where projectId = #{projectId})</if>
|
||||
<if test="deptId != null "> and deptId = #{deptId}</if>
|
||||
<if test="projectId != null ">and cfgid in (select id from sur_project_attendance_cfg where projectId = #{projectId}
|
||||
<if test="deptId != null "> and sub_dept_id = #{deptId}</if>
|
||||
)</if>
|
||||
|
||||
<if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if>
|
||||
<if test="serverid != null "> and serverid = #{serverid}</if>
|
||||
<if test="workerId != null "> and workerId = #{workerId}</if>
|
||||
|
@ -501,10 +503,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
workerId,
|
||||
COUNT(1) OVER (PARTITION BY workerId) AS days,
|
||||
ROW_NUMBER() OVER (PARTITION BY workerId ORDER BY id) AS rn
|
||||
FROM sur_project_attendance_data_2024
|
||||
WHERE cfgid = #{cfgid}
|
||||
AND (date(attendance_time) >= date(#{attendanceTime}) or date(attendance_out_time) >= date(#{attendanceTime}))
|
||||
FROM sur_project_attendance_data_${year}
|
||||
<where>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="projectId != null ">and cfgid in (select id from sur_project_attendance_cfg where projectId = #{projectId}
|
||||
<if test="deptId != null "> and sub_dept_id = #{deptId}</if>
|
||||
)</if>
|
||||
|
||||
AND (date(attendance_time) >= date(#{attendanceTime}) or date(attendance_out_time) >= date(#{attendanceTime}))
|
||||
AND (date(attendance_time) <= date(#{attendanceOutTime}) or date(attendance_out_time) <= date(#{attendanceOutTime}))
|
||||
</where>
|
||||
)
|
||||
SELECT a.*, b.days
|
||||
FROM sur_project_attendance_data_${year} a
|
||||
|
|
Loading…
Reference in New Issue