施工人员黑名单后端逻辑优化,增加前端页面
This commit is contained in:
@ -12,6 +12,11 @@
|
||||
<el-option v-for="item in contractorOpt" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班组" prop="contractorId">
|
||||
<el-select v-model="queryParams.teamId" clearable placeholder="请选择班组">
|
||||
<el-option v-for="item in projectTeamOpt" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工种" prop="typeOfWork">
|
||||
<el-select v-model="queryParams.typeOfWork" clearable placeholder="请选择工种">
|
||||
<el-option v-for="item in type_of_work" :key="item.value" :label="item.label" :value="item.value" />
|
||||
@ -71,16 +76,15 @@
|
||||
{{ getTeamName(scope.row.teamId) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status" />
|
||||
<el-table-column label="联系电话" align="center" prop="phone" />
|
||||
<el-table-column label="联系电话" align="center" prop="phone" min-width="120" />
|
||||
<el-table-column label="性别" align="center" prop="sex">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="user_sex_type" :value="scope.row.sex" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="民族" align="center" prop="nation" />
|
||||
<el-table-column label="身份证号码" align="center" prop="sfzNumber" />
|
||||
<el-table-column label="工种" align="center" prop="typeOfWork">
|
||||
<el-table-column label="身份证号码" align="center" prop="sfzNumber" min-width="180" />
|
||||
<el-table-column label="工种" align="center" prop="typeOfWork" min-width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="type_of_work" :value="scope.row.typeOfWork" />
|
||||
</template>
|
||||
@ -90,11 +94,16 @@
|
||||
<dict-tag :options="user_clock_type" :value="scope.row.clock" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入场时间" align="center" prop="entryDate" />
|
||||
<el-table-column label="离场时间" align="center" prop="leaveDate" />
|
||||
<el-table-column label="入场时间" align="center" prop="entryDate" min-width="180" />
|
||||
<el-table-column label="离场时间" align="center" prop="leaveDate" min-width="180" />
|
||||
<el-table-column label="薪水" align="center" prop="salary" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
{{ scope.row.status == 0 ? '在职' : '离职' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" min-width="300">
|
||||
<template #default="scope">
|
||||
<el-space wrap>
|
||||
<el-button link type="primary" icon="View" @click="handleShowDrawer(scope.row)" v-hasPermi="['project:constructionUser:query']">
|
||||
@ -103,6 +112,9 @@
|
||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['project:constructionUser:edit']">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button link type="danger" icon="Avatar" @click="handleJoinBlacklist(scope.row)" v-hasPermi="['project:constructionBlacklist:add']">
|
||||
黑名单
|
||||
</el-button>
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['project:constructionUser:remove']">
|
||||
删除
|
||||
</el-button>
|
||||
@ -271,7 +283,7 @@ import { listProjectTeam } from '@/api/project/projectTeam';
|
||||
import { ContractorVO } from '@/api/project/contractor/types';
|
||||
import { ProjectTeamVO } from '@/api/project/projectTeam/types';
|
||||
import ConstructionUserDetail from '@/views/project/constructionUser/component/ConstructionUserDetail.vue';
|
||||
import ProjectTypes from '@/utils/propTypes';
|
||||
import { addConstructionBlacklist } from '@/api/project/constructionBlacklist';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { type_of_work, user_sex_type, user_clock_type } = toRefs<any>(proxy?.useDict('type_of_work', 'user_sex_type', 'user_clock_type'));
|
||||
@ -494,6 +506,17 @@ const submitForm = () => {
|
||||
});
|
||||
};
|
||||
|
||||
/** 加入黑名单按钮操作 */
|
||||
const handleJoinBlacklist = async (row?: ConstructionUserVO) => {
|
||||
await proxy?.$modal.confirm('确认要将该员工加入黑名单吗?').finally(() => (loading.value = false));
|
||||
await addConstructionBlacklist({
|
||||
userId: row.id,
|
||||
projectId: currentProject.value.id
|
||||
});
|
||||
proxy?.$modal.msgSuccess('加入成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: ConstructionUserVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
|
Reference in New Issue
Block a user