合并
This commit is contained in:
63
src/api/design/prelimScheme/index.ts
Normal file
63
src/api/design/prelimScheme/index.ts
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
import { PrelimSchemeVO, PrelimSchemeForm, PrelimSchemeQuery } from '@/api/design/prelimScheme/types';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设计初步方案列表
|
||||||
|
* @param query
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const listPrelimScheme = (query?: PrelimSchemeQuery): AxiosPromise<PrelimSchemeVO[]> => {
|
||||||
|
return request({
|
||||||
|
url: '/design/prelimScheme/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设计初步方案详细
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export const getPrelimScheme = (id: string | number): AxiosPromise<PrelimSchemeVO> => {
|
||||||
|
return request({
|
||||||
|
url: '/design/prelimScheme/' + id,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设计初步方案
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
export const addPrelimScheme = (data: PrelimSchemeForm) => {
|
||||||
|
return request({
|
||||||
|
url: '/design/prelimScheme',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设计初步方案
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
export const updatePrelimScheme = (data: PrelimSchemeForm) => {
|
||||||
|
return request({
|
||||||
|
url: '/design/prelimScheme/update/' + data.id,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设计初步方案
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export const delPrelimScheme = (id: string | number | Array<string | number>) => {
|
||||||
|
return request({
|
||||||
|
url: '/design/prelimScheme/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
|
};
|
101
src/api/design/prelimScheme/types.ts
Normal file
101
src/api/design/prelimScheme/types.ts
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
export interface PrelimSchemeVO {
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
id: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
projectId: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ossId
|
||||||
|
*/
|
||||||
|
ossId: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名称
|
||||||
|
*/
|
||||||
|
fileName: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件访问路径
|
||||||
|
*/
|
||||||
|
fileUrl: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核状态
|
||||||
|
*/
|
||||||
|
status: string;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PrelimSchemeForm extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
id?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
projectId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ossId
|
||||||
|
*/
|
||||||
|
ossId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名称
|
||||||
|
*/
|
||||||
|
fileName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件访问路径
|
||||||
|
*/
|
||||||
|
fileUrl?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核状态
|
||||||
|
*/
|
||||||
|
status?: string;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PrelimSchemeQuery extends PageQuery {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
projectId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ossId
|
||||||
|
*/
|
||||||
|
ossId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名称
|
||||||
|
*/
|
||||||
|
fileName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件访问路径
|
||||||
|
*/
|
||||||
|
fileUrl?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核状态
|
||||||
|
*/
|
||||||
|
status?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期范围参数
|
||||||
|
*/
|
||||||
|
params?: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
63
src/api/design/scheme/index.ts
Normal file
63
src/api/design/scheme/index.ts
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
import { SchemeVO, SchemeForm, SchemeQuery } from '@/api/design/scheme/types';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设计初步方案列表
|
||||||
|
* @param query
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const listScheme = (query?: SchemeQuery): AxiosPromise<SchemeVO[]> => {
|
||||||
|
return request({
|
||||||
|
url: '/design/scheme/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设计初步方案详细
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export const getScheme = (id: string | number): AxiosPromise<SchemeVO> => {
|
||||||
|
return request({
|
||||||
|
url: '/design/scheme/' + id,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设计初步方案
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
export const addScheme = (data: SchemeForm) => {
|
||||||
|
return request({
|
||||||
|
url: '/design/scheme',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设计初步方案
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
export const updateScheme = (data: SchemeForm) => {
|
||||||
|
return request({
|
||||||
|
url: '/design/scheme/update/' + data.id,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设计初步方案
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export const delScheme = (id: string | number | Array<string | number>) => {
|
||||||
|
return request({
|
||||||
|
url: '/design/scheme/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
|
};
|
101
src/api/design/scheme/types.ts
Normal file
101
src/api/design/scheme/types.ts
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
export interface SchemeVO {
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
id: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
projectId: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ossId
|
||||||
|
*/
|
||||||
|
ossId: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名称
|
||||||
|
*/
|
||||||
|
fileName: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件访问路径
|
||||||
|
*/
|
||||||
|
fileUrl: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核状态
|
||||||
|
*/
|
||||||
|
status: string;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SchemeForm extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
id?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
projectId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ossId
|
||||||
|
*/
|
||||||
|
ossId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名称
|
||||||
|
*/
|
||||||
|
fileName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件访问路径
|
||||||
|
*/
|
||||||
|
fileUrl?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核状态
|
||||||
|
*/
|
||||||
|
status?: string;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SchemeQuery extends PageQuery {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
projectId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ossId
|
||||||
|
*/
|
||||||
|
ossId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名称
|
||||||
|
*/
|
||||||
|
fileName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件访问路径
|
||||||
|
*/
|
||||||
|
fileUrl?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核状态
|
||||||
|
*/
|
||||||
|
status?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期范围参数
|
||||||
|
*/
|
||||||
|
params?: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
63
src/api/design/subcontract/index.ts
Normal file
63
src/api/design/subcontract/index.ts
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
import { SubcontractVO, SubcontractForm, SubcontractQuery } from '@/api/design/subcontract/types';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设计分包列表
|
||||||
|
* @param query
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const listSubcontract = (query?: SubcontractQuery): AxiosPromise<SubcontractVO[]> => {
|
||||||
|
return request({
|
||||||
|
url: '/design/subcontract/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设计分包详细
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export const getSubcontract = (id: string | number): AxiosPromise<SubcontractVO> => {
|
||||||
|
return request({
|
||||||
|
url: '/design/subcontract/' + id,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设计分包
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
export const addSubcontract = (data: SubcontractForm) => {
|
||||||
|
return request({
|
||||||
|
url: '/design/subcontract',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设计分包
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
export const updateSubcontract = (data: SubcontractForm) => {
|
||||||
|
return request({
|
||||||
|
url: '/design/subcontract',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设计分包
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export const delSubcontract = (id: string | number | Array<string | number>) => {
|
||||||
|
return request({
|
||||||
|
url: '/design/subcontract/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
|
};
|
56
src/api/design/subcontract/types.ts
Normal file
56
src/api/design/subcontract/types.ts
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
export interface SubcontractVO {
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
id: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
projectId: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分包内容
|
||||||
|
*/
|
||||||
|
subContent: string;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SubcontractForm extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
id?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
projectId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分包内容
|
||||||
|
*/
|
||||||
|
subContent?: string;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SubcontractQuery extends PageQuery {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
projectId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分包内容
|
||||||
|
*/
|
||||||
|
subContent?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期范围参数
|
||||||
|
*/
|
||||||
|
params?: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2,7 +2,7 @@ export interface VolumeCatalogVO {
|
|||||||
/**
|
/**
|
||||||
* 主键ID
|
* 主键ID
|
||||||
*/
|
*/
|
||||||
id: string | number;
|
design: string | number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目ID
|
* 项目ID
|
||||||
@ -28,14 +28,13 @@ export interface VolumeCatalogVO {
|
|||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
remark: string;
|
remark: string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface VolumeCatalogForm extends BaseEntity {
|
export interface VolumeCatalogForm extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 主键ID
|
* 主键ID
|
||||||
*/
|
*/
|
||||||
id?: string | number;
|
design?: string | number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目ID
|
* 项目ID
|
||||||
@ -61,11 +60,9 @@ export interface VolumeCatalogForm extends BaseEntity {
|
|||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
remark?: string;
|
remark?: string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface VolumeCatalogQuery extends PageQuery {
|
export interface VolumeCatalogQuery extends PageQuery {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目ID
|
* 项目ID
|
||||||
*/
|
*/
|
||||||
@ -86,11 +83,8 @@ export interface VolumeCatalogQuery extends PageQuery {
|
|||||||
*/
|
*/
|
||||||
documentName?: string;
|
documentName?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日期范围参数
|
* 日期范围参数
|
||||||
*/
|
*/
|
||||||
params?: any;
|
params?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
:drag="isDarg"
|
:drag="isDarg"
|
||||||
:data="data"
|
:data="data"
|
||||||
:auto-upload="autoUpload"
|
:auto-upload="autoUpload"
|
||||||
|
:on-change="handleChange"
|
||||||
|
:on-remove="handleRemove"
|
||||||
>
|
>
|
||||||
<slot>
|
<slot>
|
||||||
<div>
|
<div>
|
||||||
@ -108,8 +110,9 @@ const props = defineProps({
|
|||||||
showFileList: propTypes.bool.def(false),
|
showFileList: propTypes.bool.def(false),
|
||||||
// 其他参数
|
// 其他参数
|
||||||
data: propTypes.object.def({}),
|
data: propTypes.object.def({}),
|
||||||
|
// 成功回调
|
||||||
onUploadSuccess: {
|
onUploadSuccess: {
|
||||||
type: Function as PropType<(files: any[]) => void>,
|
type: Function as PropType<(files: any[], res: any) => void>,
|
||||||
default: undefined
|
default: undefined
|
||||||
},
|
},
|
||||||
// 失败回调
|
// 失败回调
|
||||||
@ -124,7 +127,8 @@ const props = defineProps({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
const emit = defineEmits(['update:modelValue']);
|
const emit = defineEmits(['update:modelValue', 'handleChange', 'handleRemove']);
|
||||||
|
|
||||||
const number = ref(0);
|
const number = ref(0);
|
||||||
const uploadList = ref<any[]>([]);
|
const uploadList = ref<any[]>([]);
|
||||||
const baseUrl = import.meta.env.VITE_APP_BASE_API;
|
const baseUrl = import.meta.env.VITE_APP_BASE_API;
|
||||||
@ -236,34 +240,49 @@ const handleUploadSuccess = (res: any, file: UploadFileWithOssId) => {
|
|||||||
} else {
|
} else {
|
||||||
uploadList.value.push({});
|
uploadList.value.push({});
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadedSuccessfully();
|
|
||||||
} else {
|
} else {
|
||||||
number.value--;
|
number.value--;
|
||||||
proxy?.$modal.closeLoading();
|
proxy?.$modal.closeLoading();
|
||||||
proxy?.$modal.msgError(res.msg);
|
proxy?.$modal.msgError(res.msg);
|
||||||
fileUploadRef.value?.handleRemove(file);
|
fileUploadRef.value?.handleRemove(file);
|
||||||
uploadedSuccessfully();
|
|
||||||
}
|
}
|
||||||
|
uploadedSuccessfully(res);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleChange = (file: any, fileList: any) => {
|
||||||
|
emit('handleChange', file, fileList);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 删除文件
|
||||||
|
const handleRemove = (file: any, fileList: any) => {
|
||||||
|
console.log(11);
|
||||||
|
|
||||||
|
emit('handleRemove', file, fileList);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 删除文件
|
// 删除文件
|
||||||
const handleDelete = async (index: string | number, type?: string) => {
|
const handleDelete = async (index: string | number, type?: string) => {
|
||||||
await proxy?.$modal.confirm('是否确认删除此文件?').finally();
|
await proxy?.$modal.confirm('是否确认删除此文件?').finally();
|
||||||
if (type === 'ossId') {
|
try {
|
||||||
delOss(index);
|
if (type === 'ossId') {
|
||||||
fileList.value = fileList.value.filter((f) => f.ossId !== index);
|
delOss(index);
|
||||||
} else {
|
fileList.value = fileList.value.filter((f) => f.ossId !== index);
|
||||||
let ossId = fileList.value[index].ossId;
|
} else {
|
||||||
delOss(ossId);
|
let ossId = fileList.value[index].ossId;
|
||||||
index = parseInt(index as string);
|
delOss(ossId);
|
||||||
fileList.value.splice(index, 1);
|
index = parseInt(index as string);
|
||||||
|
fileList.value.splice(index, 1);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
emit('handleRemove');
|
||||||
|
emit('update:modelValue', listToString(fileList.value));
|
||||||
}
|
}
|
||||||
emit('update:modelValue', listToString(fileList.value));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 上传结束处理
|
// 上传结束处理
|
||||||
const uploadedSuccessfully = () => {
|
const uploadedSuccessfully = (res: any) => {
|
||||||
|
console.log(11121);
|
||||||
|
|
||||||
if (props.isImportInfo) {
|
if (props.isImportInfo) {
|
||||||
emit('update:modelValue', 'ok');
|
emit('update:modelValue', 'ok');
|
||||||
fileUploadRef.value?.clearFiles();
|
fileUploadRef.value?.clearFiles();
|
||||||
@ -279,13 +298,14 @@ const uploadedSuccessfully = () => {
|
|||||||
|
|
||||||
emit('update:modelValue', listToString(fileList.value));
|
emit('update:modelValue', listToString(fileList.value));
|
||||||
proxy?.$modal.closeLoading();
|
proxy?.$modal.closeLoading();
|
||||||
props.onUploadSuccess?.(fileList.value);
|
props.onUploadSuccess?.(fileList.value, res);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取文件名称
|
// 获取文件名称
|
||||||
const getFileName = (name: string) => {
|
const getFileName = (name: string) => {
|
||||||
// 如果是url那么取最后的名字 如果不是直接返回
|
// 如果是url那么取最后的名字 如果不是直接返回
|
||||||
|
if (!name) return '';
|
||||||
if (name.lastIndexOf('/') > -1) {
|
if (name.lastIndexOf('/') > -1) {
|
||||||
return name.slice(name.lastIndexOf('/') + 1);
|
return name.slice(name.lastIndexOf('/') + 1);
|
||||||
} else {
|
} else {
|
||||||
|
@ -33,17 +33,66 @@
|
|||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div><image-preview :src="thumbnailUrl" width="150px"></image-preview></div>
|
<div><image-preview :src="thumbnailUrl" width="150px"></image-preview></div>
|
||||||
<div>
|
<div>
|
||||||
<el-form-item label="工程名称" prop="projectName">
|
<el-row :gutter="20">
|
||||||
<el-input v-model="form.projectName" placeholder="请输入工程名称" />
|
<el-col :span="12">
|
||||||
|
<el-form-item label="工程名称">
|
||||||
|
<el-input v-model="form.projectName" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="提出单位">
|
||||||
|
<el-input v-model="form.submitUnit" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 专业 & 提出日期 -->
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="专业">
|
||||||
|
<el-input v-model="form.specialty" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="提出日期">
|
||||||
|
<el-date-picker v-model="form.submitDate" type="date" value-format="YYYY-MM-DD" placeholder="选择日期" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 卷册名称 & 附图 -->
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="卷册名称">
|
||||||
|
<el-input v-model="form.volumeName" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="附图">
|
||||||
|
<el-upload v-model:file-list="form.attachments" action="#" list-type="text">
|
||||||
|
<el-button type="primary">上传附件</el-button>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 卷册号 -->
|
||||||
|
<el-form-item label="卷册号">
|
||||||
|
<el-input v-model="form.volumeNumber" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="编号" prop="serialNumber">
|
|
||||||
<el-input v-model="form.serialNumber" placeholder="请输入编号" />
|
<!-- 变更原因 -->
|
||||||
</el-form-item>
|
<el-form-item label="变更原因">
|
||||||
<el-form-item label="致" prop="to">
|
<el-checkbox-group v-model="form.changeReasons">
|
||||||
<el-input v-model="form.to" placeholder="致:" />
|
<el-checkbox label="设计漏项" />
|
||||||
</el-form-item>
|
<el-checkbox label="设计改进" />
|
||||||
<el-form-item label="主题" prop="subject">
|
<el-checkbox label="设计差错" />
|
||||||
<el-input v-model="form.subject" placeholder="请输入主题" />
|
<el-checkbox label="接口差错" />
|
||||||
|
<el-checkbox label="业主要求" />
|
||||||
|
<el-checkbox label="施工承包商要求" />
|
||||||
|
<el-checkbox label="外部资料与最终情况不符" />
|
||||||
|
<el-checkbox label="材料代用及其他" />
|
||||||
|
</el-checkbox-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="内容" prop="content">
|
<el-form-item label="内容" prop="content">
|
||||||
<el-input v-model="form.content" type="textarea" :rows="6" placeholder="请输入内容" />
|
<el-input v-model="form.content" type="textarea" :rows="6" placeholder="请输入内容" />
|
||||||
@ -51,26 +100,29 @@
|
|||||||
<el-form-item label="附件" prop="attachments">
|
<el-form-item label="附件" prop="attachments">
|
||||||
<file-upload v-model="form.attachments" :limit="1" :file-type="['pdf', 'png', 'jpg', 'jpeg', 'gif', 'bmp']"></file-upload>
|
<file-upload v-model="form.attachments" :limit="1" :file-type="['pdf', 'png', 'jpg', 'jpeg', 'gif', 'bmp']"></file-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="变更费用估算" prop="costEstimation">
|
||||||
|
<el-input v-model="form.costEstimation" :rows="6" placeholder="请输入变更费用估算" />
|
||||||
|
</el-form-item>
|
||||||
<el-divider class="mb-10! mt-10!">施工项目部</el-divider>
|
<el-divider class="mb-10! mt-10!">施工项目部</el-divider>
|
||||||
<el-form-item label="项目负责人" prop="contractorLeader">
|
<el-form-item label="项目负责人" prop="contractorLeader">
|
||||||
<el-input v-model="form.contractorLeader" placeholder="请输入负责人姓名" />
|
<el-input v-model="form.contractorLeader" placeholder="请输入负责人姓名" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="日期" prop="contractorDate">
|
<el-form-item label="日期" prop="contractorDate">
|
||||||
<el-date-picker v-model="form.contractorDate" type="date" placeholder="选择日期" style="width: 100%" />
|
<el-date-picker v-model="form.contractorDate" type="date" placeholder="选择日期" value-format="YYYY-MM-DD" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-divider class="mb-10! mt-10!">项目监理机构</el-divider>
|
<el-divider class="mb-10! mt-10!">项目监理机构</el-divider>
|
||||||
<el-form-item label="总监理工程师" prop="supervisorLeader">
|
<el-form-item label="总监理工程师" prop="supervisorLeader">
|
||||||
<el-input v-model="form.supervisorLeader" placeholder="请输入总监理工程师姓名" />
|
<el-input v-model="form.supervisorLeader" placeholder="请输入总监理工程师姓名" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="日期" prop="supervisorDate">
|
<el-form-item label="日期" prop="supervisorDate">
|
||||||
<el-date-picker v-model="form.supervisorDate" type="date" placeholder="选择日期" style="width: 100%" />
|
<el-date-picker v-model="form.supervisorDate" type="date" placeholder="选择日期" value-format="YYYY-MM-DD" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-divider class="mb-10! mt-10!">建设单位</el-divider>
|
<el-divider class="mb-10! mt-10!">建设单位</el-divider>
|
||||||
<el-form-item label="业主代表" prop="ownerRep">
|
<el-form-item label="业主代表" prop="ownerRep">
|
||||||
<el-input v-model="form.ownerRep" placeholder="请输入业主代表" />
|
<el-input v-model="form.ownerRep" placeholder="请输入业主代表" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="日期" prop="ownerDate">
|
<el-form-item label="日期" prop="ownerDate">
|
||||||
<el-date-picker v-model="form.ownerDate" type="date" placeholder="选择日期" style="width: 100%" />
|
<el-date-picker v-model="form.ownerDate" type="date" placeholder="选择日期" value-format="YYYY-MM-DD" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -121,7 +173,7 @@ import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
|||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
import { listByIds } from '@/api/system/oss';
|
import { listByIds } from '@/api/system/oss';
|
||||||
import { addContactnotice,getContactnotice ,updateContactnotice} from '@/api/cory/contactnotice';
|
import { addContactnotice, getContactnotice, updateContactnotice } from '@/api/cory/contactnotice';
|
||||||
|
|
||||||
// 获取用户 store
|
// 获取用户 store
|
||||||
const userStore = useUserStoreHook();
|
const userStore = useUserStoreHook();
|
||||||
@ -136,7 +188,7 @@ const flowCodeOptions = [
|
|||||||
{
|
{
|
||||||
value: currentProject.value?.id + '_changecontact',
|
value: currentProject.value?.id + '_changecontact',
|
||||||
label: '变更联系单审批'
|
label: '变更联系单审批'
|
||||||
},
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
const flowCode = ref<string>('');
|
const flowCode = ref<string>('');
|
||||||
@ -170,6 +222,7 @@ const initFormData = {
|
|||||||
serialNumber: '',
|
serialNumber: '',
|
||||||
to: '',
|
to: '',
|
||||||
subject: '',
|
subject: '',
|
||||||
|
costEstimation: '',
|
||||||
content: '',
|
content: '',
|
||||||
attachments: '',
|
attachments: '',
|
||||||
contractorLeader: '',
|
contractorLeader: '',
|
||||||
@ -237,7 +290,7 @@ const getInfo = () => {
|
|||||||
...JSON.parse(res.data.detail)
|
...JSON.parse(res.data.detail)
|
||||||
};
|
};
|
||||||
console.log(routeParams.value);
|
console.log(routeParams.value);
|
||||||
|
|
||||||
Object.assign(form.value, data);
|
Object.assign(form.value, data);
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
buttonLoading.value = false;
|
buttonLoading.value = false;
|
||||||
@ -250,16 +303,16 @@ const submitForm = (status1: string) => {
|
|||||||
leaveFormRef.value?.validate(async (valid: boolean) => {
|
leaveFormRef.value?.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
buttonLoading.value = true;
|
buttonLoading.value = true;
|
||||||
// var res;
|
var res;
|
||||||
// if (form.value.id) {
|
if (form.value.id) {
|
||||||
// res = await updateContactnotice(form.value).finally(() => (buttonLoading.value = false));
|
res = await updateContactnotice(form.value).finally(() => (buttonLoading.value = false));
|
||||||
// } else {
|
} else {
|
||||||
// res = await addContactnotice(form.value).finally(() => (buttonLoading.value = false));
|
res = await addContactnotice(form.value).finally(() => (buttonLoading.value = false));
|
||||||
// }
|
}
|
||||||
// if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
dialog.visible = false;
|
dialog.visible = false;
|
||||||
submit(status.value, form.value);
|
submit(status.value, form.value);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
227
src/views/design/prelimScheme/index.vue
Normal file
227
src/views/design/prelimScheme/index.vue
Normal file
@ -0,0 +1,227 @@
|
|||||||
|
<template>
|
||||||
|
<div class="p-2">
|
||||||
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||||
|
<el-form-item label="文件名称" prop="fileName">
|
||||||
|
<el-input v-model="queryParams.fileName" placeholder="请输入文件名称" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
|
||||||
|
<el-card shadow="never">
|
||||||
|
<template #header>
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['design:scheme:add']">新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="schemeList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column label="序号" type="index" width="55" align="center" />
|
||||||
|
<el-table-column label="文件名称" align="center" prop="fileName">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link type="primary" :href="scope.row.fileUrl" target="_blank" :underline="false">
|
||||||
|
{{ scope.row.fileName }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="审核状态" align="center" prop="status">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="wf_business_status" :value="scope.row.status"></dict-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
v-if="scope.row.status === 'draft'"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['design:PrelimScheme:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
v-if="scope.row.status === 'draft'"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['design:PrelimScheme:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="Scheme" lang="ts">
|
||||||
|
import { listPrelimScheme, getPrelimScheme, delPrelimScheme, addPrelimScheme, updatePrelimScheme } from '@/api/design/prelimScheme';
|
||||||
|
import { PrelimSchemeVO, PrelimSchemeQuery, PrelimSchemeForm } from '@/api/design/prelimScheme/types';
|
||||||
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
|
||||||
|
// 获取用户 store
|
||||||
|
const userStore = useUserStoreHook();
|
||||||
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
|
const schemeList = ref<PrelimSchemeVO[]>([]);
|
||||||
|
const buttonLoading = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref<Array<string | number>>([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
|
||||||
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
|
const schemeFormRef = ref<ElFormInstance>();
|
||||||
|
|
||||||
|
const dialog = reactive<DialogOption>({
|
||||||
|
visible: false,
|
||||||
|
title: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const initFormData: PrelimSchemeForm = {
|
||||||
|
id: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
ossId: undefined,
|
||||||
|
fileName: undefined,
|
||||||
|
fileUrl: undefined,
|
||||||
|
status: undefined
|
||||||
|
};
|
||||||
|
const data = reactive<PageData<PrelimSchemeForm, PrelimSchemeQuery>>({
|
||||||
|
form: { ...initFormData },
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
projectId: undefined,
|
||||||
|
ossId: undefined,
|
||||||
|
fileName: undefined,
|
||||||
|
fileUrl: undefined,
|
||||||
|
status: undefined,
|
||||||
|
params: {}
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||||
|
projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }],
|
||||||
|
ossId: [{ required: true, message: 'ossId不能为空', trigger: 'blur' }],
|
||||||
|
fileName: [{ required: true, message: '文件名称不能为空', trigger: 'blur' }],
|
||||||
|
status: [{ required: true, message: '审核状态不能为空', trigger: 'change' }]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询设计初步方案列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true;
|
||||||
|
const res = await listPrelimScheme(queryParams.value);
|
||||||
|
|
||||||
|
schemeList.value = res.rows;
|
||||||
|
total.value = res.total;
|
||||||
|
loading.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 取消按钮 */
|
||||||
|
const cancel = () => {
|
||||||
|
reset();
|
||||||
|
dialog.visible = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
const reset = () => {
|
||||||
|
form.value = { ...initFormData };
|
||||||
|
schemeFormRef.value?.resetFields();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value?.resetFields();
|
||||||
|
handleQuery();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 多选框选中数据 */
|
||||||
|
const handleSelectionChange = (selection: PrelimSchemeVO[]) => {
|
||||||
|
ids.value = selection.map((item) => item.id);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
const handleAdd = () => {
|
||||||
|
proxy.$tab.closePage(route);
|
||||||
|
proxy.$tab.openPage('/design-management/prelimScheme/indexEdit', '', {
|
||||||
|
type: 'add'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
const handleUpdate = async (row?: PrelimSchemeVO) => {
|
||||||
|
proxy.$tab.closePage(route);
|
||||||
|
|
||||||
|
proxy.$tab.openPage(`/design-management/prelimScheme/indexEdit`, '', {
|
||||||
|
id: row.id,
|
||||||
|
type: 'update'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (row?: PrelimSchemeVO) => {
|
||||||
|
const _ids = row?.id || ids.value;
|
||||||
|
await proxy?.$modal.confirm('是否确认删除设计初步方案编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||||
|
await delPrelimScheme(_ids);
|
||||||
|
proxy?.$modal.msgSuccess('删除成功');
|
||||||
|
await getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = () => {
|
||||||
|
proxy?.download(
|
||||||
|
'design/scheme/export',
|
||||||
|
{
|
||||||
|
...queryParams.value
|
||||||
|
},
|
||||||
|
`scheme_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
|
||||||
|
//监听项目id刷新数据
|
||||||
|
const listeningProject = watch(
|
||||||
|
() => currentProject.value.id,
|
||||||
|
(nid, oid) => {
|
||||||
|
queryParams.value.projectId = nid;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
listeningProject();
|
||||||
|
});
|
||||||
|
</script>
|
423
src/views/design/prelimScheme/indexEdit.vue
Normal file
423
src/views/design/prelimScheme/indexEdit.vue
Normal file
@ -0,0 +1,423 @@
|
|||||||
|
<template>
|
||||||
|
<div class="p-4 bg-gray-50 min-h-screen">
|
||||||
|
<div class="max-w-4xl mx-auto">
|
||||||
|
<!-- 顶部按钮区域 -->
|
||||||
|
<el-card class="mb-4 rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md">
|
||||||
|
<approvalButton
|
||||||
|
@submitForm="submitForm"
|
||||||
|
@approvalVerifyOpen="approvalVerifyOpen"
|
||||||
|
@handleApprovalRecord="handleApprovalRecord"
|
||||||
|
:buttonLoading="buttonLoading"
|
||||||
|
:id="form.id"
|
||||||
|
:status="form.status"
|
||||||
|
:pageType="routeParams.type"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 表单区域 -->
|
||||||
|
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
||||||
|
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
|
||||||
|
<h3 class="text-lg font-semibold text-gray-800">设计初步方案信息</h3>
|
||||||
|
</div>
|
||||||
|
<div class="p-6">
|
||||||
|
<el-form
|
||||||
|
ref="leaveFormRef"
|
||||||
|
v-loading="loading"
|
||||||
|
:disabled="routeParams.type === 'view'"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
label-width="120px"
|
||||||
|
class="space-y-4"
|
||||||
|
>
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
|
<el-form-item label="设计方案" prop="file" class="mb-2">
|
||||||
|
<file-upload
|
||||||
|
:limit="1"
|
||||||
|
:fileType="['pdf']"
|
||||||
|
:fileSize="100"
|
||||||
|
v-model="form.file"
|
||||||
|
ref="fileUploadRef"
|
||||||
|
class="w-full"
|
||||||
|
:auto-upload="false"
|
||||||
|
:data="{ projectId: currentProject.id }"
|
||||||
|
:showFileList="showFileList"
|
||||||
|
:onUploadSuccess="handleUploadSuccess"
|
||||||
|
:uploadUrl="`${form.id ? '/design/prelimScheme/update/' + form.id : '/design/prelimScheme/upload'}`"
|
||||||
|
@handleChange="handleFileChange"
|
||||||
|
@handleRemove="handleFileRemove"
|
||||||
|
></file-upload>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<!-- 提交组件 -->
|
||||||
|
<approvalRecord ref="approvalRecordRef"></approvalRecord>
|
||||||
|
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||||
|
<!-- 流程选择对话框 -->
|
||||||
|
<el-dialog
|
||||||
|
draggable
|
||||||
|
v-model="dialogVisible.visible"
|
||||||
|
:title="dialogVisible.title"
|
||||||
|
:before-close="handleClose"
|
||||||
|
width="500"
|
||||||
|
class="rounded-lg shadow-lg"
|
||||||
|
>
|
||||||
|
<div class="p-4">
|
||||||
|
<p class="text-gray-600 mb-4">请选择要启动的流程:</p>
|
||||||
|
<el-select v-model="flowCode" placeholder="请选择流程" style="width: 100%">
|
||||||
|
<el-option v-for="item in flowCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer p-4 border-t border-gray-100 flex justify-end space-x-3">
|
||||||
|
<el-button @click="handleClose" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors"
|
||||||
|
>取消</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" @click="submitFlow()" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors"
|
||||||
|
>确认</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="Leave" lang="ts">
|
||||||
|
import { LeaveForm, LeaveQuery } from '@/api/workflow/leave/types';
|
||||||
|
import { startWorkFlow } from '@/api/workflow/task';
|
||||||
|
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
||||||
|
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||||
|
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
|
import { getPrelimScheme, updatePrelimScheme } from '@/api/design/prelimScheme';
|
||||||
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
// 获取用户 store
|
||||||
|
const userStore = useUserStoreHook();
|
||||||
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
|
const buttonLoading = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
//路由参数
|
||||||
|
const routeParams = ref<Record<string, any>>({});
|
||||||
|
const flowCode = ref<string>('');
|
||||||
|
const status = ref<string>('');
|
||||||
|
const dialogVisible = reactive<DialogOption>({
|
||||||
|
visible: false,
|
||||||
|
title: '流程定义'
|
||||||
|
});
|
||||||
|
const showFileList = ref(true);
|
||||||
|
//提交组件
|
||||||
|
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||||
|
//审批记录组件
|
||||||
|
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||||
|
const fileUploadRef = ref<InstanceType<typeof fileUploadRef>>();
|
||||||
|
|
||||||
|
const leaveFormRef = ref<ElFormInstance>();
|
||||||
|
const dialog = reactive({
|
||||||
|
visible: false,
|
||||||
|
title: '',
|
||||||
|
isEdit: false
|
||||||
|
});
|
||||||
|
const submitFormData = ref<StartProcessBo>({
|
||||||
|
businessId: '',
|
||||||
|
flowCode: '',
|
||||||
|
variables: {}
|
||||||
|
});
|
||||||
|
const taskVariables = ref<Record<string, any>>({});
|
||||||
|
const flowCodeOptions = [
|
||||||
|
{
|
||||||
|
value: currentProject.value?.id + '_prelimScheme',
|
||||||
|
label: '设计初步方案审批'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
const initFormData: any = {
|
||||||
|
projectId: currentProject.value?.id,
|
||||||
|
file: undefined
|
||||||
|
};
|
||||||
|
const data = reactive<any>({
|
||||||
|
form: { ...initFormData },
|
||||||
|
rules: {
|
||||||
|
file: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请上传图纸文件',
|
||||||
|
trigger: 'change'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const { form, rules } = toRefs(data);
|
||||||
|
const handleClose = () => {
|
||||||
|
dialogVisible.visible = false;
|
||||||
|
flowCode.value = '';
|
||||||
|
buttonLoading.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
const reset = () => {
|
||||||
|
form.value = { ...initFormData };
|
||||||
|
leaveFormRef.value?.resetFields();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 获取详情 */
|
||||||
|
const getInfo = () => {
|
||||||
|
loading.value = true;
|
||||||
|
buttonLoading.value = false;
|
||||||
|
nextTick(async () => {
|
||||||
|
const res = await getPrelimScheme(routeParams.value.id);
|
||||||
|
Object.assign(form.value, res.data);
|
||||||
|
form.value.file = res.data.ossId;
|
||||||
|
showFileList.value = false;
|
||||||
|
|
||||||
|
loading.value = false;
|
||||||
|
buttonLoading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
const submitForm = async (status1: string) => {
|
||||||
|
status.value = status1;
|
||||||
|
|
||||||
|
var res;
|
||||||
|
if (form.value.id) {
|
||||||
|
if (!updateFileStatus.value) return proxy?.$modal.msgError('请上传图纸文件');
|
||||||
|
buttonLoading.value = true;
|
||||||
|
let data = { id: form.value.id, projectId: form.value.id, file: form.value.file };
|
||||||
|
if (form.value.file === form.value.ossId) {
|
||||||
|
data.file = '';
|
||||||
|
res = await updatePrelimScheme(data).finally(() => (buttonLoading.value = false));
|
||||||
|
|
||||||
|
if (res.code == 200) {
|
||||||
|
dialog.visible = false;
|
||||||
|
submit(status.value, form.value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fileUploadRef.value.submitUpload();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!fileStatus.value) {
|
||||||
|
proxy?.$modal.msgError('请上传图纸文件');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
buttonLoading.value = true;
|
||||||
|
fileUploadRef.value.submitUpload();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const submitFlow = async () => {
|
||||||
|
handleStartWorkFlow(form.value);
|
||||||
|
dialogVisible.visible = false;
|
||||||
|
};
|
||||||
|
//提交申请
|
||||||
|
const handleStartWorkFlow = async (data: LeaveForm) => {
|
||||||
|
try {
|
||||||
|
submitFormData.value.flowCode = flowCode.value;
|
||||||
|
submitFormData.value.businessId = data.id;
|
||||||
|
//流程变量
|
||||||
|
taskVariables.value = {
|
||||||
|
// leave4/5 使用的流程变量
|
||||||
|
userList: ['1', '3', '4']
|
||||||
|
};
|
||||||
|
submitFormData.value.variables = taskVariables.value;
|
||||||
|
const resp = await startWorkFlow(submitFormData.value);
|
||||||
|
if (submitVerifyRef.value) {
|
||||||
|
buttonLoading.value = false;
|
||||||
|
submitVerifyRef.value.openDialog(resp.data.taskId);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
buttonLoading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//审批记录
|
||||||
|
const handleApprovalRecord = () => {
|
||||||
|
approvalRecordRef.value.init(form.value.id);
|
||||||
|
};
|
||||||
|
//提交回调
|
||||||
|
const submitCallback = async () => {
|
||||||
|
await proxy.$tab.closePage(route);
|
||||||
|
router.go(-1);
|
||||||
|
};
|
||||||
|
//审批
|
||||||
|
const approvalVerifyOpen = async () => {
|
||||||
|
submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
||||||
|
};
|
||||||
|
// 图纸上传成功之后 开始提交
|
||||||
|
const submit = async (status, data) => {
|
||||||
|
console.log('🚀 ~ submit ~ status, data:', status, data);
|
||||||
|
|
||||||
|
form.value = data;
|
||||||
|
if (status === 'draft') {
|
||||||
|
console.log(111);
|
||||||
|
|
||||||
|
buttonLoading.value = false;
|
||||||
|
proxy?.$modal.msgSuccess('暂存成功');
|
||||||
|
proxy.$tab.closePage(route);
|
||||||
|
router.go(-1);
|
||||||
|
} else {
|
||||||
|
if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||||
|
flowCode.value = flowCodeOptions[0].value;
|
||||||
|
dialogVisible.visible = true;
|
||||||
|
console.log(221);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//说明启动过先随意穿个参数
|
||||||
|
if (flowCode.value === '' || flowCode.value === null) {
|
||||||
|
flowCode.value = 'xx';
|
||||||
|
}
|
||||||
|
console.log(data);
|
||||||
|
await handleStartWorkFlow(data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const handleUploadSuccess = (list, res) => {
|
||||||
|
dialog.visible = false;
|
||||||
|
if (form.value.id) {
|
||||||
|
submit(status.value, form.value);
|
||||||
|
} else {
|
||||||
|
submit(status.value, { status: 'draft', id: res.data });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const fileStatus = ref(false);
|
||||||
|
const updateFileStatus = ref(true);
|
||||||
|
|
||||||
|
const handleFileChange = (file, fileList) => {
|
||||||
|
if (form.value.id) {
|
||||||
|
updateFileStatus.value = true;
|
||||||
|
}
|
||||||
|
fileStatus.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleFileRemove = (file, fileList) => {
|
||||||
|
if (form.value.id) {
|
||||||
|
updateFileStatus.value = false;
|
||||||
|
}
|
||||||
|
showFileList.value = true;
|
||||||
|
|
||||||
|
fileStatus.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
nextTick(async () => {
|
||||||
|
console.log(1111111111);
|
||||||
|
routeParams.value = route.query;
|
||||||
|
reset();
|
||||||
|
console.log(routeParams.value);
|
||||||
|
|
||||||
|
loading.value = false;
|
||||||
|
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||||
|
getInfo();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
/* 全局样式 */
|
||||||
|
:root {
|
||||||
|
--primary: #409eff;
|
||||||
|
--primary-light: #66b1ff;
|
||||||
|
--primary-dark: #3a8ee6;
|
||||||
|
--success: #67c23a;
|
||||||
|
--warning: #e6a23c;
|
||||||
|
--danger: #f56c6c;
|
||||||
|
--info: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 表单样式优化 */
|
||||||
|
.el-form-item {
|
||||||
|
.el-form-item__label {
|
||||||
|
color: #606266;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-input__inner,
|
||||||
|
.el-select .el-input__inner {
|
||||||
|
border-radius: 4px;
|
||||||
|
transition:
|
||||||
|
border-color 0.2s,
|
||||||
|
box-shadow 0.2s;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
border-color: var(--primary-light);
|
||||||
|
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-textarea__inner {
|
||||||
|
border-radius: 4px;
|
||||||
|
transition:
|
||||||
|
border-color 0.2s,
|
||||||
|
box-shadow 0.2s;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
border-color: var(--primary-light);
|
||||||
|
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 按钮样式优化 */
|
||||||
|
.el-button {
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: all 0.2s;
|
||||||
|
|
||||||
|
&.is-primary {
|
||||||
|
background-color: var(--primary);
|
||||||
|
border-color: var(--primary);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: var(--primary-light);
|
||||||
|
border-color: var(--primary-light);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
background-color: var(--primary-dark);
|
||||||
|
border-color: var(--primary-dark);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.is-text {
|
||||||
|
color: var(--primary);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: var(--primary-light);
|
||||||
|
background-color: rgba(64, 158, 255, 0.05);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 卡片样式优化 */
|
||||||
|
.el-card {
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
/* transform: translateY(-2px); */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 对话框样式优化 */
|
||||||
|
.el-dialog {
|
||||||
|
.el-dialog__header {
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
border-bottom: 1px solid #ebeef5;
|
||||||
|
padding: 15px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dialog__title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dialog__footer {
|
||||||
|
padding: 15px 20px;
|
||||||
|
border-top: 1px solid #ebeef5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
226
src/views/design/scheme/index.vue
Normal file
226
src/views/design/scheme/index.vue
Normal file
@ -0,0 +1,226 @@
|
|||||||
|
<template>
|
||||||
|
<div class="p-2">
|
||||||
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||||
|
<el-form-item label="文件名称" prop="fileName">
|
||||||
|
<el-input v-model="queryParams.fileName" placeholder="请输入文件名称" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
|
||||||
|
<el-card shadow="never">
|
||||||
|
<template #header>
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['design:scheme:add']">新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="schemeList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column label="序号" type="index" width="55" align="center" />
|
||||||
|
<el-table-column label="文件名称" align="center" prop="fileName">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link type="primary" :href="scope.row.fileUrl" target="_blank" :underline="false">
|
||||||
|
{{ scope.row.fileName }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="审核状态" align="center" prop="status">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="wf_business_status" :value="scope.row.status"></dict-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
v-if="scope.row.status === 'draft'"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['design:scheme:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
v-if="scope.row.status === 'draft'"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['design:scheme:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="Scheme" lang="ts">
|
||||||
|
import { listScheme, getScheme, delScheme, addScheme, updateScheme } from '@/api/design/scheme';
|
||||||
|
import { SchemeVO, SchemeQuery, SchemeForm } from '@/api/design/scheme/types';
|
||||||
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
|
||||||
|
// 获取用户 store
|
||||||
|
const userStore = useUserStoreHook();
|
||||||
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
|
const schemeList = ref<SchemeVO[]>([]);
|
||||||
|
const buttonLoading = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref<Array<string | number>>([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
|
||||||
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
|
const schemeFormRef = ref<ElFormInstance>();
|
||||||
|
|
||||||
|
const dialog = reactive<DialogOption>({
|
||||||
|
visible: false,
|
||||||
|
title: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const initFormData: SchemeForm = {
|
||||||
|
id: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
ossId: undefined,
|
||||||
|
fileName: undefined,
|
||||||
|
fileUrl: undefined,
|
||||||
|
status: undefined
|
||||||
|
};
|
||||||
|
const data = reactive<PageData<SchemeForm, SchemeQuery>>({
|
||||||
|
form: { ...initFormData },
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
projectId: undefined,
|
||||||
|
ossId: undefined,
|
||||||
|
fileName: undefined,
|
||||||
|
fileUrl: undefined,
|
||||||
|
status: undefined,
|
||||||
|
params: {}
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||||
|
projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }],
|
||||||
|
ossId: [{ required: true, message: 'ossId不能为空', trigger: 'blur' }],
|
||||||
|
fileName: [{ required: true, message: '文件名称不能为空', trigger: 'blur' }],
|
||||||
|
status: [{ required: true, message: '审核状态不能为空', trigger: 'change' }]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询设计初步方案列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true;
|
||||||
|
const res = await listScheme(queryParams.value);
|
||||||
|
schemeList.value = res.rows;
|
||||||
|
total.value = res.total;
|
||||||
|
loading.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 取消按钮 */
|
||||||
|
const cancel = () => {
|
||||||
|
reset();
|
||||||
|
dialog.visible = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
const reset = () => {
|
||||||
|
form.value = { ...initFormData };
|
||||||
|
schemeFormRef.value?.resetFields();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value?.resetFields();
|
||||||
|
handleQuery();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 多选框选中数据 */
|
||||||
|
const handleSelectionChange = (selection: SchemeVO[]) => {
|
||||||
|
ids.value = selection.map((item) => item.id);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
const handleAdd = () => {
|
||||||
|
proxy.$tab.closePage(route);
|
||||||
|
proxy.$tab.openPage('/design-management/scheme/indexEdit', '', {
|
||||||
|
type: 'add'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
const handleUpdate = async (row?: SchemeVO) => {
|
||||||
|
proxy.$tab.closePage(route);
|
||||||
|
|
||||||
|
proxy.$tab.openPage(`/design-management/scheme/indexEdit`, '', {
|
||||||
|
id: row.id,
|
||||||
|
type: 'update'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (row?: SchemeVO) => {
|
||||||
|
const _ids = row?.id || ids.value;
|
||||||
|
await proxy?.$modal.confirm('是否确认删除设计初步方案编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||||
|
await delScheme(_ids);
|
||||||
|
proxy?.$modal.msgSuccess('删除成功');
|
||||||
|
await getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = () => {
|
||||||
|
proxy?.download(
|
||||||
|
'design/scheme/export',
|
||||||
|
{
|
||||||
|
...queryParams.value
|
||||||
|
},
|
||||||
|
`scheme_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
|
||||||
|
//监听项目id刷新数据
|
||||||
|
const listeningProject = watch(
|
||||||
|
() => currentProject.value.id,
|
||||||
|
(nid, oid) => {
|
||||||
|
queryParams.value.projectId = nid;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
listeningProject();
|
||||||
|
});
|
||||||
|
</script>
|
431
src/views/design/scheme/indexEdit.vue
Normal file
431
src/views/design/scheme/indexEdit.vue
Normal file
@ -0,0 +1,431 @@
|
|||||||
|
<template>
|
||||||
|
<div class="p-4 bg-gray-50 min-h-screen">
|
||||||
|
<div class="max-w-4xl mx-auto">
|
||||||
|
<!-- 顶部按钮区域 -->
|
||||||
|
<el-card class="mb-4 rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md">
|
||||||
|
<approvalButton
|
||||||
|
@submitForm="submitForm"
|
||||||
|
@approvalVerifyOpen="approvalVerifyOpen"
|
||||||
|
@handleApprovalRecord="handleApprovalRecord"
|
||||||
|
:buttonLoading="buttonLoading"
|
||||||
|
:id="form.id"
|
||||||
|
:status="form.status"
|
||||||
|
:pageType="routeParams.type"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 表单区域 -->
|
||||||
|
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
||||||
|
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
|
||||||
|
<h3 class="text-lg font-semibold text-gray-800">设计方案信息</h3>
|
||||||
|
</div>
|
||||||
|
<div class="p-6">
|
||||||
|
<el-form
|
||||||
|
ref="leaveFormRef"
|
||||||
|
v-loading="loading"
|
||||||
|
:disabled="routeParams.type === 'view'"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
label-width="120px"
|
||||||
|
class="space-y-4"
|
||||||
|
>
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
|
<el-form-item label="设计方案" prop="fileUrl" class="mb-2">
|
||||||
|
<file-upload
|
||||||
|
:limit="1"
|
||||||
|
:fileType="['pdf']"
|
||||||
|
:fileSize="100"
|
||||||
|
v-model="form.file"
|
||||||
|
ref="fileUploadRef"
|
||||||
|
class="w-full"
|
||||||
|
:auto-upload="false"
|
||||||
|
:data="{ projectId: currentProject.id }"
|
||||||
|
:showFileList="showFileList"
|
||||||
|
:onUploadSuccess="handleUploadSuccess"
|
||||||
|
:uploadUrl="`${form.id ? '/design/scheme/update/' + form.id : '/design/scheme/upload'}`"
|
||||||
|
@handleChange="handleFileChange"
|
||||||
|
@handleRemove="handleFileRemove"
|
||||||
|
></file-upload>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<!-- 提交组件 -->
|
||||||
|
<approvalRecord ref="approvalRecordRef"></approvalRecord>
|
||||||
|
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||||
|
<!-- 流程选择对话框 -->
|
||||||
|
<el-dialog
|
||||||
|
draggable
|
||||||
|
v-model="dialogVisible.visible"
|
||||||
|
:title="dialogVisible.title"
|
||||||
|
:before-close="handleClose"
|
||||||
|
width="500"
|
||||||
|
class="rounded-lg shadow-lg"
|
||||||
|
>
|
||||||
|
<div class="p-4">
|
||||||
|
<p class="text-gray-600 mb-4">请选择要启动的流程:</p>
|
||||||
|
<el-select v-model="flowCode" placeholder="请选择流程" style="width: 100%">
|
||||||
|
<el-option v-for="item in flowCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer p-4 border-t border-gray-100 flex justify-end space-x-3">
|
||||||
|
<el-button @click="handleClose" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors"
|
||||||
|
>取消</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" @click="submitFlow()" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors"
|
||||||
|
>确认</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="Leave" lang="ts">
|
||||||
|
import { LeaveForm, LeaveQuery } from '@/api/workflow/leave/types';
|
||||||
|
import { startWorkFlow } from '@/api/workflow/task';
|
||||||
|
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
||||||
|
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||||
|
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
import { DrawingForm } from '@/api/design/drawing/types';
|
||||||
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
|
import { getSpecialScheme, addSpecialScheme, updateSpecialScheme } from '@/api/design/specialScheme';
|
||||||
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
|
import { getScheme, updateScheme } from '@/api/design/scheme';
|
||||||
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
// 获取用户 store
|
||||||
|
const userStore = useUserStoreHook();
|
||||||
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
|
const buttonLoading = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
//路由参数
|
||||||
|
const routeParams = ref<Record<string, any>>({});
|
||||||
|
const flowCode = ref<string>('');
|
||||||
|
const status = ref<string>('');
|
||||||
|
const dialogVisible = reactive<DialogOption>({
|
||||||
|
visible: false,
|
||||||
|
title: '流程定义'
|
||||||
|
});
|
||||||
|
const showFileList = ref(true);
|
||||||
|
//提交组件
|
||||||
|
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||||
|
//审批记录组件
|
||||||
|
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||||
|
const fileUploadRef = ref<InstanceType<typeof fileUploadRef>>();
|
||||||
|
|
||||||
|
const leaveFormRef = ref<ElFormInstance>();
|
||||||
|
const dialog = reactive({
|
||||||
|
visible: false,
|
||||||
|
title: '',
|
||||||
|
isEdit: false
|
||||||
|
});
|
||||||
|
const submitFormData = ref<StartProcessBo>({
|
||||||
|
businessId: '',
|
||||||
|
flowCode: '',
|
||||||
|
variables: {}
|
||||||
|
});
|
||||||
|
const taskVariables = ref<Record<string, any>>({});
|
||||||
|
const flowCodeOptions = [
|
||||||
|
{
|
||||||
|
value: currentProject.value?.id + '_scheme',
|
||||||
|
label: '设计方案审批'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
const initFormData: any = {
|
||||||
|
projectId: currentProject.value?.id,
|
||||||
|
file: undefined
|
||||||
|
};
|
||||||
|
const data = reactive<any>({
|
||||||
|
form: { ...initFormData },
|
||||||
|
rules: {
|
||||||
|
file: [
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
// 新增时必须上传文件
|
||||||
|
if (!form.value.file) {
|
||||||
|
callback(new Error('请上传图纸文件'));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
trigger: 'change'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const { form, rules } = toRefs(data);
|
||||||
|
const handleClose = () => {
|
||||||
|
dialogVisible.visible = false;
|
||||||
|
flowCode.value = '';
|
||||||
|
buttonLoading.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
const reset = () => {
|
||||||
|
form.value = { ...initFormData };
|
||||||
|
leaveFormRef.value?.resetFields();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 获取详情 */
|
||||||
|
const getInfo = () => {
|
||||||
|
loading.value = true;
|
||||||
|
buttonLoading.value = false;
|
||||||
|
nextTick(async () => {
|
||||||
|
const res = await getScheme(routeParams.value.id);
|
||||||
|
Object.assign(form.value, res.data);
|
||||||
|
form.value.file = res.data.ossId;
|
||||||
|
showFileList.value = false;
|
||||||
|
|
||||||
|
loading.value = false;
|
||||||
|
buttonLoading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
const submitForm = async (status1: string) => {
|
||||||
|
status.value = status1;
|
||||||
|
|
||||||
|
var res;
|
||||||
|
if (form.value.id) {
|
||||||
|
if (!updateFileStatus.value) return proxy?.$modal.msgError('请上传图纸文件');
|
||||||
|
buttonLoading.value = true;
|
||||||
|
|
||||||
|
let data = { id: form.value.id, projectId: form.value.id, file: form.value.file };
|
||||||
|
if (form.value.file === form.value.ossId) {
|
||||||
|
data.file = '';
|
||||||
|
res = await updateScheme(data).finally(() => (buttonLoading.value = false));
|
||||||
|
if (res.code == 200) {
|
||||||
|
dialog.visible = false;
|
||||||
|
submit(status.value, form.value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fileUploadRef.value.submitUpload();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!fileStatus.value) {
|
||||||
|
proxy?.$modal.msgError('请上传图纸文件');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
buttonLoading.value = true;
|
||||||
|
|
||||||
|
fileUploadRef.value.submitUpload();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const submitFlow = async () => {
|
||||||
|
handleStartWorkFlow(form.value);
|
||||||
|
dialogVisible.visible = false;
|
||||||
|
};
|
||||||
|
//提交申请
|
||||||
|
const handleStartWorkFlow = async (data: LeaveForm) => {
|
||||||
|
try {
|
||||||
|
submitFormData.value.flowCode = flowCode.value;
|
||||||
|
submitFormData.value.businessId = data.id;
|
||||||
|
//流程变量
|
||||||
|
taskVariables.value = {
|
||||||
|
// leave4/5 使用的流程变量
|
||||||
|
userList: ['1', '3', '4']
|
||||||
|
};
|
||||||
|
submitFormData.value.variables = taskVariables.value;
|
||||||
|
const resp = await startWorkFlow(submitFormData.value);
|
||||||
|
if (submitVerifyRef.value) {
|
||||||
|
buttonLoading.value = false;
|
||||||
|
submitVerifyRef.value.openDialog(resp.data.taskId);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
buttonLoading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//审批记录
|
||||||
|
const handleApprovalRecord = () => {
|
||||||
|
approvalRecordRef.value.init(form.value.id);
|
||||||
|
};
|
||||||
|
//提交回调
|
||||||
|
const submitCallback = async () => {
|
||||||
|
await proxy.$tab.closePage(route);
|
||||||
|
router.go(-1);
|
||||||
|
};
|
||||||
|
//审批
|
||||||
|
const approvalVerifyOpen = async () => {
|
||||||
|
submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
||||||
|
};
|
||||||
|
// 图纸上传成功之后 开始提交
|
||||||
|
const submit = async (status, data) => {
|
||||||
|
console.log('🚀 ~ submit ~ status, data:', status, data);
|
||||||
|
|
||||||
|
form.value = data;
|
||||||
|
if (status === 'draft') {
|
||||||
|
console.log(111);
|
||||||
|
|
||||||
|
buttonLoading.value = false;
|
||||||
|
proxy?.$modal.msgSuccess('暂存成功');
|
||||||
|
proxy.$tab.closePage(route);
|
||||||
|
router.go(-1);
|
||||||
|
} else {
|
||||||
|
if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||||
|
flowCode.value = flowCodeOptions[0].value;
|
||||||
|
dialogVisible.visible = true;
|
||||||
|
console.log(221);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//说明启动过先随意穿个参数
|
||||||
|
if (flowCode.value === '' || flowCode.value === null) {
|
||||||
|
flowCode.value = 'xx';
|
||||||
|
}
|
||||||
|
console.log(data);
|
||||||
|
await handleStartWorkFlow(data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const handleUploadSuccess = (list, res) => {
|
||||||
|
dialog.visible = false;
|
||||||
|
if (form.value.id) {
|
||||||
|
submit(status.value, form.value);
|
||||||
|
} else {
|
||||||
|
submit(status.value, { status: 'draft', id: res.data });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const fileStatus = ref(false);
|
||||||
|
const updateFileStatus = ref(true);
|
||||||
|
|
||||||
|
const handleFileChange = (file, fileList) => {
|
||||||
|
if (form.value.id) {
|
||||||
|
updateFileStatus.value = true;
|
||||||
|
}
|
||||||
|
fileStatus.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleFileRemove = (file, fileList) => {
|
||||||
|
if (form.value.id) {
|
||||||
|
updateFileStatus.value = false;
|
||||||
|
}
|
||||||
|
showFileList.value = true;
|
||||||
|
|
||||||
|
fileStatus.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
nextTick(async () => {
|
||||||
|
console.log(1111111111);
|
||||||
|
routeParams.value = route.query;
|
||||||
|
reset();
|
||||||
|
console.log(routeParams.value);
|
||||||
|
|
||||||
|
loading.value = false;
|
||||||
|
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||||
|
getInfo();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
/* 全局样式 */
|
||||||
|
:root {
|
||||||
|
--primary: #409eff;
|
||||||
|
--primary-light: #66b1ff;
|
||||||
|
--primary-dark: #3a8ee6;
|
||||||
|
--success: #67c23a;
|
||||||
|
--warning: #e6a23c;
|
||||||
|
--danger: #f56c6c;
|
||||||
|
--info: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 表单样式优化 */
|
||||||
|
.el-form-item {
|
||||||
|
.el-form-item__label {
|
||||||
|
color: #606266;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-input__inner,
|
||||||
|
.el-select .el-input__inner {
|
||||||
|
border-radius: 4px;
|
||||||
|
transition:
|
||||||
|
border-color 0.2s,
|
||||||
|
box-shadow 0.2s;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
border-color: var(--primary-light);
|
||||||
|
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-textarea__inner {
|
||||||
|
border-radius: 4px;
|
||||||
|
transition:
|
||||||
|
border-color 0.2s,
|
||||||
|
box-shadow 0.2s;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
border-color: var(--primary-light);
|
||||||
|
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 按钮样式优化 */
|
||||||
|
.el-button {
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: all 0.2s;
|
||||||
|
|
||||||
|
&.is-primary {
|
||||||
|
background-color: var(--primary);
|
||||||
|
border-color: var(--primary);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: var(--primary-light);
|
||||||
|
border-color: var(--primary-light);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
background-color: var(--primary-dark);
|
||||||
|
border-color: var(--primary-dark);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.is-text {
|
||||||
|
color: var(--primary);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: var(--primary-light);
|
||||||
|
background-color: rgba(64, 158, 255, 0.05);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 卡片样式优化 */
|
||||||
|
.el-card {
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
/* transform: translateY(-2px); */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 对话框样式优化 */
|
||||||
|
.el-dialog {
|
||||||
|
.el-dialog__header {
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
border-bottom: 1px solid #ebeef5;
|
||||||
|
padding: 15px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dialog__title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dialog__footer {
|
||||||
|
padding: 15px 20px;
|
||||||
|
border-top: 1px solid #ebeef5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
237
src/views/design/subcontract/index.vue
Normal file
237
src/views/design/subcontract/index.vue
Normal file
@ -0,0 +1,237 @@
|
|||||||
|
<template>
|
||||||
|
<div class="p-2">
|
||||||
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||||
|
<el-form-item label="分包内容" prop="subContent">
|
||||||
|
<el-input v-model="queryParams.subContent" placeholder="请输入分包内容" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
|
||||||
|
<el-card shadow="never">
|
||||||
|
<template #header>
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['design:subcontract:add']">新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['design:subcontract:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['design:subcontract:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['design:subcontract:export']">导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="subcontractList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="序号" align="center" type="index" width="50" />
|
||||||
|
<el-table-column label="分包内容" align="center" prop="subContent" />
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tooltip content="修改" placement="top">
|
||||||
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['design:subcontract:edit']"></el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
<el-tooltip content="删除" placement="top">
|
||||||
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['design:subcontract:remove']"></el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
|
</el-card>
|
||||||
|
<!-- 添加或修改设计分包对话框 -->
|
||||||
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||||
|
<el-form ref="subcontractFormRef" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="分包内容" prop="subContent">
|
||||||
|
<el-input v-model="form.subContent" type="textarea" placeholder="请输入分包内容" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="Subcontract" lang="ts">
|
||||||
|
import { listSubcontract, getSubcontract, delSubcontract, addSubcontract, updateSubcontract } from '@/api/design/subcontract';
|
||||||
|
import { SubcontractVO, SubcontractQuery, SubcontractForm } from '@/api/design/subcontract/types';
|
||||||
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
// 获取用户 store
|
||||||
|
const userStore = useUserStoreHook();
|
||||||
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
|
const subcontractList = ref<SubcontractVO[]>([]);
|
||||||
|
const buttonLoading = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref<Array<string | number>>([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
|
||||||
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
|
const subcontractFormRef = ref<ElFormInstance>();
|
||||||
|
|
||||||
|
const dialog = reactive<DialogOption>({
|
||||||
|
visible: false,
|
||||||
|
title: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const initFormData: SubcontractForm = {
|
||||||
|
id: undefined,
|
||||||
|
projectId: currentProject.value.id,
|
||||||
|
subContent: undefined
|
||||||
|
};
|
||||||
|
const data = reactive<PageData<SubcontractForm, SubcontractQuery>>({
|
||||||
|
form: { ...initFormData },
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
projectId: currentProject.value.id,
|
||||||
|
subContent: undefined,
|
||||||
|
params: {}
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||||
|
projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }],
|
||||||
|
subContent: [{ required: true, message: '分包内容不能为空', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询设计分包列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true;
|
||||||
|
const res = await listSubcontract(queryParams.value);
|
||||||
|
subcontractList.value = res.rows;
|
||||||
|
total.value = res.total;
|
||||||
|
loading.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 取消按钮 */
|
||||||
|
const cancel = () => {
|
||||||
|
reset();
|
||||||
|
dialog.visible = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
const reset = () => {
|
||||||
|
form.value = { ...initFormData };
|
||||||
|
subcontractFormRef.value?.resetFields();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value?.resetFields();
|
||||||
|
handleQuery();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 多选框选中数据 */
|
||||||
|
const handleSelectionChange = (selection: SubcontractVO[]) => {
|
||||||
|
ids.value = selection.map((item) => item.id);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
const handleAdd = () => {
|
||||||
|
reset();
|
||||||
|
dialog.visible = true;
|
||||||
|
dialog.title = '添加设计分包';
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
const handleUpdate = async (row?: SubcontractVO) => {
|
||||||
|
reset();
|
||||||
|
const _id = row?.id || ids.value[0];
|
||||||
|
const res = await getSubcontract(_id);
|
||||||
|
Object.assign(form.value, res.data);
|
||||||
|
dialog.visible = true;
|
||||||
|
dialog.title = '修改设计分包';
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
const submitForm = () => {
|
||||||
|
subcontractFormRef.value?.validate(async (valid: boolean) => {
|
||||||
|
if (valid) {
|
||||||
|
buttonLoading.value = true;
|
||||||
|
if (form.value.id) {
|
||||||
|
await updateSubcontract(form.value).finally(() => (buttonLoading.value = false));
|
||||||
|
} else {
|
||||||
|
await addSubcontract(form.value).finally(() => (buttonLoading.value = false));
|
||||||
|
}
|
||||||
|
proxy?.$modal.msgSuccess('操作成功');
|
||||||
|
dialog.visible = false;
|
||||||
|
await getList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (row?: SubcontractVO) => {
|
||||||
|
const _ids = row?.id || ids.value;
|
||||||
|
await proxy?.$modal.confirm('是否确认删除设计分包编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||||
|
await delSubcontract(_ids);
|
||||||
|
proxy?.$modal.msgSuccess('删除成功');
|
||||||
|
await getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = () => {
|
||||||
|
proxy?.download(
|
||||||
|
'design/subcontract/export',
|
||||||
|
{
|
||||||
|
...queryParams.value
|
||||||
|
},
|
||||||
|
`subcontract_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
|
||||||
|
//监听项目id刷新数据
|
||||||
|
const listeningProject = watch(
|
||||||
|
() => currentProject.value.id,
|
||||||
|
(nid, oid) => {
|
||||||
|
queryParams.value.projectId = nid;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
listeningProject();
|
||||||
|
});
|
||||||
|
</script>
|
@ -44,10 +44,20 @@
|
|||||||
|
|
||||||
<el-table v-loading="loading" :data="volumeCatalogList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="volumeCatalogList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<!-- <el-table-column label="子项ID" align="center" prop="designSubitemId" /> -->
|
<el-table-column label="子项ID" align="center" prop="designSubitemId" />
|
||||||
|
<el-table-column label="子项名称" align="center" prop="designSubitemName" />
|
||||||
|
<el-table-column label="设计状态" align="center" prop="designState">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="design_state" :value="scope.row.designState" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="专业" align="center" prop="specialty" />
|
||||||
|
<el-table-column label="负责人" align="center" prop="principal" />
|
||||||
<el-table-column label="卷册号" align="center" prop="volumeNumber" />
|
<el-table-column label="卷册号" align="center" prop="volumeNumber" />
|
||||||
<el-table-column label="资料名称" align="center" prop="documentName" />
|
<el-table-column label="资料名称" align="center" prop="documentName" />
|
||||||
<el-table-column label="文件" align="center" prop="fileVoList">
|
<el-table-column label="计划完成时间" align="center" prop="planCompleteTime" />
|
||||||
|
|
||||||
|
<el-table-column label="文件" align="center" prop="fileVoList" width="180">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-link
|
<el-link
|
||||||
v-for="item in scope.row.fileVoList"
|
v-for="item in scope.row.fileVoList"
|
||||||
@ -56,7 +66,7 @@
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
:type="item.status == '1' ? 'primary' : 'info'"
|
:type="item.status == '1' ? 'primary' : 'info'"
|
||||||
:underline="false"
|
:underline="false"
|
||||||
@click="lookFile(scope.row.id)"
|
@click="lookFile(scope.row.design)"
|
||||||
>
|
>
|
||||||
{{ item.fileName }}
|
{{ item.fileName }}
|
||||||
</el-link>
|
</el-link>
|
||||||
@ -68,7 +78,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<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" width="220">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['design:volumeCatalog:edit']">修改</el-button>
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['design:volumeCatalog:edit']">修改</el-button>
|
||||||
<el-button link type="primary" icon="Upload" @click="handleUpload(scope.row)">上传</el-button>
|
<el-button link type="primary" icon="Upload" @click="handleUpload(scope.row)">上传</el-button>
|
||||||
@ -83,10 +93,27 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
<!-- 添加或修改卷册目录对话框 -->
|
<!-- 添加或修改卷册目录对话框 -->
|
||||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||||
<el-form ref="volumeCatalogFormRef" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="volumeCatalogFormRef" :model="form" :rules="rules" label-width="100px">
|
||||||
<!-- <el-form-item label="子项ID" prop="designSubitemId">
|
<el-form-item label="子项ID" prop="designSubitemId">
|
||||||
<el-input v-model="form.designSubitemId" placeholder="请输入设计子项ID" />
|
<el-input v-model="form.designSubitemId" placeholder="请输入设计子项ID" />
|
||||||
</el-form-item> -->
|
</el-form-item>
|
||||||
|
<el-form-item label="子项" prop="designSubitem">
|
||||||
|
<el-input v-model="form.designSubitem" placeholder="请输入设计子项" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="专业" prop="specialty">
|
||||||
|
<el-input v-model="form.specialty" placeholder="请输入专业" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="负责人" prop="principal">
|
||||||
|
<el-input v-model="form.principal" placeholder="请输入负责人" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="计划完成时间" prop="plannedCompletion">
|
||||||
|
<el-date-picker v-model="form.plannedCompletion" type="date" value-format="YYYY-MM-DD" placeholder="请选择计划完成时间" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设计状态" prop="designState">
|
||||||
|
<el-select v-model="form.designState" placeholder="请选择设计状态">
|
||||||
|
<el-option :value="item.value" v-for="item in design_state" :key="item.value" :label="item.label" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="卷册号" prop="volumeNumber">
|
<el-form-item label="卷册号" prop="volumeNumber">
|
||||||
<el-input v-model="form.volumeNumber" placeholder="请输入卷册号" />
|
<el-input v-model="form.volumeNumber" placeholder="请输入卷册号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -147,6 +174,7 @@ import { VolumeCatalogVO, VolumeCatalogQuery, VolumeCatalogForm } from '@/api/de
|
|||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
const { design_state } = toRefs(proxy?.useDict('design_state'));
|
||||||
|
|
||||||
const volumeCatalogList = ref<VolumeCatalogVO[]>([]);
|
const volumeCatalogList = ref<VolumeCatalogVO[]>([]);
|
||||||
const buttonLoading = ref(false);
|
const buttonLoading = ref(false);
|
||||||
@ -181,11 +209,12 @@ const uploadForm = reactive({
|
|||||||
const userList = ref([]);
|
const userList = ref([]);
|
||||||
|
|
||||||
const initFormData: VolumeCatalogForm = {
|
const initFormData: VolumeCatalogForm = {
|
||||||
id: undefined,
|
design: undefined,
|
||||||
projectId: currentProject.value?.id || '',
|
projectId: currentProject.value?.id || '',
|
||||||
designSubitemId: undefined,
|
designSubitemId: undefined,
|
||||||
volumeNumber: undefined,
|
volumeNumber: undefined,
|
||||||
documentName: undefined,
|
documentName: undefined,
|
||||||
|
|
||||||
remark: undefined
|
remark: undefined
|
||||||
};
|
};
|
||||||
const data = reactive<PageData<VolumeCatalogForm, VolumeCatalogQuery>>({
|
const data = reactive<PageData<VolumeCatalogForm, VolumeCatalogQuery>>({
|
||||||
@ -200,7 +229,7 @@ const data = reactive<PageData<VolumeCatalogForm, VolumeCatalogQuery>>({
|
|||||||
params: {}
|
params: {}
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
design: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||||
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
|
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
|
||||||
volumeNumber: [{ required: true, message: '卷册号不能为空', trigger: 'blur' }],
|
volumeNumber: [{ required: true, message: '卷册号不能为空', trigger: 'blur' }],
|
||||||
documentName: [{ required: true, message: '资料名称不能为空', trigger: 'blur' }]
|
documentName: [{ required: true, message: '资料名称不能为空', trigger: 'blur' }]
|
||||||
@ -247,7 +276,7 @@ const resetQuery = () => {
|
|||||||
|
|
||||||
/** 多选框选中数据 */
|
/** 多选框选中数据 */
|
||||||
const handleSelectionChange = (selection: VolumeCatalogVO[]) => {
|
const handleSelectionChange = (selection: VolumeCatalogVO[]) => {
|
||||||
ids.value = selection.map((item) => item.id);
|
ids.value = selection.map((item) => item.design);
|
||||||
single.value = selection.length != 1;
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
};
|
};
|
||||||
@ -262,7 +291,7 @@ const handleAdd = () => {
|
|||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
const handleUpdate = async (row?: VolumeCatalogVO) => {
|
const handleUpdate = async (row?: VolumeCatalogVO) => {
|
||||||
reset();
|
reset();
|
||||||
const _id = row?.id || ids.value[0];
|
const _id = row?.design || ids.value[0];
|
||||||
const res = await getVolumeCatalog(_id);
|
const res = await getVolumeCatalog(_id);
|
||||||
Object.assign(form.value, res.data);
|
Object.assign(form.value, res.data);
|
||||||
dialog.visible = true;
|
dialog.visible = true;
|
||||||
@ -273,9 +302,9 @@ const handleUpdate = async (row?: VolumeCatalogVO) => {
|
|||||||
const uploadVisible = ref(false);
|
const uploadVisible = ref(false);
|
||||||
const handleUpload = async (row?: any) => {
|
const handleUpload = async (row?: any) => {
|
||||||
resetUploadForm();
|
resetUploadForm();
|
||||||
uploadForm.volumeCatalogId = row.id;
|
uploadForm.volumeCatalogId = row.design;
|
||||||
userList.value = row.noViewerList;
|
userList.value = row.noViewerList;
|
||||||
const res = await getVolumeCatafileList(row.id);
|
const res = await getVolumeCatafileList(row.design);
|
||||||
uploadForm.fileList = res.data.filter((item) => item.status == '1') || [];
|
uploadForm.fileList = res.data.filter((item) => item.status == '1') || [];
|
||||||
uploadVisible.value = true;
|
uploadVisible.value = true;
|
||||||
};
|
};
|
||||||
@ -300,7 +329,7 @@ const submitForm = () => {
|
|||||||
volumeCatalogFormRef.value?.validate(async (valid: boolean) => {
|
volumeCatalogFormRef.value?.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
buttonLoading.value = true;
|
buttonLoading.value = true;
|
||||||
if (form.value.id) {
|
if (form.value.design) {
|
||||||
await updateVolumeCatalog(form.value).finally(() => (buttonLoading.value = false));
|
await updateVolumeCatalog(form.value).finally(() => (buttonLoading.value = false));
|
||||||
} else {
|
} else {
|
||||||
await addVolumeCatalog(form.value).finally(() => (buttonLoading.value = false));
|
await addVolumeCatalog(form.value).finally(() => (buttonLoading.value = false));
|
||||||
@ -329,7 +358,7 @@ const onSubmit = async () => {
|
|||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
const handleDelete = async (row?: VolumeCatalogVO) => {
|
const handleDelete = async (row?: VolumeCatalogVO) => {
|
||||||
const _ids = row?.id || ids.value;
|
const _ids = row?.design || ids.value;
|
||||||
await proxy?.$modal.confirm('是否确认删除卷册目录编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
await proxy?.$modal.confirm('是否确认删除卷册目录编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||||
await delVolumeCatalog(_ids);
|
await delVolumeCatalog(_ids);
|
||||||
proxy?.$modal.msgSuccess('删除成功');
|
proxy?.$modal.msgSuccess('删除成功');
|
||||||
|
Reference in New Issue
Block a user