部门管理新增分包单位选项
This commit is contained in:
@ -23,7 +23,7 @@ import { AttendanceMonthVO } from '../attendance/types';
|
||||
|
||||
export const listConstructionMonth = (query?: ConstructionMonthQuery): AxiosPromise<AttendanceMonthVO[]> => {
|
||||
return request({
|
||||
url: '/project/constructionUser/list/attendance/month',
|
||||
url: '/contractor/constructionUser/list/attendance/month',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
@ -36,7 +36,7 @@ export const listConstructionMonth = (query?: ConstructionMonthQuery): AxiosProm
|
||||
|
||||
export const listConstructionUser = (query?: ConstructionUserQuery): AxiosPromise<ConstructionUserVO[]> => {
|
||||
return request({
|
||||
url: '/project/constructionUser/list',
|
||||
url: '/contractor/constructionUser/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
@ -48,7 +48,7 @@ export const listConstructionUser = (query?: ConstructionUserQuery): AxiosPromis
|
||||
*/
|
||||
export const getConstructionUser = (id: string | number): AxiosPromise<ConstructionUserVO> => {
|
||||
return request({
|
||||
url: '/project/constructionUser/' + id,
|
||||
url: '/contractor/constructionUser/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
@ -59,7 +59,7 @@ export const getConstructionUser = (id: string | number): AxiosPromise<Construct
|
||||
*/
|
||||
export const transferConstructionUser = (data: skipType) => {
|
||||
return request({
|
||||
url: '/project/constructionUser/change/project',
|
||||
url: '/contractor/constructionUser/change/project',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
@ -81,7 +81,7 @@ export const getProjectContractorList = () => {
|
||||
*/
|
||||
export const addConstructionUser = (data: ConstructionUserForm): AxiosPromise<string | number> => {
|
||||
return request({
|
||||
url: '/project/constructionUser',
|
||||
url: '/contractor/constructionUser',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
@ -93,7 +93,7 @@ export const addConstructionUser = (data: ConstructionUserForm): AxiosPromise<st
|
||||
*/
|
||||
export const updateConstructionUser = (data: ConstructionUserForm) => {
|
||||
return request({
|
||||
url: '/project/constructionUser',
|
||||
url: '/contractor/constructionUser',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
@ -105,7 +105,7 @@ export const updateConstructionUser = (data: ConstructionUserForm) => {
|
||||
*/
|
||||
export const delConstructionUser = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/project/constructionUser/' + id,
|
||||
url: '/contractor/constructionUser/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
@ -116,7 +116,7 @@ export const delConstructionUser = (id: string | number | Array<string | number>
|
||||
*/
|
||||
export const updateConstructionUserStatus = (data: ConstructionUserStatusForm) => {
|
||||
return request({
|
||||
url: '/project/constructionUser/batch/status',
|
||||
url: '/contractor/constructionUser/batch/status',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
@ -128,7 +128,7 @@ export const updateConstructionUserStatus = (data: ConstructionUserStatusForm) =
|
||||
*/
|
||||
export const updateConstructionUserPlayCardStatus = (data: ConstructionUserPlayCardForm) => {
|
||||
return request({
|
||||
url: '/project/constructionUser/batch/clock',
|
||||
url: '/contractor/constructionUser/batch/clock',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
@ -140,7 +140,7 @@ export const updateConstructionUserPlayCardStatus = (data: ConstructionUserPlayC
|
||||
*/
|
||||
export const updateConstructionUserPlayCardOneStatus = (data: ConstructionUserPlayCardForm) => {
|
||||
return request({
|
||||
url: '/project/constructionUser/clock',
|
||||
url: '/contractor/constructionUser/clock',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
@ -152,7 +152,7 @@ export const updateConstructionUserPlayCardOneStatus = (data: ConstructionUserPl
|
||||
*/
|
||||
export const updateConstructionUserSalary = (data: ConstructionUserSalaryForm) => {
|
||||
return request({
|
||||
url: '/project/constructionUser/salary',
|
||||
url: '/contractor/constructionUser/salary',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
@ -164,7 +164,7 @@ export const updateConstructionUserSalary = (data: ConstructionUserSalaryForm) =
|
||||
*/
|
||||
export const getConstructionUserExit = (query: ConstructionUserExitForm) => {
|
||||
return request({
|
||||
url: '/project/constructionUserExit/list',
|
||||
url: '/contractor/constructionUserExit/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
@ -177,7 +177,7 @@ export const getConstructionUserExit = (query: ConstructionUserExitForm) => {
|
||||
export const dowloadConstructionUserTemplate = (query: ConstructionUserTemplateForm) => {
|
||||
let { projectId } = query;
|
||||
const fileName = projectId + '_project.zip';
|
||||
return download('/project/constructionUserFile/exportFileTemplate', query, fileName);
|
||||
return download('/contractor/constructionUserFile/exportFileTemplate', query, fileName);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -186,7 +186,7 @@ export const dowloadConstructionUserTemplate = (query: ConstructionUserTemplateF
|
||||
*/
|
||||
export const delConstructionUserMember = (data: ConstructionUserMembeForm) => {
|
||||
return request({
|
||||
url: '/project/projectTeamMember/',
|
||||
url: '/contractor/projectTeamMember/',
|
||||
method: 'delete',
|
||||
data
|
||||
});
|
||||
@ -198,7 +198,7 @@ export const delConstructionUserMember = (data: ConstructionUserMembeForm) => {
|
||||
*/
|
||||
export const importConstructionUserInfo = (file: string) => {
|
||||
return request({
|
||||
url: '/project/constructionUserFile/upload/zip',
|
||||
url: '/contractor/constructionUserFile/upload/zip',
|
||||
method: 'post',
|
||||
data: { file }
|
||||
});
|
||||
|
@ -10,7 +10,7 @@ import { ContractorForm, ContractorQuery, ContractorVO } from '@/api/project/con
|
||||
|
||||
export const listContractor = (query?: ContractorQuery): AxiosPromise<ContractorVO[]> => {
|
||||
return request({
|
||||
url: '/project/contractor/list',
|
||||
url: '/contractor/contractor/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
@ -22,7 +22,7 @@ export const listContractor = (query?: ContractorQuery): AxiosPromise<Contractor
|
||||
*/
|
||||
export const getContractor = (id: string | number): AxiosPromise<ContractorVO> => {
|
||||
return request({
|
||||
url: '/project/contractor/' + id,
|
||||
url: '/contractor/contractor/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
@ -33,7 +33,7 @@ export const getContractor = (id: string | number): AxiosPromise<ContractorVO> =
|
||||
*/
|
||||
export const addContractor = (data: ContractorForm): AxiosPromise<string | number> => {
|
||||
return request({
|
||||
url: '/project/contractor',
|
||||
url: '/contractor/contractor',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
@ -45,7 +45,7 @@ export const addContractor = (data: ContractorForm): AxiosPromise<string | numbe
|
||||
*/
|
||||
export const updateContractor = (data: ContractorForm) => {
|
||||
return request({
|
||||
url: '/project/contractor',
|
||||
url: '/contractor/contractor',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
@ -57,7 +57,7 @@ export const updateContractor = (data: ContractorForm) => {
|
||||
*/
|
||||
export const delContractor = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/project/contractor/' + id,
|
||||
url: '/contractor/contractor/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { ContractorMaterialVO, ContractorMaterialForm, ContractorMaterialQuery } from '@/api/contractor/contractorMaterial/types';
|
||||
import { ContractorMaterialVO, ContractorMaterialForm, ContractorMaterialQuery } from '@/api/project/contractorMaterial/types';
|
||||
|
||||
/**
|
||||
* 查询分包方物料列表
|
||||
|
@ -10,7 +10,7 @@ import { ContractorToolVO, ContractorToolForm, ContractorToolQuery } from '@/api
|
||||
|
||||
export const listContractorTool = (query?: ContractorToolQuery): AxiosPromise<ContractorToolVO[]> => {
|
||||
return request({
|
||||
url: '/project/contractorTool/list',
|
||||
url: '/contractor/contractorTool/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
@ -22,7 +22,7 @@ export const listContractorTool = (query?: ContractorToolQuery): AxiosPromise<Co
|
||||
*/
|
||||
export const getContractorTool = (id: string | number): AxiosPromise<ContractorToolVO> => {
|
||||
return request({
|
||||
url: '/project/contractorTool/' + id,
|
||||
url: '/contractor/contractorTool/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
@ -33,7 +33,7 @@ export const getContractorTool = (id: string | number): AxiosPromise<ContractorT
|
||||
*/
|
||||
export const addContractorTool = (data: ContractorToolForm) => {
|
||||
return request({
|
||||
url: '/project/contractorTool',
|
||||
url: '/contractor/contractorTool',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
@ -45,7 +45,7 @@ export const addContractorTool = (data: ContractorToolForm) => {
|
||||
*/
|
||||
export const updateContractorTool = (data: ContractorToolForm) => {
|
||||
return request({
|
||||
url: '/project/contractorTool',
|
||||
url: '/contractor/contractorTool',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
@ -57,7 +57,7 @@ export const updateContractorTool = (data: ContractorToolForm) => {
|
||||
*/
|
||||
export const delContractorTool = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/project/contractorTool/' + id,
|
||||
url: '/contractor/contractorTool/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
@ -10,7 +10,7 @@ import { SubcontractVO, SubcontractForm, SubcontractQuery } from '@/api/project/
|
||||
|
||||
export const listSubcontract = (query?: SubcontractQuery): AxiosPromise<SubcontractVO[]> => {
|
||||
return request({
|
||||
url: '/project/subcontract/list',
|
||||
url: '/contractor/subcontract/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
@ -22,7 +22,7 @@ export const listSubcontract = (query?: SubcontractQuery): AxiosPromise<Subcontr
|
||||
*/
|
||||
export const getSubcontract = (id: string | number): AxiosPromise<SubcontractVO> => {
|
||||
return request({
|
||||
url: '/project/subcontract/' + id,
|
||||
url: '/contractor/subcontract/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
@ -33,7 +33,7 @@ export const getSubcontract = (id: string | number): AxiosPromise<SubcontractVO>
|
||||
*/
|
||||
export const addSubcontract = (data: SubcontractForm) => {
|
||||
return request({
|
||||
url: '/project/subcontract',
|
||||
url: '/contractor/subcontract',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
@ -45,7 +45,7 @@ export const addSubcontract = (data: SubcontractForm) => {
|
||||
*/
|
||||
export const updateSubcontract = (data: SubcontractForm) => {
|
||||
return request({
|
||||
url: '/project/subcontract',
|
||||
url: '/contractor/subcontract',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
@ -57,7 +57,7 @@ export const updateSubcontract = (data: SubcontractForm) => {
|
||||
*/
|
||||
export const delSubcontract = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/project/subcontract/' + id,
|
||||
url: '/contractor/subcontract/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
@ -18,6 +18,17 @@ export const getDeptList = () => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询分包单位
|
||||
* @param projectId
|
||||
*/
|
||||
export const optionProjectSelect = (projectId: number | string): any => {
|
||||
return request({
|
||||
url: '/contractor/contractor/listNoDept/' + projectId,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 通过deptIds查询部门
|
||||
* @param deptIds
|
||||
|
@ -5,7 +5,7 @@ export interface DeptQuery extends PageQuery {
|
||||
deptName?: string;
|
||||
deptCategory?: string;
|
||||
status?: number;
|
||||
isSubset?: string;
|
||||
deptType?: string;
|
||||
isShow?: string;
|
||||
}
|
||||
|
||||
@ -18,6 +18,7 @@ export interface DeptVO extends BaseEntity {
|
||||
parentId: number | string;
|
||||
children: DeptVO[];
|
||||
deptId: number | string;
|
||||
projectId: number | string;
|
||||
projectList: any[];
|
||||
deptName: string;
|
||||
deptCategory: string;
|
||||
@ -52,11 +53,13 @@ export interface DeptForm {
|
||||
children?: DeptForm[];
|
||||
deptId?: number | string;
|
||||
projectId?: number | string;
|
||||
contractorId?: number | string;
|
||||
rowProjectId?: number | string;
|
||||
deptName?: string;
|
||||
deptCategory?: string;
|
||||
orderNum?: number;
|
||||
leader?: string;
|
||||
isSubset?: string;
|
||||
deptType?: string;
|
||||
isShow?: string;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
|
@ -10,10 +10,11 @@ export function getDicts(dictType: string): AxiosPromise<DictDataVO[]> {
|
||||
}
|
||||
|
||||
// 查询字典数据列表
|
||||
export function listData(query: string): AxiosPromise<DictDataVO[]> {
|
||||
export function listData(query: DictDataQuery): AxiosPromise<DictDataVO[]> {
|
||||
return request({
|
||||
url: '/system/dict/data/type/' + query,
|
||||
method: 'get'
|
||||
url: '/system/dict/data/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ export const globalHeaders = () => {
|
||||
|
||||
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8';
|
||||
axios.defaults.headers['clientid'] = import.meta.env.VITE_APP_CLIENT_ID;
|
||||
axios.defaults.headers['projectId'] = cache.local.getJSON('selectedProject')?.id || '';
|
||||
// axios.defaults.headers['projectId'] = cache.local.getJSON('selectedProject')?.id || '';
|
||||
|
||||
// 创建 axios 实例
|
||||
const service = axios.create({
|
||||
|
@ -279,7 +279,7 @@ const handleAddApp = (row) => {
|
||||
// 添加审批
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/relation-management/template/indexEdit`,
|
||||
path: `/relation-management/changeContact/indexEdit`,
|
||||
query: {
|
||||
thumbnailUrl: projectTypeOptions.value[1].thumbnail,
|
||||
row,
|
||||
|
@ -118,7 +118,7 @@ const data = reactive({
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
fileName: undefined,
|
||||
fileType: undefined,
|
||||
fileType: 1,
|
||||
fileSuffix: undefined,
|
||||
fileStatus: undefined,
|
||||
originalName: undefined,
|
||||
|
@ -7,7 +7,7 @@
|
||||
<el-form-item label="人员姓名" prop="userName">
|
||||
<el-input v-model="queryParams.userName" placeholder="请输入人员姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分包公司" prop="contractorId">
|
||||
<el-form-item label="分包公司" prop="contractorId" v-hasPermi="['contractor:contractor:list']">
|
||||
<el-select v-model="queryParams.contractorId" clearable placeholder="全部">
|
||||
<el-option v-for="item in contractorOpt" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
@ -42,7 +42,7 @@
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['project:constructionUser:add']">新增 </el-button>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
@ -78,18 +78,20 @@
|
||||
<el-button type="success" plain>员工资料 </el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-show="informationStatus">
|
||||
<el-button type="primary" plain icon="Edit" @click="downloadTemplate">下载资料模板 </el-button>
|
||||
<el-button type="primary" plain icon="Edit" @click="downloadTemplate" v-hasPermi="['project:constructionUserFile:download']"
|
||||
>下载资料模板
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-show="informationStatus">
|
||||
<file-upload
|
||||
v-model="filePath"
|
||||
isImportInfo
|
||||
:isShowTip="false"
|
||||
uploadUrl="/project/constructionUserFile/upload/zip"
|
||||
uploadUrl="/contractor/constructionUserFile/upload/zip"
|
||||
:limit="1"
|
||||
:file-size="50"
|
||||
>
|
||||
<el-button type="warning" plain icon="Edit">导入员工资料 </el-button>
|
||||
<el-button type="warning" plain icon="Edit" v-hasPermi="['project:constructionUserFile:upload']">导入员工资料 </el-button>
|
||||
</file-upload>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -190,7 +192,7 @@
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改施工人员对话框 -->
|
||||
<el-dialog draggable :title="dialog.title" v-model="dialog.visible" width="930px" append-to-body>
|
||||
<el-dialog draggable :title="dialog.title" v-model="dialog.visible" width="930px" append-to-body>
|
||||
<el-form ref="constructionUserFormRef" :model="form" :rules="rules" label-width="130px" :inline="true">
|
||||
<div class="block_box">
|
||||
<div class="msg">用户信息</div>
|
||||
@ -602,7 +604,7 @@ const data = reactive({
|
||||
nickName: undefined,
|
||||
userName: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
notUserRole:1,
|
||||
notUserRole: 1,
|
||||
contractorId: undefined,
|
||||
teamId: undefined,
|
||||
status: undefined,
|
||||
|
@ -25,20 +25,20 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['project:contractor:add']"> 新增 </el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['contractor:contractor:add']"> 新增 </el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['project:contractor:edit']"
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['contractor:contractor:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['project:contractor:remove']"
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['contractor:contractor:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['project:contractor:export']">导出 </el-button>
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['contractor:contractor:export']">导出 </el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@ -63,8 +63,10 @@
|
||||
<template #default="scope">
|
||||
<el-space wrap>
|
||||
<el-button link type="primary" icon="View" @click="handleContractorFile(scope.row)">文件</el-button>
|
||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['project:contractor:edit']">修改 </el-button>
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['project:contractor:remove']">
|
||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['contractor:contractor:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['contractor:contractor:remove']">
|
||||
删除
|
||||
</el-button>
|
||||
</el-space>
|
||||
@ -118,7 +120,7 @@ import { addContractor, delContractor, getContractor, listContractor, updateCont
|
||||
import { ContractorForm, ContractorQuery, ContractorVO } from '@/api/project/contractor/types';
|
||||
import ContractorFileDialog from '@/views/project/contractor/component/ContractorFileDialog.vue';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { listData } from '@/api/system/dict/data';
|
||||
import { getDicts, listData } from '@/api/system/dict/data';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
@ -179,7 +181,7 @@ const data = reactive<PageData<ContractorForm, ContractorQuery>>({
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
/** 查询字典数据列表 */
|
||||
const getDictList = async () => {
|
||||
const res = await listData('contractor_type');
|
||||
const res = await getDicts('contractor_type');
|
||||
dictList.value = res.data;
|
||||
};
|
||||
// 分包类型
|
||||
|
@ -45,16 +45,36 @@
|
||||
<el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="expand" width="50">
|
||||
<template #default="{ row }">
|
||||
<div class="w187.25 ml-12.5">
|
||||
<div class="w212.25 ml-12.5">
|
||||
<el-button class="mb" type="primary" size="small" @click="handleOpenSetChild(row.id)" icon="plus">添加子项目</el-button>
|
||||
|
||||
<el-table :data="row.children" border stripe>
|
||||
<el-table-column label="序号" type="index" width="55" align="center" />
|
||||
<el-table-column label="名称" align="center" prop="projectName" width="296" />
|
||||
<el-table-column label="名称" align="center" prop="projectName" width="296">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
:type="scope.row.designId ? 'primary' : 'default'"
|
||||
:disabled="!scope.row.designId"
|
||||
@click="handleOpenLayer(scope.row)"
|
||||
v-loading.fullscreen.lock="fullscreenLoading"
|
||||
>{{ scope.row.projectName }}</el-link
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="199" />
|
||||
<el-table-column fixed="right" align="center" label="操作" class-name="small-padding fixed-width" width="199">
|
||||
<el-table-column fixed="right" align="center" label="操作" class-name="small-padding fixed-width" width="299">
|
||||
<template #default="scope">
|
||||
<el-space>
|
||||
<file-upload
|
||||
:limit="1"
|
||||
:fileSize="200"
|
||||
:fileType="['dxf']"
|
||||
v-model:model-value="dxfFile"
|
||||
uploadUrl="/project/projectFile/upload/dxf"
|
||||
:data="{ projectId: scope.row.id }"
|
||||
>
|
||||
<el-button link type="primary" icon="upload">上传DXF </el-button>
|
||||
</file-upload>
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
@ -76,7 +96,7 @@
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName">
|
||||
<template #default="scope">
|
||||
<!-- <template #default="scope">
|
||||
<el-link
|
||||
:type="scope.row.designId ? 'primary' : 'default'"
|
||||
:disabled="!scope.row.designId"
|
||||
@ -84,7 +104,7 @@
|
||||
v-loading.fullscreen.lock="fullscreenLoading"
|
||||
>{{ scope.row.projectName }}</el-link
|
||||
>
|
||||
</template>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="项目简称" align="center" prop="shortName" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
@ -126,16 +146,6 @@
|
||||
<template #default="scope">
|
||||
<el-space>
|
||||
<el-button link type="primary" icon="FolderOpened" @click="handleShowUpload(scope.row)">导入安全协议书 </el-button>
|
||||
<file-upload
|
||||
:limit="1"
|
||||
:fileSize="200"
|
||||
:fileType="['dxf']"
|
||||
v-model:model-value="dxfFile"
|
||||
uploadUrl="/project/projectFile/upload/dxf"
|
||||
:data="{ projectId: scope.row.id }"
|
||||
>
|
||||
<el-button link type="primary" icon="upload">上传DXF </el-button>
|
||||
</file-upload>
|
||||
|
||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['project:project:edit']">修改 </el-button>
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['project:project:remove']">删除 </el-button>
|
||||
|
@ -77,7 +77,7 @@
|
||||
<el-button type="success" plain>员工资料 </el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-show="informationStatus">
|
||||
<el-button type="primary" plain icon="Edit" @click="downloadTemplate">下载资料模板 </el-button>
|
||||
<el-button type="primary" plain icon="Edit" @click="downloadTemplate"v-hasPermi="['project:constructionUserFile:download']">下载资料模板 </el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-show="informationStatus">
|
||||
<file-upload
|
||||
@ -88,7 +88,7 @@
|
||||
:limit="1"
|
||||
:file-size="50"
|
||||
>
|
||||
<el-button type="warning" plain icon="Edit">导入员工资料 </el-button>
|
||||
<el-button type="warning" plain icon="Edit"v-hasPermi="['project:constructionUserFile:upload']">导入员工资料 </el-button>
|
||||
</file-upload>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -47,6 +47,11 @@
|
||||
>
|
||||
<el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
|
||||
<el-table-column prop="deptCategory" align="center" label="类别编码" width="200"></el-table-column>
|
||||
<el-table-column prop="deptType" align="center" label="部门类型" width="200">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_dept_type" :value="scope.row.deptType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderNum" align="center" label="排序" width="200"></el-table-column>
|
||||
<el-table-column prop="status" align="center" label="状态" width="100">
|
||||
<template #default="scope">
|
||||
@ -63,7 +68,7 @@
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button v-hasPermi="['system:dept:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="新增" placement="top" v-if="scope.row.isSubset != '0'">
|
||||
<el-tooltip content="新增" placement="top" v-if="scope.row.deptType != '2' && scope.row.deptType != '4'">
|
||||
<el-button v-hasPermi="['system:dept:add']" link type="primary" icon="Plus" @click="handleAdd(scope.row)" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
@ -129,20 +134,26 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否拥有子级">
|
||||
<el-radio-group v-model="form.isSubset" @change="handleChangeisSubset">
|
||||
<el-radio value="1">是</el-radio>
|
||||
<el-radio value="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
<el-form-item label="部门类型">
|
||||
<el-select v-model="form.deptType" placeholder="请选择部门类型" @change="changeProject">
|
||||
<el-option v-for="dict in sys_dept_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.isSubset == '0'">
|
||||
<el-col :span="12" v-if="form.deptType == '3'">
|
||||
<el-form-item label="所属项目" prop="projectId">
|
||||
<el-select v-model="form.projectId" placeholder="请选择所属项目">
|
||||
<el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.deptType == '4'">
|
||||
<el-form-item label="分包单位" prop="contractorId">
|
||||
<el-select v-model="form.contractorId" placeholder="请选择分包单位">
|
||||
<el-option v-for="item in contractorList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
@ -156,7 +167,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Dept" lang="ts">
|
||||
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild, getDeptList } from '@/api/system/dept';
|
||||
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild, getDeptList, optionProjectSelect } from '@/api/system/dept';
|
||||
import { DeptForm, DeptQuery, DeptVO } from '@/api/system/dept/types';
|
||||
import { UserVO } from '@/api/system/user/types';
|
||||
import { listUserByDeptId } from '@/api/system/user';
|
||||
@ -168,7 +179,7 @@ interface DeptOptionsType {
|
||||
}
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_normal_disable'));
|
||||
const { sys_normal_disable, sys_dept_type } = toRefs<any>(proxy?.useDict('sys_normal_disable', 'sys_dept_type'));
|
||||
|
||||
const deptList = ref<DeptVO[]>([]);
|
||||
const loading = ref(true);
|
||||
@ -182,6 +193,8 @@ const dialog = reactive<DialogOption>({
|
||||
title: ''
|
||||
});
|
||||
const projectList = ref([]);
|
||||
const contractorList = ref([]);
|
||||
|
||||
const deptTableRef = ref<ElTableInstance>();
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const deptFormRef = ref<ElFormInstance>();
|
||||
@ -196,8 +209,10 @@ const initFormData: DeptForm = {
|
||||
phone: undefined,
|
||||
email: undefined,
|
||||
isShow: undefined,
|
||||
isSubset: undefined,
|
||||
deptType: undefined,
|
||||
projectId: undefined,
|
||||
contractorId: undefined,
|
||||
rowProjectId: undefined,
|
||||
status: '0'
|
||||
};
|
||||
const initData: PageData<DeptForm, DeptQuery> = {
|
||||
@ -209,7 +224,7 @@ const initData: PageData<DeptForm, DeptQuery> = {
|
||||
deptCategory: undefined,
|
||||
status: undefined,
|
||||
isShow: undefined,
|
||||
isSubset: undefined
|
||||
deptType: undefined
|
||||
},
|
||||
rules: {
|
||||
parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
|
||||
@ -251,6 +266,7 @@ const cancel = () => {
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
projectList.value = [];
|
||||
contractorList.value = [];
|
||||
deptFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
@ -265,13 +281,6 @@ const resetQuery = () => {
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
const handleChangeisSubset = async (value: string) => {
|
||||
if (value == '0' && (!projectList.value || !projectList.value.length)) {
|
||||
const res = await getDeptList();
|
||||
projectList.value = res.data;
|
||||
}
|
||||
};
|
||||
|
||||
/** 展开/折叠操作 */
|
||||
const handleToggleExpandAll = () => {
|
||||
isExpandAll.value = !isExpandAll.value;
|
||||
@ -288,6 +297,7 @@ const toggleExpandAll = (data: DeptVO[], status: boolean) => {
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = async (row?: DeptVO) => {
|
||||
reset();
|
||||
form.value.rowProjectId = row?.projectId;
|
||||
const res = await listDept();
|
||||
const data = proxy?.handleTree<DeptOptionsType>(res.data, 'deptId');
|
||||
if (data) {
|
||||
@ -303,6 +313,7 @@ const handleAdd = async (row?: DeptVO) => {
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row: DeptVO) => {
|
||||
reset();
|
||||
form.value.rowProjectId = row?.projectId;
|
||||
//查询当前部门所有用户
|
||||
getDeptAllUser(row.deptId);
|
||||
const res = await getDept(row.deptId);
|
||||
@ -324,6 +335,17 @@ const handleUpdate = async (row: DeptVO) => {
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改部门';
|
||||
};
|
||||
|
||||
const changeProject = async (val: any) => {
|
||||
if (val == '3' && (!projectList.value || !projectList.value.length)) {
|
||||
const res = await getDeptList();
|
||||
projectList.value = res.data;
|
||||
} else if (val == '4' && (!contractorList.value || !contractorList.value.length)) {
|
||||
const res = await optionProjectSelect(form.value.rowProjectId);
|
||||
contractorList.value = res;
|
||||
}
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
deptFormRef.value?.validate(async (valid: boolean) => {
|
||||
|
@ -430,6 +430,7 @@ const initData: PageData<UserForm, UserQuery> = {
|
||||
}
|
||||
],
|
||||
phonenumber: [
|
||||
{ required: true, message: '请输入手机号码', trigger: 'blur' },
|
||||
{
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
message: '请输入正确的手机号码',
|
||||
|
Reference in New Issue
Block a user