update code

dev_xds
haha 2024-04-09 22:22:23 +08:00
parent b7369b07cc
commit e7a6e0309f
3 changed files with 81 additions and 50 deletions

View File

@ -1,8 +1,10 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" style="position: relative;"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="110px"
style="position: relative;">
<el-form-item label="项目名称" prop="projectId"> <el-form-item label="项目名称" prop="projectId">
<el-select :disabled="prjDisabled" v-model="queryParams.projectId" placeholder="请选择项目" clearable @change="doQuerySub()"> <el-select :disabled="prjDisabled" v-model="queryParams.projectId" placeholder="请选择项目" clearable
@change="doQuerySub()">
<el-option v-for="(item, index) in projectOptions" :key="index" :label="item.projectName" :value="item.id"> <el-option v-for="(item, index) in projectOptions" :key="index" :label="item.projectName" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
@ -13,23 +15,30 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="分包商类型" prop="companyTypeId">
<el-select v-model="queryParams.companyTypeId" placeholder="请选择分包商类型" clearable>
<el-option value="" label="所有"></el-option>
<el-option value="101" label="总包人员"></el-option>
<el-option value="102" label="监理人员"></el-option>
<el-option value="103" label="劳务人员"></el-option>
</el-select>
</el-form-item>
<el-form-item label="" prop="state"> <el-form-item label="" prop="state">
<el-radio-group v-model="queryParams.state" size="mini"> <el-radio-group v-model="queryParams.state" size="mini">
<el-radio-button label="" >全部人员</el-radio-button> <el-radio-button label="">全部人员</el-radio-button>
<el-radio-button label="0">在岗</el-radio-button> <el-radio-button label="0">在岗</el-radio-button>
<el-radio-button label="1">已退场</el-radio-button> <el-radio-button label="1">已退场</el-radio-button>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item style="position: absolute;right:0px;"> <el-form-item style="position: absolute;right:0px;">
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <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 icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8" v-if="1==2"> <el-row :gutter="10" class="mb8" v-if="1 == 2">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['project:attendanceWorker:add']">新增</el-button> v-hasPermi="['project:attendanceWorker:add']">新增</el-button>
@ -50,26 +59,26 @@
</el-row> </el-row>
<el-table v-loading="loading" :data="attendanceWorkerList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="attendanceWorkerList" @selection-change="handleSelectionChange">
<el-table-column label="照片" align="center" prop="id"> <el-table-column label="照片" align="center" prop="id">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-image :src="row.recentPhoto" :preview-src-list="[row.recentPhoto]" style="height:60px"/> <el-image :src="row.recentPhoto" :preview-src-list="[row.recentPhoto]" style="height:60px" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="姓名" align="center" prop="name" /> <el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="籍贯" align="center" prop="nativePlace" /> <el-table-column label="籍贯" align="center" prop="nativePlace" />
<el-table-column label="性别" align="center" prop="attendanceType" > <el-table-column label="性别" align="center" prop="attendanceType">
<template slot-scope="{row}">{{ row.gender==1?'女':'男' }}</template> <template slot-scope="{row}">{{ row.gender == 1 ? '女' : '男' }}</template>
</el-table-column> </el-table-column>
<el-table-column label="进场时间" align="center" prop="inTime" v-if="1==2"> <el-table-column label="进场时间" align="center" prop="inTime" v-if="1 == 2">
<template slot-scope="{row}">{{ row.enterDate|formatDate }}</template> <template slot-scope="{row}">{{ row.enterDate | formatDate }}</template>
</el-table-column> </el-table-column>
<el-table-column label="状态" align="center" prop="status"> <el-table-column label="状态" align="center" prop="status">
<template slot-scope="{row}">{{ row.state==1?'已退场':'进场' }}</template> <template slot-scope="{row}">{{ row.state == 1 ? '已退场' : '进场' }}</template>
</el-table-column>
<el-table-column label="分包商名称" align="center" prop="companyName">
<template slot-scope="{row}">{{ row.companyName || row.remark }}</template>
</el-table-column> </el-table-column>
<el-table-column label="分包商名称" align="center" prop="companyName" >
<template slot-scope="{row}">{{ row.companyName||row.remark}}</template>
</el-table-column>
<el-table-column label="所属班组" align="center" prop="groupName" /> <el-table-column label="所属班组" align="center" prop="groupName" />
<el-table-column label="岗位/工种" align="center" prop="workTypeName" /> <el-table-column label="岗位/工种" align="center" prop="workTypeName" />
</el-table> </el-table>
@ -77,13 +86,13 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" /> @pagination="getList" />
</div> </div>
</template> </template>
<script> <script>
import { listAttendanceWorker,listJgwAttendanceWorker, getAttendanceWorker, delAttendanceWorker, addAttendanceWorker, updateAttendanceWorker,queryAttendanceData } from "@/api/project/attendanceWorker"; import { listAttendanceWorker, listJgwAttendanceWorker, getAttendanceWorker, delAttendanceWorker, addAttendanceWorker, updateAttendanceWorker, queryAttendanceData } from "@/api/project/attendanceWorker";
import {listAttendanceConfig} from '@/api/project/attendanceConfig.js' import { listAttendanceConfig } from '@/api/project/attendanceConfig.js'
export default { export default {
name: "AttendanceWorker", name: "AttendanceWorker",
data() { data() {
@ -108,39 +117,40 @@ export default {
open: false, open: false,
// //
queryParams: { queryParams: {
companyTypeId:"",
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId:null, projectId: null,
subDeptId:null, subDeptId: null,
state:'', state: '',
}, },
// //
form: {}, form: {},
// //
rules: { rules: {
}, },
projectOptions: [], projectOptions: [],
depts: [], depts: [],
prjDisabled:false, prjDisabled: false,
cfgList:[], cfgList: [],
}; };
}, },
created() { created() {
this.$api.publics.getMyProjectList({}).then((response) => { this.$api.publics.getMyProjectList({}).then((response) => {
this.projectOptions = response.rows; this.projectOptions = response.rows;
}); });
listAttendanceConfig({pageNum:1,pageSize:100}).then(d=>{ listAttendanceConfig({ pageNum: 1, pageSize: 100 }).then(d => {
this.cfgList=d.rows||[]; this.cfgList = d.rows || [];
}); });
}, },
methods: { methods: {
initMe(prj){ initMe(prj) {
this.queryParams.projectId=prj.id; this.queryParams.projectId = prj.id;
this.prjDisabled=true; this.prjDisabled = true;
this.doQuerySub(true); this.doQuerySub(true);
}, },
doQuerySub(init) { doQuerySub(init) {
this.queryParams.state=""; this.queryParams.state = "";
let tmps = this.prjDept2 && this.prjDept2[this.queryParams.projectId] ? this.prjDept2[this.queryParams.projectId] || [] : []; let tmps = this.prjDept2 && this.prjDept2[this.queryParams.projectId] ? this.prjDept2[this.queryParams.projectId] || [] : [];
if (tmps.length > 0) { if (tmps.length > 0) {
this.depts = tmps; this.depts = tmps;
@ -149,7 +159,7 @@ export default {
} else { } else {
this.queryParams.subDeptId = ''; this.queryParams.subDeptId = '';
} }
if(init){ if (init) {
this.getList(); this.getList();
} }
return; return;
@ -169,7 +179,7 @@ export default {
} else { } else {
this.queryParams.subDeptId = ''; this.queryParams.subDeptId = '';
} }
if(init){ if (init) {
this.getList(); this.getList();
} }
}); });
@ -178,21 +188,21 @@ export default {
getList() { getList() {
debugger debugger
this.loading = true; this.loading = true;
let tmps=this.cfgList.filter(d=>d.projectId==this.queryParams.projectId && d.subDeptId==this.queryParams.subDeptId); let tmps = this.cfgList.filter(d => d.projectId == this.queryParams.projectId && d.subDeptId == this.queryParams.subDeptId);
let ajax=listAttendanceWorker(this.queryParams); let ajax = listAttendanceWorker(this.queryParams);
if(tmps.length>0 && tmps[0].vendorsCode=='jgw'){ if (tmps.length > 0 && tmps[0].vendorsCode == 'jgw') {
ajax=listJgwAttendanceWorker(this.queryParams) ajax = listJgwAttendanceWorker(this.queryParams)
} }
ajax.then(response => { ajax.then(response => {
this.attendanceWorkerList = (response.rows||[]).map(it=>{ this.attendanceWorkerList = (response.rows || []).map(it => {
it.enterDate=it.enterDate?new Date(it.enterDate*1):null; it.enterDate = it.enterDate ? new Date(it.enterDate * 1) : null;
return it; return it;
}); });
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
@ -222,7 +232,7 @@ export default {
this.open = true; this.open = true;
this.title = "修改考勤人员基本属性"; this.title = "修改考勤人员基本属性";
}); });
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;

View File

@ -22,6 +22,7 @@ public class SurProjectAttendanceUser extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** */ /** */
private Long id; private Long id;

View File

@ -104,8 +104,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDel != null "> and u.is_del = #{isDel}</if> <if test="isDel != null "> and u.is_del = #{isDel}</if>
</select> </select>
<select id="selectSurProjectAttendanceUserList" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult"> <select id="selectSurProjectAttendanceUserList" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
<include refid="selectSurProjectAttendanceUserVo"/> SELECT * FROM (
<where> SELECT a.*,b.project_id,b.sub_dept_id,g.companyTypeId
FROM sur_project_attendance_user a,sur_project_attendance_cfg b,sur_project_attendance_group g
WHERE a.cfgid=b.id and a.companyId=g.companyId)
sur_project_attendance_user
<where>
<if test="companyTypeId!=null">
<if test="companyTypeId>100">
<if test="companyTypeId==101">
and companyTypeId in (1,6)
</if>
<if test="companyTypeId==102">
and companyTypeId =8
</if>
<if test="companyTypeId==103">
and companyTypeId in (0,2,3,4,5)
</if>
</if>
<if test="companyTypeId &lt;100">
and companyTypeId=#{companyTypeId}
</if>
</if>
<if test="cfgid != null "> and cfgid = #{cfgid}</if> <if test="cfgid != null "> and cfgid = #{cfgid}</if>
<if test="appId != null "> and app_id = #{appId}</if> <if test="appId != null "> and app_id = #{appId}</if>
<if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if> <if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if>