10 changed files with 1266 additions and 23 deletions
@ -0,0 +1,53 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询施工单位管理人员考勤信息列表
|
|||
export function listConstructionAttendance(query) { |
|||
return request({ |
|||
url: '/build/constructionAttendance/list', |
|||
method: 'post', |
|||
data: query |
|||
}) |
|||
} |
|||
|
|||
// 查询施工单位管理人员考勤信息详细
|
|||
export function getConstructionAttendance(id) { |
|||
return request({ |
|||
url: '/build/constructionAttendance/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增施工单位管理人员考勤信息
|
|||
export function addConstructionAttendance(data) { |
|||
return request({ |
|||
url: '/build/constructionAttendance', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改施工单位管理人员考勤信息
|
|||
export function updateConstructionAttendance(data) { |
|||
return request({ |
|||
url: '/build/constructionAttendance', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除施工单位管理人员考勤信息
|
|||
export function delConstructionAttendance(id) { |
|||
return request({ |
|||
url: '/build/constructionAttendance/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
|
|||
// 导出施工单位管理人员考勤信息
|
|||
export function exportConstructionAttendance(query) { |
|||
return request({ |
|||
url: '/build/constructionAttendance/export', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
@ -0,0 +1,53 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询监管单位管理人员列表
|
|||
export function listSupervisoryUnitManagement(query) { |
|||
return request({ |
|||
url: '/build/supervisoryUnitManagement/list', |
|||
method: 'post', |
|||
data: query |
|||
}) |
|||
} |
|||
|
|||
// 查询监管单位管理人员详细
|
|||
export function getSupervisoryUnitManagement(id) { |
|||
return request({ |
|||
url: '/build/supervisoryUnitManagement/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增监管单位管理人员
|
|||
export function addSupervisoryUnitManagement(data) { |
|||
return request({ |
|||
url: '/build/supervisoryUnitManagement', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改监管单位管理人员
|
|||
export function updateSupervisoryUnitManagement(data) { |
|||
return request({ |
|||
url: '/build/supervisoryUnitManagement', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除监管单位管理人员
|
|||
export function delSupervisoryUnitManagement(id) { |
|||
return request({ |
|||
url: '/build/supervisoryUnitManagement/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
|
|||
// 导出监管单位管理人员
|
|||
export function exportSupervisoryUnitManagement(query) { |
|||
return request({ |
|||
url: '/build/supervisoryUnitManagement/export', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
@ -0,0 +1,53 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询监理单位管理人员考勤信息列表
|
|||
export function listSupervisorAttendance(query) { |
|||
return request({ |
|||
url: '/build/supervisorAttendance/list', |
|||
method: 'post', |
|||
data: query |
|||
}) |
|||
} |
|||
|
|||
// 查询监理单位管理人员考勤信息详细
|
|||
export function getSupervisorAttendance(id) { |
|||
return request({ |
|||
url: '/build/supervisorAttendance/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增监理单位管理人员考勤信息
|
|||
export function addSupervisorAttendance(data) { |
|||
return request({ |
|||
url: '/build/supervisorAttendance', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改监理单位管理人员考勤信息
|
|||
export function updateSupervisorAttendance(data) { |
|||
return request({ |
|||
url: '/build/supervisorAttendance', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除监理单位管理人员考勤信息
|
|||
export function delSupervisorAttendance(id) { |
|||
return request({ |
|||
url: '/build/supervisorAttendance/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
|
|||
// 导出监理单位管理人员考勤信息
|
|||
export function exportSupervisorAttendance(query) { |
|||
return request({ |
|||
url: '/build/supervisorAttendance/export', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
@ -0,0 +1,178 @@ |
|||
<template> |
|||
<div> |
|||
<el-select |
|||
v-if="isMultiple" |
|||
v-model="form.wagaCodes" |
|||
:placeholder="'请选择' + nameType" |
|||
style="width: 100%" |
|||
v-scroll="selectSearch" |
|||
filterable |
|||
clearable |
|||
remote |
|||
reserve-keyword |
|||
:remote-method="remoteMethod" |
|||
:loading="loading" |
|||
@change="handleChange" |
|||
multiple |
|||
> |
|||
<el-option |
|||
v-for="dict in wagaNameOptions" |
|||
:key="dict.id" |
|||
:label="dict.wagaName" |
|||
:value="dict.wagaCode" |
|||
@click.native="chooseDike(dict)" |
|||
></el-option> |
|||
</el-select> |
|||
<el-select |
|||
v-else |
|||
v-model="form.wagaCode" |
|||
:placeholder="'请选择' + nameType" |
|||
style="width: 100%" |
|||
v-scroll="selectSearch" |
|||
filterable |
|||
clearable |
|||
remote |
|||
reserve-keyword |
|||
:remote-method="remoteMethod" |
|||
:loading="loading" |
|||
@change="handleChange" |
|||
> |
|||
<el-option |
|||
v-for="dict in wagaNameOptions" |
|||
:key="dict.id" |
|||
:label="dict.wagaName" |
|||
:value="dict.wagaCode" |
|||
@click.native="chooseDike(dict)" |
|||
></el-option> |
|||
</el-select> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
// import { listJbxx, getJbxx } from "@/api/yg/jbxx"; |
|||
export default { |
|||
// props: ["form", "isMultiple"], |
|||
props: { |
|||
form: { |
|||
type: Object, |
|||
default: {}, |
|||
}, |
|||
isMultiple: { |
|||
type: Boolean, |
|||
default: false, |
|||
}, |
|||
nameType: { |
|||
type: Boolean, |
|||
default: "项目名称", |
|||
}, |
|||
formMethods: { |
|||
type: Object, |
|||
default: {}, |
|||
}, |
|||
getFields: { |
|||
type: Object, |
|||
default: {}, |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
loading: false, |
|||
wagaNameOptions: [], |
|||
// 水闸查询参数 |
|||
wagaNameQueryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
wagaName: null, |
|||
wagaCode: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
}; |
|||
}, |
|||
created() { |
|||
if (this.form.wagaName) { |
|||
this.wagaNameQueryParams.data.wagaName = this.form.wagaName; |
|||
} |
|||
this.formMethods |
|||
.list(this.wagaNameQueryParams) |
|||
.then((res) => { |
|||
// console.log(111, res); |
|||
this.wagaNameOptions = res.records; |
|||
}) |
|||
.then(() => { |
|||
// if (this.form.wagaName) { |
|||
// this.wagaNameQueryParams.data.wagaName = this.form.wagaName; |
|||
// listJbxx(this.wagaNameQueryParams).then((res) => { |
|||
// let bool = this.wagaNameOptions.some( |
|||
// (item) => item.wagaCode === res.records[0]?.wagaCode |
|||
// ); |
|||
// this.wagaNameOptions = [ |
|||
// ...(bool ? [] : res.records), |
|||
// ...this.wagaNameOptions, |
|||
// ]; |
|||
// this.wagaNameQueryParams.data.wagaName = null; |
|||
// }); |
|||
// } |
|||
}); |
|||
}, |
|||
methods: { |
|||
reset() { |
|||
this.wagaNameQueryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
wagaName: null, |
|||
wagaCode: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}; |
|||
}, |
|||
handleChange(keyWork) { |
|||
// if (!keyWork) { |
|||
this.reset(); |
|||
listJbxx(this.wagaNameQueryParams).then((res) => { |
|||
this.wagaNameOptions = res.records; |
|||
}); |
|||
// }/ |
|||
}, |
|||
remoteMethod(query) { |
|||
this.selectLoading = true; |
|||
if (query !== "") { |
|||
// console.log(444, query); |
|||
this.wagaNameQueryParams.data.wagaName = query; |
|||
} else { |
|||
this.reset(); |
|||
} |
|||
listJbxx(this.wagaNameQueryParams).then((res) => { |
|||
this.wagaNameOptions = res.records; |
|||
this.selectLoading = false; |
|||
}); |
|||
}, |
|||
selectSearch() { |
|||
this.wagaNameQueryParams.pageNum += 1; |
|||
listJbxx(this.wagaNameQueryParams).then((res) => { |
|||
// console.log(111, res); |
|||
this.wagaNameOptions = [...this.wagaNameOptions, ...res.records]; |
|||
// console.log(111, this.wagaNameOptions); |
|||
}); |
|||
}, |
|||
chooseDike(item) { |
|||
this.form.wagaName = item.wagaName; |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
@ -0,0 +1,14 @@ |
|||
export default { |
|||
scroll: { |
|||
bind (el, binding) { |
|||
const SELECTWRAP_DOM=el.querySelector(".el-select-dropdown .el-select-dropdown__wrap") |
|||
SELECTWRAP_DOM.addEventListener('scroll', function () { |
|||
const CONDITION = this.scrollHeight - this.scrollTop <= this.clientHeight |
|||
if (CONDITION) { |
|||
binding.value() |
|||
} |
|||
|
|||
}) |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,680 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<el-form |
|||
:model="queryParams" |
|||
ref="queryForm" |
|||
:inline="true" |
|||
v-show="showSearch" |
|||
> |
|||
<el-form-item label="姓名" prop="name"> |
|||
<el-input |
|||
v-model="queryParams.cv.value" |
|||
placeholder="请输入姓名" |
|||
clearable |
|||
size="small" |
|||
@keyup.enter.native="handleQuery" |
|||
> |
|||
<el-button |
|||
type="primary" |
|||
slot="append" |
|||
icon="el-icon-search" |
|||
size="small" |
|||
@click="handleQuery" |
|||
></el-button> |
|||
</el-input> |
|||
</el-form-item> |
|||
<!-- <el-form-item label="身份证号" prop="idNo"> |
|||
<el-input |
|||
v-model="queryParams.data.idNo" |
|||
placeholder="请输入身份证号" |
|||
clearable |
|||
size="small" |
|||
@keyup.enter.native="handleQuery" |
|||
> |
|||
<el-button |
|||
type="primary" |
|||
slot="append" |
|||
icon="el-icon-search" |
|||
size="small" |
|||
@click="handleQuery" |
|||
></el-button> |
|||
</el-input> |
|||
</el-form-item> --> |
|||
<!-- <el-form-item label="职务" prop="post"> |
|||
<el-select |
|||
v-model="queryParams.data.post" |
|||
placeholder="请选择职务" |
|||
clearable |
|||
size="small" |
|||
@change="handleQuery" |
|||
> |
|||
<el-option |
|||
v-for="dict in postOptions" |
|||
:key="dict.dictValue" |
|||
:label="dict.dictLabel" |
|||
:value="dict.dictValue" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> --> |
|||
<el-form-item> |
|||
<!-- <el-button |
|||
type="cyan" |
|||
icon="el-icon-search" |
|||
size="mini" |
|||
@click="handleQuery" |
|||
>搜索</el-button |
|||
> --> |
|||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery" |
|||
>重置</el-button |
|||
> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-row :gutter="10" class="mb8"> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="primary" |
|||
icon="el-icon-plus" |
|||
size="mini" |
|||
@click="handleAdd" |
|||
v-hasPermi="['build:jlProjectManagement:add']" |
|||
>新增</el-button |
|||
> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="success" |
|||
icon="el-icon-edit" |
|||
size="mini" |
|||
:disabled="single" |
|||
@click="handleUpdate" |
|||
v-hasPermi="['build:jlProjectManagement:edit']" |
|||
>修改</el-button |
|||
> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="danger" |
|||
icon="el-icon-delete" |
|||
size="mini" |
|||
:disabled="multiple" |
|||
@click="handleDelete" |
|||
v-hasPermi="['build:jlProjectManagement:remove']" |
|||
>删除</el-button |
|||
> |
|||
</el-col> |
|||
<!-- <el-col :span="1.5"> |
|||
<el-button |
|||
type="warning" |
|||
icon="el-icon-download" |
|||
size="mini" |
|||
@click="handleExport" |
|||
v-hasPermi="['build:jlProjectManagement:export']" |
|||
>导出</el-button |
|||
> |
|||
</el-col> --> |
|||
<right-toolbar |
|||
:showSearch.sync="showSearch" |
|||
@queryTable="getList" |
|||
></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table |
|||
v-loading="loading" |
|||
:data="projectManagementList" |
|||
@selection-change="handleSelectionChange" |
|||
row-key="id" |
|||
:expand-row-keys="expands" |
|||
:tree-props="{ children: 'noChildren', hasChildren: 'hasChildren' }" |
|||
> |
|||
<el-table-column type="expand" prop="children"> |
|||
<template slot-scope="props"> |
|||
<el-table v-loading="loading" :data="props.row.children"> |
|||
<el-table-column |
|||
label="序号" |
|||
type="index" |
|||
width="180" |
|||
align="center" |
|||
fixed |
|||
/> |
|||
<el-table-column |
|||
label="考勤所属年月" |
|||
align="center" |
|||
prop="attendanceYear" |
|||
min-width="150" |
|||
/> |
|||
|
|||
<el-table-column |
|||
label="考勤所属年月考勤天数" |
|||
align="center" |
|||
prop="attendanceDay" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="出勤率" |
|||
align="center" |
|||
prop="attendanceDay" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<span |
|||
>{{ |
|||
((scope.row.attendanceDay / 22) * 100).toFixed(2) |
|||
}}%</span |
|||
> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column |
|||
label="操作" |
|||
align="center" |
|||
class-name="small-padding fixed-width" |
|||
width="240" |
|||
fixed="right" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-edit" |
|||
@click="handleUpdateRecord(scope.row)" |
|||
v-hasPermi="['build:supervisorAttendance:edit']" |
|||
>修改</el-button |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDeleteRecord(scope.row)" |
|||
v-hasPermi="['build:supervisorAttendance:remove']" |
|||
>删除</el-button |
|||
> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column type="selection" width="55" align="center" /> |
|||
<el-table-column label="序号" type="index" width="50" align="center" /> |
|||
|
|||
<el-table-column |
|||
label="姓名" |
|||
align="center" |
|||
prop="name" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="手机号码" |
|||
align="center" |
|||
prop="phone" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="身份证号" |
|||
align="center" |
|||
prop="idNo" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="职务" |
|||
align="center" |
|||
prop="post" |
|||
:formatter="postFormat" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="操作" |
|||
align="center" |
|||
class-name="small-padding fixed-width" |
|||
width="180" |
|||
fixed="right" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-edit" |
|||
@click="handleUpdate(scope.row)" |
|||
v-hasPermi="['build:jlProjectManagement:edit']" |
|||
>修改</el-button |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-plus" |
|||
@click="handleAddRecord(scope.row)" |
|||
v-hasPermi="['build:jlProjectManagement:addRecord']" |
|||
>新增考勤记录</el-button |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['build:jlProjectManagement: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="1200px" |
|||
append-to-body |
|||
:close-on-click-modal="false" |
|||
> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
|||
<el-form-item label="姓名" prop="name"> |
|||
<el-input v-model="form.name" placeholder="请输入姓名" /> |
|||
</el-form-item> |
|||
<el-form-item label="手机号码" prop="phone"> |
|||
<el-input v-model="form.phone" placeholder="请输入手机号码" /> |
|||
</el-form-item> |
|||
<el-form-item label="身份证号" prop="idNo"> |
|||
<el-input v-model="form.idNo" placeholder="请输入身份证号" /> |
|||
</el-form-item> |
|||
<el-form-item label="职务" prop="post"> |
|||
<el-select |
|||
v-model="form.post" |
|||
placeholder="请选择职务" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in postOptions" |
|||
:key="dict.dictValue" |
|||
:label="dict.dictLabel" |
|||
:value="dict.dictValue" |
|||
></el-option> |
|||
</el-select> |
|||
</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-dialog |
|||
:title="recordTitle" |
|||
:visible.sync="recordOpen" |
|||
width="1200px" |
|||
append-to-body |
|||
:close-on-click-modal="false" |
|||
@close="recordClose" |
|||
> |
|||
<el-form |
|||
ref="recordForm" |
|||
:model="recordForm" |
|||
:rules="recordRules" |
|||
label-width="180px" |
|||
> |
|||
<el-form-item label="名字" prop="name"> |
|||
<el-input |
|||
v-model="recordForm.name" |
|||
placeholder="请输入名字" |
|||
disabled |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="身份证号码" prop="idNo"> |
|||
<el-input |
|||
v-model="recordForm.idNo" |
|||
placeholder="请输入身份证号码" |
|||
disabled |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="考勤所属年月" prop="attendanceYear"> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
v-model="recordForm.attendanceYear" |
|||
type="month" |
|||
value-format="yyyy-MM" |
|||
placeholder="选择考勤所属年月" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="考勤所属年月考勤天数" prop="attendanceDay"> |
|||
<el-input |
|||
v-model="recordForm.attendanceDay" |
|||
placeholder="请输入考勤所属年月考勤天数" |
|||
> |
|||
<template slot="append">天</template> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="recordSubmitForm">确 定</el-button> |
|||
<el-button @click="recordCancel">取 消</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
listSupervisoryUnitManagement, |
|||
getSupervisoryUnitManagement, |
|||
delSupervisoryUnitManagement, |
|||
addSupervisoryUnitManagement, |
|||
updateSupervisoryUnitManagement, |
|||
exportSupervisoryUnitManagement, |
|||
} from "@/api/build/jlProjectManagement"; |
|||
import { |
|||
listSupervisorAttendance, |
|||
getSupervisorAttendance, |
|||
delSupervisorAttendance, |
|||
addSupervisorAttendance, |
|||
updateSupervisorAttendance, |
|||
exportSupervisorAttendance, |
|||
} from "@/api/build/supervisorAttendance"; |
|||
|
|||
export default { |
|||
name: "ProjectManagement", |
|||
props: ["proNo", "proCode"], |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 项目管理人员表格数据 |
|||
projectManagementList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
recordTitle: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
recordOpen: false, |
|||
// 职务字典 |
|||
postOptions: [], |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
name: null, |
|||
phone: null, |
|||
idNo: null, |
|||
post: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
cv: { name: "name", value: "", type: "like" }, |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
name: [{ required: true, message: "请输入姓名", trigger: "blur" }], |
|||
phone: [{ required: true, message: "请输入手机号", trigger: "blur" }], |
|||
idNo: [{ required: true, message: "请输入身份证", trigger: "blur" }], |
|||
}, |
|||
recordForm: {}, |
|||
recordRules: { |
|||
name: [{ required: true, message: "请输入姓名", trigger: "blur" }], |
|||
idNo: [{ required: true, message: "请输入身份证", trigger: "blur" }], |
|||
attendanceYear: [ |
|||
{ required: true, message: "请选择考勤年月", trigger: "blur" }, |
|||
], |
|||
attendanceDay: [ |
|||
{ required: true, message: "请输入考勤年月天数", trigger: "blur" }, |
|||
{ |
|||
pattern: /(^[0-9]$)|(^[1-2][0-9]$)|(^30$)/, |
|||
message: "请输入0-30正整数,包含0", |
|||
trigger: "blur", |
|||
}, |
|||
], |
|||
}, |
|||
expands: [], |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
this.getDicts("project_management_position").then((response) => { |
|||
this.postOptions = response.data; |
|||
}); |
|||
}, |
|||
methods: { |
|||
handleAddRecord(row) { |
|||
this.recordOpen = true; |
|||
this.recordTitle = "添加人员考勤记录"; |
|||
this.recordForm.idNo = row.idNo; |
|||
this.recordForm.name = row.name; |
|||
}, |
|||
handleUpdateRecord(row) { |
|||
const id = row.id || this.ids; |
|||
getSupervisorAttendance(id).then((response) => { |
|||
this.recordForm = response.data; |
|||
this.recordOpen = true; |
|||
this.recordTitle = "修改人员考勤记录"; |
|||
}); |
|||
}, |
|||
recordSubmitForm() { |
|||
this.$refs["recordForm"].validate((valid) => { |
|||
if (valid) { |
|||
if (this.recordForm.id != null) { |
|||
updateSupervisorAttendance(this.recordForm).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.recordOpen = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
this.recordForm.proNo = this.proNo; |
|||
this.recordForm.proCode = this.proCode; |
|||
addSupervisorAttendance(this.recordForm).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("新增成功"); |
|||
this.recordOpen = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
recordCancel() { |
|||
this.recordOpen = false; |
|||
}, |
|||
recordClose() { |
|||
this.recordForm = {}; |
|||
}, |
|||
/** 查询项目管理人员列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
this.queryParams.data.proNo = this.proNo; |
|||
this.queryParams.data.proCode = this.proCode; |
|||
listSupervisoryUnitManagement(this.queryParams).then((response) => { |
|||
this.projectManagementList = response.records; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
// 职务字典翻译 |
|||
postFormat(row, column) { |
|||
return this.selectDictLabel(this.postOptions, row.post); |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.form = { |
|||
id: null, |
|||
name: null, |
|||
phone: null, |
|||
idNo: null, |
|||
post: null, |
|||
proNo: null, |
|||
prCodeo: null, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
id: null, |
|||
name: null, |
|||
phone: null, |
|||
idNo: null, |
|||
post: null, |
|||
proNo: null, |
|||
prCodeo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
cv: { name: "name", value: "", type: "like" }, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
/** 搜索按钮操作 */ |
|||
handleQuery() { |
|||
this.queryParams.pageNum = 1; |
|||
this.getList(); |
|||
}, |
|||
/** 重置按钮操作 */ |
|||
resetQuery() { |
|||
this.resetQueryForm(); |
|||
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; |
|||
getSupervisoryUnitManagement(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) { |
|||
updateSupervisoryUnitManagement(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
this.form.proNo = this.proNo; |
|||
this.form.proCode = this.proCode; |
|||
addSupervisoryUnitManagement(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("新增成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
/** 删除按钮操作 */ |
|||
handleDelete(row) { |
|||
const ids = row.id || this.ids; |
|||
if (ids) { |
|||
this.$confirm("是否删除选中的数据?", "警告", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}) |
|||
.then(function () { |
|||
return delSupervisoryUnitManagement(ids); |
|||
}) |
|||
.then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}) |
|||
.catch(function () {}); |
|||
} else { |
|||
this.$message.warning("请选择要删除的数据!!"); |
|||
} |
|||
}, |
|||
/** 导出按钮操作 */ |
|||
handleExport() { |
|||
const queryParams = this.queryParams; |
|||
let message = "是否确认导出所有的数据项?"; |
|||
if (this.ids) { |
|||
message = "是否确认导出选中的数据项?"; |
|||
queryParams.ids = this.ids; |
|||
} |
|||
this.$confirm(message, "警告", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}) |
|||
.then(function () { |
|||
return exportSupervisoryUnitManagement(queryParams); |
|||
}) |
|||
.then((response) => { |
|||
this.downloadFile(response, true, response.msg); |
|||
// this.download(response.msg); |
|||
}) |
|||
.catch(function () {}); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
@import "@/assets/css/dialog.scss"; |
|||
//::v-deep { |
|||
// .el-dialog { |
|||
// margin-top: 10vh !important; |
|||
// } |
|||
//} |
|||
</style> |
Loading…
Reference in new issue