This commit is contained in:
zzyuan 2024-10-22 15:34:59 +08:00
commit f3b0f2ff87
6 changed files with 177 additions and 63 deletions

View File

@ -259,6 +259,9 @@
// //
reset() { reset() {
this.queryForm = {}; this.queryForm = {};
const lastMonth = new Date();
lastMonth.setMonth(lastMonth.getMonth() - 1)
this.searchAttCurrentMonth = lastMonth;
this.resetForm("queryForm"); this.resetForm("queryForm");
this.getList(); this.getList();
}, },

View File

@ -379,7 +379,11 @@
reset() { reset() {
// this.searchAttCurrentMonth = ''; // this.searchAttCurrentMonth = '';
// this.queryParams.attCurrentMonth = null; // this.queryParams.attCurrentMonth = null;
this.queryForm = {}; this.queryForm = {};
const lastMonth = new Date();
lastMonth.setMonth(lastMonth.getMonth() - 1)
this.searchAttCurrentMonth = lastMonth;
this.resetForm("queryForm"); this.resetForm("queryForm");
this.getList(); this.getList();

View File

@ -25,15 +25,99 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="项目部名称" align="center" prop="orgName" :show-overflow-tooltip="true" /> <el-table-column label="项目部名称" align="center" prop="orgName" :show-overflow-tooltip="true" />
<el-table-column label="项目经理" align="center" prop="projectManager" :show-overflow-tooltip="true" /> <el-table-column label="项目经理" align="center" :show-overflow-tooltip="true">
<el-table-column label="安全员" align="center" prop="safetyOfficer" :show-overflow-tooltip="true" /> <template slot-scope="scope">
<el-table-column label="质检员" align="center" prop="qualityInspector" :show-overflow-tooltip="true" /> <div v-if="scope.row.projectManager === '兼职'"
<el-table-column label="项目总工" align="center" prop="chiefEngineer" :show-overflow-tooltip="true" /> style="color: #1890FF; cursor: pointer"
<el-table-column label="机械员" align="center" prop="mechanicalStaff" :show-overflow-tooltip="true" /> @click="handleAllocation(scope.row,1)">
<el-table-column label="资料员" align="center" prop="documentStaff" :show-overflow-tooltip="true" /> {{ scope.row.projectManager }}
<el-table-column label="施工员" align="center" prop="constructionStaff" :show-overflow-tooltip="true" /> </div>
<el-table-column label="材料员" align="center" prop="materialStaff" :show-overflow-tooltip="true" /> <span v-else>{{ scope.row.projectManager }}</span>
<el-table-column label="其他" align="center" prop="other" :show-overflow-tooltip="true" /> </template>
</el-table-column>
<el-table-column label="安全员" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<div v-if="scope.row.safetyOfficer === '兼职'"
style="color: #1890FF; cursor: pointer"
@click="handleAllocation(scope.row,2)">
{{ scope.row.safetyOfficer }}
</div>
<span v-else>{{ scope.row.safetyOfficer }}</span>
</template>
</el-table-column>
<el-table-column label="质检员" align="center" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<div v-if="scope.row.qualityInspector === '兼职'"
style="color: #1890FF; cursor: pointer"
@click="handleAllocation(scope.row,3)">
{{ scope.row.qualityInspector }}
</div>
<span v-else>{{ scope.row.qualityInspector }}</span>
</template>
</el-table-column>
<el-table-column label="项目总工" align="center" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<div v-if="scope.row.chiefEngineer === '兼职'"
style="color: #1890FF; cursor: pointer"
@click="handleAllocation(scope.row,4)">
{{ scope.row.chiefEngineer }}
</div>
<span v-else>{{ scope.row.chiefEngineer }}</span>
</template>
</el-table-column>
<el-table-column label="机械员" align="center" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<div v-if="scope.row.mechanicalStaff === '兼职'"
style="color: #1890FF; cursor: pointer"
@click="handleAllocation(scope.row,5)" v-hasPermi="['dept:eight:query']">
{{ scope.row.mechanicalStaff }}
</div>
<span v-else>{{ scope.row.mechanicalStaff }}</span>
</template>
</el-table-column>
<el-table-column label="资料员" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<div v-if="scope.row.documentStaff === '兼职'"
style="color: #1890FF; cursor: pointer"
@click="handleAllocation(scope.row,6)">
{{ scope.row.documentStaff }}
</div>
<span v-else>{{ scope.row.documentStaff }}</span>
</template>
</el-table-column>
<el-table-column label="施工员" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<div v-if="scope.row.constructionStaff === '兼职'"
style="color: #1890FF; cursor: pointer"
@click="handleAllocation(scope.row,7)">
{{ scope.row.constructionStaff }}
</div>
<span v-else>{{ scope.row.constructionStaff }}</span>
</template>
</el-table-column>
<el-table-column label="材料员" align="center" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<div v-if="scope.row.materialStaff === '兼职'"
style="color: #1890FF; cursor: pointer"
@click="handleAllocation(scope.row,8)">
{{ scope.row.materialStaff }}
</div>
<span v-else>{{ scope.row.materialStaff }}</span>
</template>
</el-table-column>
<el-table-column label="其他" align="center" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<div v-if="scope.row.other === '兼职'"
style="color: #1890FF; cursor: pointer"
@click="handleAllocation(scope.row,9)">
{{ scope.row.other }}
</div>
<span v-else>{{ scope.row.other }}</span>
</template>
</el-table-column>
</el-table> </el-table>
@ -46,39 +130,31 @@
/> />
<!-- 添加或修改参数配置对话框 --> <!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="650px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="部门名称" prop="orgName"> <!-- 使用v-for遍历MoreOrgDataList -->
<el-input v-model="form.orgName" :disabled="true" /> <el-row v-for="(item, index) in MoreOrgDataList" :key="index">
<el-col :span="12">
<el-form-item label="兼职人员:" prop="orgName" label-width="90px">
<el-input :value="item.userName" :disabled="true" />
</el-form-item> </el-form-item>
<el-form-item label="角色名称" prop="deptRoleName"> </el-col>
<el-input v-model="form.deptRoleName" :disabled="true" /> <el-col :span="12">
</el-form-item> <el-form-item label="兼职角色:" prop="deptRoleName" label-width="90px">
<el-input :value="item.deptRoleName" :disabled="true" />
<el-form-item label="人员" >
<el-tree
class="tree-border"
:data="staffOptions"
show-checkbox
ref="staff"
node-key="id"
empty-text="加载中,请稍候"
:props="defaultProps"
default-expand-all
:default-checked-keys="defaultCheckedKeys"
></el-tree>
</el-form-item> </el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer" align="center">
<el-button type="primary" @click="submitForm"> </el-button> <el-button @click="cancels">关闭</el-button>
<el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import {getOrgEightRoleDetail} from "@/api/process/eightMembers"; import {getOrgEightRoleDetail,getMoreOrgData} from "@/api/process/eightMembers";
import { treeselect as staffTreeselect, roleStaffTreeselect } from "@/api/process/tree"; import { treeselect as staffTreeselect, roleStaffTreeselect } from "@/api/process/tree";
@ -100,6 +176,7 @@ export default {
total: 0, total: 0,
// //
typeList: [], typeList: [],
MoreOrgDataList:[],
// //
title: "", title: "",
// //
@ -111,6 +188,7 @@ export default {
parentOrgName:undefined, parentOrgName:undefined,
lackOrgId:this.$route.query.lackOrgId lackOrgId:this.$route.query.lackOrgId
}, },
paramsQuery:{},
// //
staffOptions: [], staffOptions: [],
// id // id
@ -161,21 +239,29 @@ export default {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
/** 分配人员按钮操作 */ /** 按钮操作 */
handleAllocation(row) { handleAllocation(row,deptRoleId) {
this.reset(); this.reset();
this.getStaffTreeselect(row); this.getDialogData(row,deptRoleId);
this.form = row; this.form = row;
this.open = true; this.open = true;
this.title = "分配人员";
}, },
/** 查询员工树结构 */ /** 查询员工树结构 */
getStaffTreeselect(data) { getDialogData(data,deptRoleId) {
staffTreeselect(data).then(response => { console.log(data.orgId)
this.staffOptions = response.data; this.paramsQuery={
orgId:data.orgId,
deptRoleId:deptRoleId
}
getMoreOrgData(this.paramsQuery).then(response => {
this.MoreOrgDataList = response.data;
}); });
}, },
cancels(){
this.open = false;
this.MoreOrgDataList=[];
},
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function() {

View File

@ -291,7 +291,7 @@ export default {
openReason: false, openReason: false,
dialogList:[], dialogList:[],
// //
dateRange: this.getDefaultDateRange(), dateRange:[],
reasonStr:undefined, reasonStr:undefined,
deptOptions: [], deptOptions: [],
// //
@ -309,15 +309,33 @@ export default {
console.log(this.$route.query.param) console.log(this.$route.query.param)
this.queryParams.userName=this.$route.query.param this.queryParams.userName=this.$route.query.param
} }
this.getWeekDates();
this.getDeptList(); this.getDeptList();
this.getList(); this.getList();
}, },
methods: { methods: {
getDefaultDateRange() { getWeekDates() {
const today = new Date(); const now = new Date();
const start = new Date(today.toISOString().split('T')[0]); // const dayOfWeek = now.getDay();
const end = new Date(today.toISOString().split('T')[0]); // const dayOffset = dayOfWeek === 0 ? -6 : 1 - dayOfWeek;
return [start, end];
const monday = new Date(now);
monday.setDate(monday.getDate() + dayOffset);
const sunday = new Date(monday);
sunday.setDate(sunday.getDate() + 6);
this.dateRange[0]=monday.toISOString().split('T')[0];
this.dateRange[1]=sunday.toISOString().split('T')[0];
},
formatDate(dateString){
const date = new Date(dateString); //
const year = date.getFullYear(); //
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
const day = String(date.getDate()).padStart(2, '0'); //
const weekdays = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']; //
const weekday = weekdays[date.getDay()]; //
return `${year}-${month}-${day} ${weekday}`; //
}, },
getDeptList() { getDeptList() {
listDept().then(response => { listDept().then(response => {
@ -360,6 +378,7 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.getWeekDates();
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },

View File

@ -391,8 +391,10 @@
// //
openRecord(row,titleBoss){ openRecord(row,titleBoss){
this.id = row.id; this.id = row.id;
this.title = titleBoss; this.title = titleBoss;
this.queryRecord.userId = row.userId; this.queryRecord.userId = row.userId;
this.queryRecord.orgId = row.orgId;
this.queryRecord.attCurrent = row.attCurrentMonth; this.queryRecord.attCurrent = row.attCurrentMonth;
if(titleBoss=='打卡记录'){ if(titleBoss=='打卡记录'){
this.queryRecord.attStatis=1; this.queryRecord.attStatis=1;