Merge branch 'main' of http://192.168.110.2:3000/taoge/mk_system into fs
This commit is contained in:
@ -5,7 +5,7 @@ VITE_APP_TITLE = 煤科建管平台
|
||||
VITE_APP_ENV = 'development'
|
||||
|
||||
# 开发环境
|
||||
VITE_APP_BASE_API = 'http://192.168.110.213:8899'
|
||||
VITE_APP_BASE_API = 'http://192.168.110.180:8899'
|
||||
|
||||
# 无人机接口地址
|
||||
|
||||
|
55
public/image/convert_tif.bat
Normal file
55
public/image/convert_tif.bat
Normal file
@ -0,0 +1,55 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
REM 源文件
|
||||
set SRC=odm_orthophoto.tif
|
||||
|
||||
REM 中间文件:去掩膜 + 保留 4 波段
|
||||
set TMP1=tmp_nomask.tif
|
||||
|
||||
REM 中间文件:gdalwarp 处理透明通道
|
||||
set TMP2=tmp_nomask_alpha.tif
|
||||
|
||||
REM 最终输出文件(性能优化:缩放 + 压缩)
|
||||
set FINAL=clean_no_mask_optimized.tif
|
||||
|
||||
REM 配置参数
|
||||
REM -tr 0.25x 分辨率控制(0.25 倍像素,或者每个像素大小扩大4倍),视你项目需要可调
|
||||
REM -co 压缩参数:LZW 是无损压缩方式,TILED=YES 支持分块加载
|
||||
REM -r average 使用平均值重采样可保持图像质量
|
||||
|
||||
echo [1/4] gdal_translate:去除掩膜并保留RGBA四波段...
|
||||
gdal_translate -b 1 -b 2 -b 3 -b 4 -mask none -co PHOTOMETRIC=RGB -co ALPHA=YES %SRC% %TMP1%
|
||||
if errorlevel 1 (
|
||||
echo ❌ gdal_translate 失败
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [2/4] gdalwarp:强制生成 Alpha 通道...
|
||||
gdalwarp -dstalpha %TMP1% %TMP2%
|
||||
if errorlevel 1 (
|
||||
echo ❌ gdalwarp 失败
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [3/4] gdalwarp:降采样并启用压缩优化...
|
||||
gdalwarp ^
|
||||
-r average ^
|
||||
-tr 2 2 ^
|
||||
-co COMPRESS=LZW ^
|
||||
-co TILED=YES ^
|
||||
-co PHOTOMETRIC=RGB ^
|
||||
-co ALPHA=YES ^
|
||||
%TMP2% %FINAL%
|
||||
if errorlevel 1 (
|
||||
echo ❌ gdalwarp 压缩优化失败
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [4/4] 清理临时文件...
|
||||
del %TMP1%
|
||||
del %TMP2%
|
||||
|
||||
echo ✅ 完成!优化后的 GeoTIFF 已生成:%FINAL%
|
||||
endlocal
|
||||
pause
|
@ -61,3 +61,23 @@ export const delDesignChange = (id: string | number | Array<string | number>) =>
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 获取卷册号
|
||||
* @param id
|
||||
*/
|
||||
export const blueprintList = (id) => {
|
||||
return request({
|
||||
url: '/design/designChange/blueprint/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 获取卷册列表
|
||||
* @param id
|
||||
*/
|
||||
export const catalogList = (id) => {
|
||||
return request({
|
||||
url: '/design/designChange/catalogList/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
@ -82,3 +82,14 @@ export const volumeFileViewerList = (id) => {
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 查阅图纸列表
|
||||
* @param id
|
||||
*/
|
||||
export const joinList = (params) => {
|
||||
return request({
|
||||
url: '/design/volumeFile/joinList',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
};
|
||||
|
@ -65,7 +65,7 @@ export const addVolumeCatalog = (data: VolumeCatalogForm) => {
|
||||
* 修改卷册目录
|
||||
* @param data
|
||||
*/
|
||||
export const updateVolumeCatalog = (data: VolumeCatalogForm) => {
|
||||
export const updateVolumeCatalog = (data) => {
|
||||
return request({
|
||||
url: '/design/volumeCatalog',
|
||||
method: 'put',
|
||||
|
@ -130,3 +130,16 @@ export const listSelectCailiaoshebei = (query?: any): AxiosPromise<Cailiaoshebei
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询字典数据
|
||||
* @param dictType
|
||||
* @returns {*}
|
||||
*/
|
||||
export const getDictList = (query: any): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/cailiaoshebei/purchaseDoc/engineeringList',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
@ -121,3 +121,10 @@ export const logisticsDetial = (id) => {
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
export const getDetailBASE = (id) => {
|
||||
return request({
|
||||
url: '/cailiaoshebei/purchaseDoc/pic/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
63
src/api/patch/index.ts
Normal file
63
src/api/patch/index.ts
Normal file
@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { MasterVO, MasterForm, MasterQuery } from '@/api/patch/master/types';
|
||||
|
||||
/**
|
||||
* 查询派单列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listMaster = (query?: MasterQuery): AxiosPromise<MasterVO[]> => {
|
||||
return request({
|
||||
url: '/patch/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询派单详细
|
||||
* @param id
|
||||
*/
|
||||
export const getMaster = (id: string | number): AxiosPromise<MasterVO> => {
|
||||
return request({
|
||||
url: '/patch/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增派单
|
||||
* @param data
|
||||
*/
|
||||
export const addMaster = (data: MasterForm) => {
|
||||
return request({
|
||||
url: '/patch/',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改派单
|
||||
* @param data
|
||||
*/
|
||||
export const updateMaster = (data: MasterForm) => {
|
||||
return request({
|
||||
url: '/patch/',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除派单
|
||||
* @param id
|
||||
*/
|
||||
export const delMaster = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/patch/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
141
src/api/patch/types.ts
Normal file
141
src/api/patch/types.ts
Normal file
@ -0,0 +1,141 @@
|
||||
export interface MasterVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
projectId: string | number;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
taskName: string;
|
||||
|
||||
/**
|
||||
* 任务描述
|
||||
*/
|
||||
describe: string;
|
||||
|
||||
/**
|
||||
* 计划完成时间
|
||||
*/
|
||||
pcd: string;
|
||||
|
||||
/**
|
||||
* 实际完成时间
|
||||
*/
|
||||
act: string;
|
||||
|
||||
/**
|
||||
* 完成进度
|
||||
*/
|
||||
completionProgress: string;
|
||||
|
||||
/**
|
||||
* 任务状态
|
||||
*/
|
||||
taskStatus: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface MasterForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
taskName?: string;
|
||||
|
||||
/**
|
||||
* 任务描述
|
||||
*/
|
||||
describe?: string;
|
||||
|
||||
/**
|
||||
* 计划完成时间
|
||||
*/
|
||||
pcd?: string;
|
||||
|
||||
/**
|
||||
* 实际完成时间
|
||||
*/
|
||||
act?: string;
|
||||
|
||||
/**
|
||||
* 完成进度
|
||||
*/
|
||||
completionProgress?: string;
|
||||
|
||||
/**
|
||||
* 任务状态
|
||||
*/
|
||||
taskStatus?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface MasterQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
taskName?: string;
|
||||
|
||||
/**
|
||||
* 任务描述
|
||||
*/
|
||||
describe?: string;
|
||||
|
||||
/**
|
||||
* 计划完成时间
|
||||
*/
|
||||
pcd?: string;
|
||||
|
||||
/**
|
||||
* 实际完成时间
|
||||
*/
|
||||
act?: string;
|
||||
|
||||
/**
|
||||
* 完成进度
|
||||
*/
|
||||
completionProgress?: string;
|
||||
|
||||
/**
|
||||
* 任务状态
|
||||
*/
|
||||
taskStatus?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
63
src/api/plan/plan/index.ts
Normal file
63
src/api/plan/plan/index.ts
Normal file
@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { PlanVO, PlanForm, PlanQuery } from '@/api/plan/plan/types';
|
||||
|
||||
/**
|
||||
* 查询招标计划列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listPlan = (query?: PlanQuery): AxiosPromise<PlanVO[]> => {
|
||||
return request({
|
||||
url: '/plan/plan/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询招标计划详细
|
||||
* @param id
|
||||
*/
|
||||
export const getPlan = (id: string | number): AxiosPromise<PlanVO> => {
|
||||
return request({
|
||||
url: '/plan/plan/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增招标计划
|
||||
* @param data
|
||||
*/
|
||||
export const addPlan = (data: PlanForm) => {
|
||||
return request({
|
||||
url: '/plan/plan',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改招标计划
|
||||
* @param data
|
||||
*/
|
||||
export const updatePlan = (data: PlanForm) => {
|
||||
return request({
|
||||
url: '/plan/plan',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除招标计划
|
||||
* @param id
|
||||
*/
|
||||
export const delPlan = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/plan/plan/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
161
src/api/plan/plan/types.ts
Normal file
161
src/api/plan/plan/types.ts
Normal file
@ -0,0 +1,161 @@
|
||||
export interface PlanVO {
|
||||
/**
|
||||
* 招标计划ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 分包类型
|
||||
*/
|
||||
subpackageType: string;
|
||||
|
||||
/**
|
||||
* 分包名称
|
||||
*/
|
||||
subpackageName: string;
|
||||
|
||||
/**
|
||||
* 分包内容
|
||||
*/
|
||||
subpackageContext: string;
|
||||
|
||||
/**
|
||||
* 限价
|
||||
*/
|
||||
limitPrice: number;
|
||||
|
||||
/**
|
||||
* 计划招标时间
|
||||
*/
|
||||
planTenderTime: string;
|
||||
|
||||
/**
|
||||
* 招标方式
|
||||
*/
|
||||
tenderMethod: string;
|
||||
|
||||
/**
|
||||
* 招标文件(多个)
|
||||
*/
|
||||
tenderFile: string;
|
||||
|
||||
/**
|
||||
* 中标文件(单个)
|
||||
*/
|
||||
bidFile: string | number;
|
||||
|
||||
/**
|
||||
* 合同额
|
||||
*/
|
||||
contract: number;
|
||||
|
||||
}
|
||||
|
||||
export interface PlanForm extends BaseEntity {
|
||||
/**
|
||||
* 招标计划ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 分包类型
|
||||
*/
|
||||
subpackageType?: string;
|
||||
|
||||
/**
|
||||
* 分包名称
|
||||
*/
|
||||
subpackageName?: string;
|
||||
|
||||
/**
|
||||
* 分包内容
|
||||
*/
|
||||
subpackageContext?: string;
|
||||
|
||||
/**
|
||||
* 限价
|
||||
*/
|
||||
limitPrice?: number;
|
||||
|
||||
/**
|
||||
* 计划招标时间
|
||||
*/
|
||||
planTenderTime?: string;
|
||||
|
||||
/**
|
||||
* 招标方式
|
||||
*/
|
||||
tenderMethod?: string;
|
||||
|
||||
/**
|
||||
* 招标文件(多个)
|
||||
*/
|
||||
tenderFile?: string;
|
||||
|
||||
/**
|
||||
* 中标文件(单个)
|
||||
*/
|
||||
bidFile?: string | number;
|
||||
|
||||
/**
|
||||
* 合同额
|
||||
*/
|
||||
contract?: number;
|
||||
|
||||
}
|
||||
|
||||
export interface PlanQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 分包类型
|
||||
*/
|
||||
subpackageType?: string;
|
||||
|
||||
/**
|
||||
* 分包名称
|
||||
*/
|
||||
subpackageName?: string;
|
||||
|
||||
/**
|
||||
* 分包内容
|
||||
*/
|
||||
subpackageContext?: string;
|
||||
|
||||
/**
|
||||
* 限价
|
||||
*/
|
||||
limitPrice?: number;
|
||||
|
||||
/**
|
||||
* 计划招标时间
|
||||
*/
|
||||
planTenderTime?: string;
|
||||
|
||||
/**
|
||||
* 招标方式
|
||||
*/
|
||||
tenderMethod?: string;
|
||||
|
||||
/**
|
||||
* 招标文件(多个)
|
||||
*/
|
||||
tenderFile?: string;
|
||||
|
||||
/**
|
||||
* 中标文件(单个)
|
||||
*/
|
||||
bidFile?: string | number;
|
||||
|
||||
/**
|
||||
* 合同额
|
||||
*/
|
||||
contract?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
@ -174,3 +174,15 @@ export const getChildProject = (id: string | number): AxiosPromise<childProjectQ
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 上传项目文件
|
||||
* @param data
|
||||
*/
|
||||
export const uploadProjectFile = (data: any) => {
|
||||
return request({
|
||||
url: '/project/project/save/tender/file',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
@ -8,6 +8,7 @@ export interface ProjectVO {
|
||||
* 项目名称
|
||||
*/
|
||||
projectName: string;
|
||||
tenderFiles: string;
|
||||
|
||||
/**
|
||||
* 项目简称
|
||||
@ -131,7 +132,7 @@ export interface locationType {
|
||||
export interface childProjectQuery {
|
||||
projectName: string;
|
||||
pid: string;
|
||||
id?:string
|
||||
id?: string;
|
||||
}
|
||||
|
||||
export interface ProjectForm extends BaseEntity {
|
||||
|
63
src/api/supplierInput/supplierInput/index.ts
Normal file
63
src/api/supplierInput/supplierInput/index.ts
Normal file
@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { SupplierInputVO, SupplierInputForm, SupplierInputQuery } from '@/api/supplierInput/supplierInput/types';
|
||||
|
||||
/**
|
||||
* 查询供应商入库列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listSupplierInput = (query?: SupplierInputQuery): AxiosPromise<SupplierInputVO[]> => {
|
||||
return request({
|
||||
url: '/supplierInput/supplierInput/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询供应商入库详细
|
||||
* @param id
|
||||
*/
|
||||
export const getSupplierInput = (id: string | number): AxiosPromise<SupplierInputVO> => {
|
||||
return request({
|
||||
url: '/supplierInput/supplierInput/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增供应商入库
|
||||
* @param data
|
||||
*/
|
||||
export const addSupplierInput = (data: SupplierInputForm) => {
|
||||
return request({
|
||||
url: '/supplierInput/supplierInput',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改供应商入库
|
||||
* @param data
|
||||
*/
|
||||
export const updateSupplierInput = (data: SupplierInputForm) => {
|
||||
return request({
|
||||
url: '/supplierInput/supplierInput',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除供应商入库
|
||||
* @param id
|
||||
*/
|
||||
export const delSupplierInput = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/supplierInput/supplierInput/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
55
src/api/supplierInput/supplierInput/types.ts
Normal file
55
src/api/supplierInput/supplierInput/types.ts
Normal file
@ -0,0 +1,55 @@
|
||||
export interface SupplierInputVO {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 供应商类型
|
||||
*/
|
||||
supplierType: string;
|
||||
|
||||
/**
|
||||
* 入库资料
|
||||
*/
|
||||
inputFile: string;
|
||||
|
||||
}
|
||||
|
||||
export interface SupplierInputForm extends BaseEntity {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 供应商类型
|
||||
*/
|
||||
supplierType?: string;
|
||||
|
||||
/**
|
||||
* 入库资料
|
||||
*/
|
||||
inputFile?: string;
|
||||
}
|
||||
|
||||
export interface SupplierInputQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 供应商类型
|
||||
*/
|
||||
supplierType?: string;
|
||||
|
||||
/**
|
||||
* 入库资料
|
||||
*/
|
||||
inputFile?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
@ -315,6 +315,11 @@ const uploadedSuccessfully = (res: any) => {
|
||||
fileList.value = [];
|
||||
emit('update:modelValue', ''); // 同步到外部 v-model
|
||||
}
|
||||
// if (props.autoUpload && props.limit === fileList.value.length) {
|
||||
// fileUploadRef.value?.clearFiles();
|
||||
// fileList.value = [];
|
||||
// emit('update:modelValue', ''); // 同步到外部 v-model
|
||||
// }
|
||||
props.onUploadSuccess?.(fileList.value, res);
|
||||
};
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button :disabled="buttonDisabled" type="primary" @click="handleCompleteTask"> 通过 </el-button>
|
||||
<el-button :disabled="buttonDisabled" type="primary" @click="handleCompleteTask"> 提交 </el-button>
|
||||
<el-button v-if="task.flowStatus === 'waiting' && buttonObj.trust" :disabled="buttonDisabled" type="primary" @click="openDelegateTask">
|
||||
委托
|
||||
</el-button>
|
||||
@ -304,7 +304,6 @@ const emits = defineEmits(['submitCallback', 'cancelCallback']);
|
||||
const handleCompleteTask = async () => {
|
||||
form.value.taskId = taskId.value;
|
||||
form.value.variables = props.taskVariables;
|
||||
|
||||
let verify = false;
|
||||
if (buttonObj.value.pop && nestNodeList.value && nestNodeList.value.length > 0) {
|
||||
nestNodeList.value.forEach((e) => {
|
||||
@ -353,13 +352,13 @@ const handleCompleteTask = async () => {
|
||||
}
|
||||
};
|
||||
const handleShowSubmit = async () => {
|
||||
await completeTask(form.value).finally(() => {
|
||||
// 提交设计验证
|
||||
detailFormTeRef.value.submit(businessId.value);
|
||||
});
|
||||
detailFormTeRef.value.submit(businessId.value, () => {
|
||||
completeTask(form.value).finally(() => {
|
||||
dialog.visible = false;
|
||||
emits('submitCallback');
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
});
|
||||
});
|
||||
};
|
||||
/** 驳回弹窗打开 */
|
||||
const handleBackProcessOpen = async () => {
|
||||
@ -525,15 +524,15 @@ const handleTermination = async () => {
|
||||
taskId: taskId.value,
|
||||
comment: form.value.message
|
||||
};
|
||||
await terminationTask(params).finally(() => {
|
||||
// 提交设计验证
|
||||
detailFormTeRef.value.submit(businessId.value);
|
||||
detailFormTeRef.value.submit(businessId.value, () => {
|
||||
terminationTask(params).finally(() => {
|
||||
loading.value = false;
|
||||
buttonDisabled.value = false;
|
||||
});
|
||||
dialog.visible = false;
|
||||
emits('submitCallback');
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
});
|
||||
});
|
||||
};
|
||||
//终止任务
|
||||
const handleTerminationTask = async () => {
|
||||
|
@ -293,4 +293,17 @@ const handleAddApp = (row) => {
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
</script>
|
||||
|
@ -20,28 +20,17 @@
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<div class="appWidth mx-auto bg-white rounded-xl shadow-sm overflow-hidden transition-all duration-300 hover:shadow-md">
|
||||
<!-- 表单内容区域 -->
|
||||
<!-- 主表单:基础信息校验 -->
|
||||
<el-form :disabled="disableAll" ref="mainFormRef" :model="form" :rules="mainRules" label-width="120px" class="p-6">
|
||||
<!-- 基本信息区域 -->
|
||||
<div class="bg-blue-50 p-4 rounded-lg mb-6">
|
||||
<h3 class="text-lg font-semibold text-blue-700 mb-4">基本信息</h3>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<el-form-item label="提资人" prop="userId" class="mb-4">
|
||||
<el-select
|
||||
v-model="form.userId"
|
||||
placeholder="请选择提资人"
|
||||
class="w-full transition-all duration-300 border-gray-300 focus:border-blue-400 focus:ring-1 focus:ring-blue-400"
|
||||
>
|
||||
<el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" />
|
||||
</el-select>
|
||||
<el-form-item label="提资人" class="mb-4">
|
||||
<el-input placeholder="请输入提资人" disabled v-model="userInfo.nickName" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="专业" prop="user_major" class="mb-4">
|
||||
<el-select
|
||||
v-model="form.user_major"
|
||||
placeholder="请选择专业"
|
||||
class="transition-all duration-300 border-gray-300"
|
||||
:rules="{ required: true, message: '请选择专业', trigger: 'change' }"
|
||||
>
|
||||
<el-select v-model="form.user_major" placeholder="请选择专业" class="transition-all duration-300 border-gray-300">
|
||||
<el-option v-for="item in des_user_major" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -53,13 +42,14 @@
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 资料文件区域 -->
|
||||
|
||||
<!-- 资料文件区域:单独表单校验 -->
|
||||
<div class="mb-6">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<h3 class="text-lg font-semibold text-blue-700">资料文件清单</h3>
|
||||
<el-button type="primary" size="small" @click="addDocumentItem" icon="Plus"> 添加资料 </el-button>
|
||||
</div>
|
||||
<el-form :disabled="disableAll" ref="documentsFormRef" :model="form" class="space-y-4">
|
||||
<el-form :disabled="disableAll" ref="documentsFormRef" :model="form" class="space-y-4" label-width="120px">
|
||||
<div
|
||||
v-for="(item, index) in form.documents"
|
||||
:key="item.id"
|
||||
@ -67,7 +57,6 @@
|
||||
>
|
||||
<div class="flex justify-between items-start mb-2">
|
||||
<span class="text-sm font-medium text-gray-600">资料 {{ index + 1 }}</span>
|
||||
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@ -80,10 +69,14 @@
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<!-- 资料名称:补充验证规则 -->
|
||||
<el-form-item
|
||||
label="资料名称"
|
||||
:prop="`documents.${index}.catalogueName`"
|
||||
:rules="[{ required: true, message: '请输入文件资料名称', trigger: 'blur' }]"
|
||||
:prop="`documents.${index}.volumeCatalogId`"
|
||||
:rules="[
|
||||
{ required: true, message: '请选择资料名称', trigger: 'change' },
|
||||
{ required: true, message: '请选择资料名称', trigger: 'blur' }
|
||||
]"
|
||||
class="mb-4"
|
||||
>
|
||||
<el-select
|
||||
@ -93,7 +86,7 @@
|
||||
clearable
|
||||
filterable
|
||||
@change="handleSelect($event, item)"
|
||||
style="width: 150px; margin-right: 20px"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="project in volumeCatalogList"
|
||||
@ -114,8 +107,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 提交组件 -->
|
||||
|
||||
<!-- 提交验证组件 -->
|
||||
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||
<!-- 审批记录组件 -->
|
||||
<approvalRecord ref="approvalRecordRef"></approvalRecord>
|
||||
<!-- 流程选择对话框 -->
|
||||
<el-dialog
|
||||
@ -154,88 +149,101 @@ import SubmitVerify from '@/components/Process/submitVerify.vue';
|
||||
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||
import ApprovalButton from '@/components/Process/approvalButton.vue';
|
||||
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { ComponentInternalInstance, nextTick, ref, reactive, computed, toRefs, onMounted } from 'vue';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { systemUserList } from '@/api/design/appointment';
|
||||
import { extractBatch, extractDetail } from '@/api/design/Professional';
|
||||
import { listVolumeCatalog } from '@/api/design/volumeCatalog';
|
||||
// 获取用户 store
|
||||
import { catalogList } from '@/api/design/designChange';
|
||||
import { getUser } from '@/api/system/user';
|
||||
import { ElFormInstance, ElMessage } from 'element-plus';
|
||||
|
||||
// 类型定义
|
||||
interface DialogOption {
|
||||
visible: boolean;
|
||||
title: string;
|
||||
}
|
||||
|
||||
interface DocumentItem {
|
||||
id: number;
|
||||
catalogueName: string;
|
||||
remark: string;
|
||||
volumeCatalogId: string;
|
||||
num?: number;
|
||||
}
|
||||
|
||||
interface FormData {
|
||||
projectId: string | undefined;
|
||||
userId: string;
|
||||
user_major: string;
|
||||
phone: string;
|
||||
email: string;
|
||||
id: string;
|
||||
status: string;
|
||||
documents: DocumentItem[];
|
||||
}
|
||||
|
||||
// 获取组件实例
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
// 用户状态管理
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const userId = computed(() => userStore.userId);
|
||||
|
||||
// 基础数据
|
||||
const userInfo = ref({
|
||||
nickName: '',
|
||||
email: '',
|
||||
phonenumber: '',
|
||||
userId: ''
|
||||
});
|
||||
const { des_user_major } = toRefs<any>(proxy?.useDict('des_user_major'));
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const disableAll = ref(false);
|
||||
const volumeCatalogList = ref([]);
|
||||
let volumeMap = new Map();
|
||||
//路由参数
|
||||
const volumeMap = new Map();
|
||||
const routeParams = ref<Record<string, any>>({});
|
||||
|
||||
// 流程相关
|
||||
const flowCodeOptions = [
|
||||
{
|
||||
value: currentProject.value?.id + '_extract',
|
||||
label: '互提资料清单'
|
||||
}
|
||||
];
|
||||
|
||||
const flowCode = ref<string>('');
|
||||
const status = ref<string>('');
|
||||
const dialogVisible = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: '流程定义'
|
||||
});
|
||||
//提交组件
|
||||
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||
//审批记录组件
|
||||
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||
//按钮组件
|
||||
const approvalButtonRef = ref<InstanceType<typeof ApprovalButton>>();
|
||||
|
||||
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 userList = ref([]);
|
||||
const userMap = new Map();
|
||||
// 表单引用
|
||||
const mainFormRef = ref();
|
||||
const handleClose = () => {
|
||||
dialogVisible.visible = false;
|
||||
flowCode.value = '';
|
||||
buttonLoading.value = false;
|
||||
};
|
||||
// 组件引用
|
||||
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||
const mainFormRef = ref<ElFormInstance>(); // 主表单引用
|
||||
const documentsFormRef = ref<ElFormInstance>(); // 资料列表表单引用
|
||||
|
||||
// 表单数据
|
||||
const form = reactive({
|
||||
const form = reactive<FormData>({
|
||||
projectId: currentProject.value?.id,
|
||||
userId: '', // 收资人
|
||||
user_major: '', // 专业
|
||||
phone: '', // 电话
|
||||
email: '', // 邮箱
|
||||
userId: '',
|
||||
user_major: '',
|
||||
phone: '',
|
||||
email: '',
|
||||
id: '',
|
||||
status: '',
|
||||
documents: [
|
||||
{
|
||||
id: Date.now(),
|
||||
catalogueName: '', // 卷册目录名称
|
||||
remark: '', // 备注
|
||||
volumeCatalogId: '' //卷册目录ID
|
||||
catalogueName: '',
|
||||
remark: '',
|
||||
volumeCatalogId: ''
|
||||
}
|
||||
] as Array<{
|
||||
id: number;
|
||||
catalogueName: string;
|
||||
remark: string;
|
||||
volumeCatalogId: string;
|
||||
}>
|
||||
]
|
||||
});
|
||||
|
||||
// 主表单验证规则
|
||||
const mainRules = reactive({
|
||||
userId: [{ required: true, message: '请输入收资人', trigger: 'blur' }],
|
||||
@ -249,11 +257,22 @@ const mainRules = reactive({
|
||||
{ type: 'email', message: '请输入正确的邮箱格式', trigger: 'blur' }
|
||||
]
|
||||
});
|
||||
|
||||
// 用户列表相关
|
||||
const userList = ref([]);
|
||||
const userMap = new Map();
|
||||
// 流程提交数据
|
||||
const submitFormData = ref<StartProcessBo>({
|
||||
businessId: '',
|
||||
flowCode: '',
|
||||
variables: {}
|
||||
});
|
||||
const taskVariables = ref<Record<string, any>>({});
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
if (mainFormRef.value) {
|
||||
mainFormRef.value.resetFields();
|
||||
}
|
||||
mainFormRef.value?.resetFields();
|
||||
documentsFormRef.value?.resetFields();
|
||||
// 重置资料列表,保留一个空项
|
||||
form.documents = [
|
||||
{
|
||||
@ -263,9 +282,9 @@ const reset = () => {
|
||||
volumeCatalogId: ''
|
||||
}
|
||||
];
|
||||
leaveFormRef.value?.resetFields();
|
||||
};
|
||||
// 添加资料项
|
||||
|
||||
/** 添加资料项 */
|
||||
const addDocumentItem = () => {
|
||||
form.documents.push({
|
||||
id: Date.now(),
|
||||
@ -275,156 +294,182 @@ const addDocumentItem = () => {
|
||||
});
|
||||
};
|
||||
|
||||
// 删除资料项
|
||||
/** 删除资料项 */
|
||||
const removeDocumentItem = (index: number) => {
|
||||
form.documents.splice(index, 1);
|
||||
};
|
||||
/** 提交按钮 */
|
||||
|
||||
/** 关闭流程选择对话框 */
|
||||
const handleClose = () => {
|
||||
dialogVisible.visible = false;
|
||||
flowCode.value = '';
|
||||
buttonLoading.value = false;
|
||||
};
|
||||
|
||||
/** 提交表单(主逻辑) */
|
||||
const submitForm = (status1: string) => {
|
||||
status.value = status1;
|
||||
buttonLoading.value = true;
|
||||
dialog.visible = false;
|
||||
// 验证表单数据
|
||||
mainFormRef.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
console.log('验证成功');
|
||||
|
||||
// 1. 校验主表单(基础信息)
|
||||
mainFormRef.value?.validate(async (mainValid) => {
|
||||
if (!mainValid) {
|
||||
proxy?.$modal.msgError('请完善基础必填信息');
|
||||
buttonLoading.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. 校验资料列表表单(资料名称)
|
||||
documentsFormRef.value?.validate(async (docsValid) => {
|
||||
if (!docsValid) {
|
||||
proxy?.$modal.msgError('请完善所有资料的“资料名称”');
|
||||
buttonLoading.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// 3. 表单校验通过,处理资料序号
|
||||
form.documents.map((item, i) => {
|
||||
item.num = i + 1;
|
||||
});
|
||||
let body = {
|
||||
|
||||
// 4. 提交数据到后端
|
||||
const body = {
|
||||
desExtractBo: {
|
||||
projectId: currentProject.value?.id,
|
||||
userId: form.userId, // 收资人
|
||||
userMajor: form.user_major, // 专业
|
||||
userId: form.userId,
|
||||
userMajor: form.user_major,
|
||||
id: form.id,
|
||||
phone: form.phone, // 电话
|
||||
email: form.email, // 邮箱
|
||||
phone: form.phone,
|
||||
email: form.email,
|
||||
userName: userMap.get(form.userId)
|
||||
},
|
||||
catalogueList: form.documents
|
||||
};
|
||||
let res = await extractBatch(body);
|
||||
if (res.code == 200) {
|
||||
buttonLoading.value = false;
|
||||
dialog.visible = false;
|
||||
|
||||
try {
|
||||
const res = await extractBatch(body);
|
||||
if (res.code === 200) {
|
||||
form.id = res.data;
|
||||
await submit(status.value, form); // 执行暂存/提交流程
|
||||
} else {
|
||||
ElMessage.error(res.msg);
|
||||
}
|
||||
// 表单验证通过,执行提交逻辑
|
||||
form.id = res.data;
|
||||
submit(status.value, form);
|
||||
} else {
|
||||
// 表单验证失败,提示用户并关闭加载状态
|
||||
proxy?.$modal.msgError('请完善必填信息后再提交');
|
||||
} catch (err) {
|
||||
ElMessage.error('提交失败,请重试');
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/** 提交流程选择 */
|
||||
const submitFlow = async () => {
|
||||
handleStartWorkFlow(form);
|
||||
await handleStartWorkFlow(form);
|
||||
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);
|
||||
}
|
||||
} catch (err) {
|
||||
ElMessage.error('启动流程失败');
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
};
|
||||
//审批记录
|
||||
|
||||
/** 打开审批记录 */
|
||||
const handleApprovalRecord = () => {
|
||||
approvalRecordRef.value.init(form.id);
|
||||
approvalRecordRef.value?.init(form.id);
|
||||
};
|
||||
//提交回调
|
||||
|
||||
/** 提交回调:关闭页面返回上一级 */
|
||||
const submitCallback = async () => {
|
||||
await proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
};
|
||||
//审批
|
||||
|
||||
/** 打开审批验证弹窗 */
|
||||
const approvalVerifyOpen = async () => {
|
||||
submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
||||
submitVerifyRef.value?.openDialog(routeParams.value.taskId);
|
||||
};
|
||||
const submit = async (status, data) => {
|
||||
|
||||
/** 暂存/提交分支逻辑 */
|
||||
const submit = async (status: string, data: FormData) => {
|
||||
if (status === 'draft') {
|
||||
buttonLoading.value = false;
|
||||
proxy?.$modal.msgSuccess('暂存成功');
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
await proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
} else {
|
||||
if ((form.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||
// 新增/草稿状态下,默认选择第一个流程并弹窗
|
||||
if ((data.status === 'draft' && !flowCode.value) || routeParams.value.type === 'add') {
|
||||
flowCode.value = flowCodeOptions[0].value;
|
||||
dialogVisible.visible = true;
|
||||
return;
|
||||
}
|
||||
//说明启动过先随意穿个参数
|
||||
if (flowCode.value === '' || flowCode.value === null) {
|
||||
// 已有流程时默认填充占位值
|
||||
if (!flowCode.value) {
|
||||
flowCode.value = 'xx';
|
||||
}
|
||||
await handleStartWorkFlow(data);
|
||||
}
|
||||
};
|
||||
/** 查询当前部门的所有用户 */
|
||||
|
||||
/** 获取部门用户列表 */
|
||||
const getDeptAllUser = async (deptId: any) => {
|
||||
try {
|
||||
const res = await systemUserList({ deptId });
|
||||
// 实际项目中使用接口返回的数据
|
||||
userList.value = res.rows;
|
||||
userList.value.forEach((user) => {
|
||||
userMap.set(user.userId, user.nickName);
|
||||
});
|
||||
} catch (error) {
|
||||
} catch (err) {
|
||||
ElMessage.error('获取用户列表失败');
|
||||
}
|
||||
};
|
||||
// 查询数据 再次回显
|
||||
|
||||
/** 回显表单数据(编辑/查看/审批场景) */
|
||||
const byProjectIdAll = async () => {
|
||||
loading.value = true;
|
||||
buttonLoading.value = false;
|
||||
// 调用接口获取数据
|
||||
try {
|
||||
const res = await extractDetail(routeParams.value.id);
|
||||
if (res.code === 200 && res.data) {
|
||||
const data = res.data;
|
||||
// 回显基本信息
|
||||
// 回显基础信息
|
||||
form.userId = data.userId || '';
|
||||
form.user_major = data.userMajor || '';
|
||||
form.phone = data.phone || '';
|
||||
form.email = data.email || '';
|
||||
form.id = data.id || '';
|
||||
form.status = data.status || '';
|
||||
if (data.status != 'draft') {
|
||||
|
||||
// 非草稿状态禁用表单
|
||||
if (data.status !== 'draft') {
|
||||
disableAll.value = true;
|
||||
}
|
||||
|
||||
// 回显资料文件列表
|
||||
// 回显资料列表
|
||||
if (data.catalogueList && data.catalogueList.length > 0) {
|
||||
// 清空现有列表
|
||||
form.documents = [];
|
||||
// 填充新数据
|
||||
data.catalogueList.forEach((item: any, index: number) => {
|
||||
form.documents.push({
|
||||
id: item.id || Date.now() + index, // 确保id唯一
|
||||
form.documents = data.catalogueList.map((item: any, index: number) => ({
|
||||
id: item.id || Date.now() + index,
|
||||
catalogueName: item.catalogueName || '',
|
||||
remark: item.remark || '',
|
||||
volumeCatalogId: item.volumeCatalogId
|
||||
});
|
||||
});
|
||||
volumeCatalogId: item.volumeCatalogId || ''
|
||||
}));
|
||||
} else {
|
||||
// 如果没有资料,保持一个空项
|
||||
form.documents = [
|
||||
{
|
||||
id: Date.now(),
|
||||
@ -435,38 +480,70 @@ const byProjectIdAll = async () => {
|
||||
];
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
ElMessage.error('获取表单数据失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
};
|
||||
/** 查询卷册目录列表 */
|
||||
|
||||
/** 获取当前用户详情 */
|
||||
const getUserDetail = async () => {
|
||||
try {
|
||||
const res = await getUser(userId.value);
|
||||
userInfo.value = res.data.user;
|
||||
form.userId = userInfo.value.userId;
|
||||
form.phone = userInfo.value.phonenumber;
|
||||
form.email = userInfo.value.email;
|
||||
} catch (err) {
|
||||
ElMessage.error('获取用户信息失败');
|
||||
}
|
||||
};
|
||||
|
||||
/** 获取卷册目录列表 */
|
||||
const getList = async () => {
|
||||
const res = await listVolumeCatalog({ projectId: currentProject.value?.id, auditStatus: 'finish' });
|
||||
volumeCatalogList.value = res.rows;
|
||||
try {
|
||||
const res = await catalogList(currentProject.value?.id);
|
||||
volumeCatalogList.value = res.data;
|
||||
volumeCatalogList.value.forEach((e) => {
|
||||
volumeMap.set(e.design, e);
|
||||
});
|
||||
} catch (err) {
|
||||
ElMessage.error('获取卷册目录失败');
|
||||
}
|
||||
};
|
||||
const handleSelect = (val, item) => {
|
||||
item.catalogueName = volumeMap.get(val).documentName;
|
||||
|
||||
/** 选择资料名称后回显目录名称 */
|
||||
const handleSelect = (val: string, item: DocumentItem) => {
|
||||
item.catalogueName = volumeMap.get(val)?.documentName || '';
|
||||
};
|
||||
|
||||
/** 页面挂载初始化 */
|
||||
onMounted(() => {
|
||||
nextTick(async () => {
|
||||
routeParams.value = proxy.$route.query;
|
||||
reset();
|
||||
loading.value = false;
|
||||
getList(); // 获取卷册目录
|
||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||
getDeptAllUser(userStore.deptId).then(() => {
|
||||
byProjectIdAll();
|
||||
});
|
||||
|
||||
// 初始化基础数据
|
||||
await getList();
|
||||
await getUserDetail();
|
||||
|
||||
// 编辑/查看/审批场景:加载已有数据
|
||||
const { type } = routeParams.value;
|
||||
if (type === 'update' || type === 'view' || type === 'approval') {
|
||||
await getDeptAllUser(userStore.deptId);
|
||||
await byProjectIdAll();
|
||||
} else {
|
||||
getDeptAllUser(userStore.deptId);
|
||||
await getDeptAllUser(userStore.deptId);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
/* 全局样式 */
|
||||
/* 全局变量 */
|
||||
:root {
|
||||
--primary: #409eff;
|
||||
--primary-light: #66b1ff;
|
||||
@ -543,10 +620,6 @@ onMounted(() => {
|
||||
/* 卡片样式优化 */
|
||||
.el-card {
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
/* transform: translateY(-2px); */
|
||||
}
|
||||
}
|
||||
|
||||
/* 对话框样式优化 */
|
||||
|
@ -510,7 +510,6 @@ const submitForm = async () => {
|
||||
try {
|
||||
// 1. 基础表单验证
|
||||
await leaveFormRef.value.validate();
|
||||
|
||||
// 2. 提交前二次校验:「专业+人员」组合唯一性
|
||||
let hasDuplicate = false;
|
||||
const allKeys: string[] = [];
|
||||
@ -568,7 +567,6 @@ const submitForm = async () => {
|
||||
)
|
||||
]
|
||||
};
|
||||
|
||||
// 4. 数据处理(保持原有逻辑不变)
|
||||
const arr = [];
|
||||
userList.value.forEach((item) => {
|
||||
@ -596,6 +594,7 @@ const submitForm = async () => {
|
||||
});
|
||||
if (res.code == 200) {
|
||||
disabledForm.value = true;
|
||||
loading.close();
|
||||
ElMessage.success('提交成功');
|
||||
} else {
|
||||
ElMessage.error(res.msg || '提交失败');
|
||||
@ -603,7 +602,7 @@ const submitForm = async () => {
|
||||
} catch (error) {
|
||||
ElMessage.error('请完善表单信息后再提交');
|
||||
} finally {
|
||||
ElLoading.service().close();
|
||||
// ElLoading.service().close();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -93,7 +93,7 @@
|
||||
link
|
||||
icon="View"
|
||||
v-hasPermi="['design:designChange:query']"
|
||||
v-if="scope.row.status == 'back' || scope.row.status == 'termination'"
|
||||
v-if="scope.row.status != 'draft'"
|
||||
@click="handleViewHistory(scope.row)"
|
||||
>查看单据</el-button
|
||||
>
|
||||
@ -107,13 +107,7 @@
|
||||
<el-table v-if="fileList.length > 0" :data="fileList" style="width: 100%" border>
|
||||
<el-table-column prop="fileName" label="文件名称" align="center">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
:key="scope.row.fileId"
|
||||
:href="scope.row.fileUrl"
|
||||
target="_blank"
|
||||
:type="scope.row.status == '1' ? 'primary' : 'info'"
|
||||
:underline="false"
|
||||
>
|
||||
<el-link :key="scope.row.fileId" :href="scope.row.fileUrl" target="_blank" type="primary" :underline="false">
|
||||
{{ scope.row.originalName }}
|
||||
</el-link>
|
||||
</template>
|
||||
|
@ -74,26 +74,22 @@
|
||||
></el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="原设计处置" prop="designDisposal">
|
||||
<el-radio-group v-model="form.extendDetail.designDisposal">
|
||||
<el-radio-group v-model="form.extendDetail.designDisposal" @change="handleRadio">
|
||||
<el-radio value="1" size="large">原图作废</el-radio>
|
||||
<el-radio value="2" size="large">原图保留,部分修改</el-radio>
|
||||
<el-radio value="2" :disabled="!designId" size="large">原图保留,部分修改</el-radio>
|
||||
<el-radio value="3" size="large">原图保留,补充设计</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item></el-col
|
||||
>
|
||||
<el-col :span="24" v-if="form.extendDetail.designDisposal == 2 && form.volumeNo">
|
||||
<el-form-item label="选择保留文件" prop="designPhase">
|
||||
<el-select
|
||||
id="projectSelect"
|
||||
v-model="form.saveFile"
|
||||
placeholder="请选择保留文件"
|
||||
multiple
|
||||
style="width: 150px; margin-right: 20px"
|
||||
<el-col :span="24" v-if="form.extendDetail.designDisposal == 2">
|
||||
<el-form-item label="保留文件" prop="saveFile">
|
||||
<el-checkbox-group v-model="form.saveFile">
|
||||
<el-checkbox v-for="dict in blueprintListAll" :key="dict.id" :value="dict.id">
|
||||
{{ dict.fileName }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item></el-col
|
||||
>
|
||||
<el-option v-for="project in fileVoList" :key="project.id" :label="project.fileName" :value="project.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设计阶段" prop="designPhase">
|
||||
<el-input v-model="form.extendDetail.designPhase" placeholder="请输入设计阶段" /> </el-form-item
|
||||
@ -179,8 +175,7 @@
|
||||
<script setup name="Leave" lang="ts">
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { addDesignChange, getDesignChange } from '@/api/design/designChange';
|
||||
import { listVolumeCatalog } from '@/api/design/volumeCatalog';
|
||||
import { addDesignChange, getDesignChange, catalogList, blueprintList } from '@/api/design/designChange';
|
||||
const { design_change_reason_type } = toRefs<any>(proxy?.useDict('design_change_reason_type'));
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
@ -190,6 +185,7 @@ const userStore = useUserStoreHook();
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const buttonLoading = ref(false);
|
||||
const volumeCatalogList = ref([]);
|
||||
const blueprintListAll = ref([]);
|
||||
let volumeMap = new Map();
|
||||
//路由参数
|
||||
const routeParams = ref<Record<string, any>>({});
|
||||
@ -200,6 +196,7 @@ const dialog = reactive({
|
||||
isEdit: false
|
||||
});
|
||||
const fileVoList = ref([]);
|
||||
const designId = ref('');
|
||||
const initFormData = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
@ -219,7 +216,7 @@ const initFormData = {
|
||||
fileId: undefined,
|
||||
status: undefined,
|
||||
remark: undefined,
|
||||
saveFile: undefined,
|
||||
saveFile: [],
|
||||
extendDetail: {
|
||||
changeCategory: undefined,
|
||||
ImpProcedure: undefined,
|
||||
@ -287,16 +284,27 @@ const submitForm = () => {
|
||||
};
|
||||
/** 查询卷册目录列表 */
|
||||
const getList = async () => {
|
||||
const res = await listVolumeCatalog({ projectId: currentProject.value?.id, auditStatus: 'finish' });
|
||||
volumeCatalogList.value = res.rows;
|
||||
const res = await catalogList(currentProject.value?.id);
|
||||
volumeCatalogList.value = res.data;
|
||||
volumeCatalogList.value.forEach((e) => {
|
||||
volumeMap.set(e.volumeNumber, e);
|
||||
});
|
||||
};
|
||||
// 获取图纸列表
|
||||
const getBlueprintList = async () => {
|
||||
const res = await blueprintList(designId.value);
|
||||
blueprintListAll.value = res.data;
|
||||
};
|
||||
const handleRadio = (val) => {
|
||||
form.value.saveFile = [];
|
||||
if (val == 2) {
|
||||
getBlueprintList();
|
||||
}
|
||||
};
|
||||
const handleSelect = (val) => {
|
||||
let obj = volumeMap.get(val);
|
||||
console.log(obj);
|
||||
fileVoList.value = obj.fileVoList;
|
||||
designId.value = obj.design;
|
||||
form.value.volumeName = obj.volumeName;
|
||||
form.value.specialty = obj.specialty;
|
||||
form.value.specialtyName = obj.specialtyName;
|
||||
|
@ -1,5 +1,18 @@
|
||||
<template>
|
||||
<div class="p-2 volumeCatalog">
|
||||
<div class="p-2 volumeCatalog drawing">
|
||||
<div class="file-category">
|
||||
<span style="color: #757575; display: inline-block; margin-bottom: 15px">文件分类</span>
|
||||
<!-- 优化了图标与文字的对齐和间距 -->
|
||||
<div v-for="(item, i) of FolderList" :key="i" :class="{ active: currentActive === i }" @click="handleClick(item, i)" class="category-item">
|
||||
<el-icon :size="20" class="folder-icon">
|
||||
<Folder />
|
||||
</el-icon>
|
||||
<span class="folder-name">
|
||||
{{ item.catalogueName }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="boxs">
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
@ -20,29 +33,19 @@
|
||||
</template>
|
||||
<el-table v-loading="loading" :data="volumeCatalogList">
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="卷册号" align="center" prop="volumeNumber" />
|
||||
<el-table-column label="资料名称" align="center" prop="documentName" />
|
||||
<el-table-column label="子项名称" align="center" prop="designSubitem" />
|
||||
<el-table-column label="专业" align="center" prop="specialtyName"> </el-table-column>
|
||||
<el-table-column label="设计人员" align="center" prop="principalName" />
|
||||
<el-table-column label="卷册号" align="center" prop="volumeNumber" />
|
||||
<el-table-column label="资料名称" align="center" prop="documentName" />
|
||||
<el-table-column label="图纸文件" align="center" prop="remark" width="150">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)" v-hasPermi="['design:volumeFile:query']">查看文件</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>
|
||||
<!-- 查看文件列表 -->
|
||||
<el-dialog draggable title="文件列表" v-model="viewVisible" width="800px">
|
||||
<el-table :data="fileList" style="width: 100%" border>
|
||||
<el-table-column prop="fileName" label="文件" align="center">
|
||||
<el-table-column label="版本号" align="center" prop="version" />
|
||||
<el-table-column label="图纸文件" align="center" prop="remark" width="300">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
:key="scope.row.fileId"
|
||||
:href="scope.row.fileUrl"
|
||||
target="_blank"
|
||||
:type="scope.row.status == '1' ? 'primary' : 'info'"
|
||||
type="primary"
|
||||
:underline="false"
|
||||
@click="handleBookFile(scope.row)"
|
||||
>
|
||||
@ -50,28 +53,26 @@
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="size" label="状态" width="120" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status == 1 ? 'success' : 'info'">{{ scope.row.status == 1 ? '使用中' : '已作废' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="240" align="center">
|
||||
<el-table-column label="操作" align="center" prop="remark" width="300">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="view" @click="handleViewHis(scope.row)">查阅记录</el-button>
|
||||
<el-button type="danger" link icon="Download" @click="handleDownload(scope.row)"> 下载 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button type="primary" @click="viewVisible = false">关闭</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog draggable title="文件列表" v-model="viewVisible1" width="500px">
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
</div>
|
||||
<el-dialog draggable title="查阅记录" v-model="viewVisible1" width="500px">
|
||||
<el-table :data="histroyList" style="width: 100%" border>
|
||||
<el-table-column type="index" label="序号" align="center" width="80"> </el-table-column>
|
||||
<el-table-column prop="userName" label="用户名称" align="center"> </el-table-column>
|
||||
<el-table-column label="下载或查看" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag type="primary" v-if="scope.row.status == 2">下载</el-tag>
|
||||
<el-tag type="success" v-else>查看</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="查阅时间" align="center"> </el-table-column>
|
||||
</el-table>
|
||||
<template #footer>
|
||||
@ -87,7 +88,7 @@
|
||||
import { listVolumeCatalog, addVolumeCatalog, updateVolumeCatalog } from '@/api/design/volumeCatalog';
|
||||
import { VolumeCatalogVO } from '@/api/design/volumeCatalog/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { volumeFileViewer, volumeFileViewerList } from '@/api/design/drawing';
|
||||
import { volumeFileViewer, volumeFileViewerList, joinList } from '@/api/design/drawing';
|
||||
const fileList = ref([]);
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const volumeCatalogList = ref<VolumeCatalogVO[]>([]);
|
||||
@ -101,12 +102,17 @@ const userStore = useUserStoreHook();
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const volumeCatalogFormRef = ref<ElFormInstance>();
|
||||
const catalogueId = ref(3);
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const FolderList = [
|
||||
{ id: 3, catalogueName: '蓝图' },
|
||||
{ id: 1, catalogueName: '过程图纸' },
|
||||
{ id: 4, catalogueName: '废弃图纸' }
|
||||
];
|
||||
const uploadForm = reactive({
|
||||
userIds: [],
|
||||
volumeCatalogId: undefined,
|
||||
@ -150,7 +156,7 @@ const histroyList = ref([]);
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await listVolumeCatalog(queryParams.value);
|
||||
const res = await joinList({ type: catalogueId.value, ...queryParams.value });
|
||||
volumeCatalogList.value = res.rows;
|
||||
total.value = res.total;
|
||||
} finally {
|
||||
@ -203,25 +209,34 @@ const submitForm = () => {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleDownload = (row: any) => {
|
||||
getCheck(row);
|
||||
getCheck(row, 2);
|
||||
proxy?.$download.oss(row.fileId);
|
||||
};
|
||||
const handleBookFile = (row: any) => {
|
||||
getCheck(row);
|
||||
getCheck(row, 1);
|
||||
};
|
||||
// 调用查阅接口
|
||||
const getCheck = async (row) => {
|
||||
volumeFileViewer({ volumeFileId: row.fileId });
|
||||
const getCheck = async (row, status) => {
|
||||
volumeFileViewer({ volumeFileId: row.id, status });
|
||||
};
|
||||
const handleViewHis = async (row) => {
|
||||
viewVisible1.value = true;
|
||||
let res = await volumeFileViewerList(row.fileId);
|
||||
let res = await volumeFileViewerList(row.id);
|
||||
if (res.code == 200) {
|
||||
histroyList.value = res.rows;
|
||||
}
|
||||
};
|
||||
const currentActive = ref(0);
|
||||
// 点击事件处理函数
|
||||
const handleClick = (item, index) => {
|
||||
console.log(item.id);
|
||||
currentActive.value = index;
|
||||
catalogueId.value = item.id;
|
||||
// 重新获取数据
|
||||
getList();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
@ -240,3 +255,99 @@ onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.drawing {
|
||||
display: flex;
|
||||
.el-tabs__header {
|
||||
height: 90vh !important;
|
||||
}
|
||||
.file-category {
|
||||
width: 200px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* 移除固定宽度,让容器根据内容自适应 */
|
||||
background-color: #ffffff;
|
||||
padding: 10px;
|
||||
border-radius: 6px;
|
||||
/* 限制最大宽度,防止内容过长 */
|
||||
/* max-width: 200px; */
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.file-category > div {
|
||||
cursor: pointer;
|
||||
padding: 8px 12px;
|
||||
margin-bottom: 4px;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
/* 文本不换行,确保宽度由内容决定 */
|
||||
white-space: nowrap;
|
||||
transition: all 0.2s ease;
|
||||
> span {
|
||||
margin-left: 6px;
|
||||
/* color: #676767;
|
||||
font-size: 18px; */
|
||||
}
|
||||
}
|
||||
|
||||
.file-category {
|
||||
width: 200px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #ffffff;
|
||||
padding: 10px;
|
||||
border-radius: 8px;
|
||||
margin-right: 10px;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
// 分类项样式优化
|
||||
.category-item {
|
||||
cursor: pointer;
|
||||
padding: 10px 12px;
|
||||
margin-bottom: 4px;
|
||||
border-radius: 6px;
|
||||
display: inline-flex;
|
||||
align-items: center; /* 垂直居中对齐 */
|
||||
white-space: nowrap;
|
||||
transition: all 0.25s ease;
|
||||
font-size: 14px;
|
||||
color: #334155;
|
||||
line-height: 1; /* 确保行高一致 */
|
||||
|
||||
&:hover {
|
||||
background-color: #f1f5f9;
|
||||
transform: translateX(2px);
|
||||
}
|
||||
}
|
||||
|
||||
// 图标样式
|
||||
.folder-icon {
|
||||
color: #94a3b8;
|
||||
transition: color 0.25s ease;
|
||||
}
|
||||
|
||||
// 文件夹名称样式
|
||||
.folder-name {
|
||||
margin-left: 8px; /* 增加图标与文字间距 */
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: calc(100% - 30px); /* 限制最大宽度,防止溢出 */
|
||||
}
|
||||
|
||||
// 活跃状态样式
|
||||
.category-item.active {
|
||||
background-color: #eff6ff;
|
||||
color: #2563eb;
|
||||
font-weight: 500;
|
||||
|
||||
.folder-icon {
|
||||
color: #2563eb;
|
||||
}
|
||||
}
|
||||
.boxs {
|
||||
width: calc(100% - 220px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -10,6 +10,7 @@
|
||||
<el-row :gutter="20" class="section-content">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="编号" prop="num">
|
||||
<!-- prop="num" 需与 rules 中键名一致 -->
|
||||
<el-input v-model="formData.num" placeholder="请输入编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -269,11 +270,10 @@ const setFormData = (data: Partial<FormData>) => {
|
||||
};
|
||||
|
||||
// 提交表单
|
||||
const submit = async (businessId) => {
|
||||
try {
|
||||
const submit = async (businessId, cb) => {
|
||||
// 先验证表单
|
||||
const isValid = await validate();
|
||||
if (isValid) {
|
||||
await formRef.value?.validate();
|
||||
cb();
|
||||
formData.subprojectName = subProjectMap.get(formData.subprojectId);
|
||||
formData.drawingreviewId = businessId;
|
||||
const res = await drawingreviewReceipts(formData);
|
||||
@ -281,10 +281,6 @@ const submit = async (businessId) => {
|
||||
// // 提交成功处理逻辑
|
||||
// console.log('提交成功');
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('提交失败:', error);
|
||||
}
|
||||
};
|
||||
onMounted(() => {
|
||||
getSubProject();
|
||||
|
@ -3,13 +3,7 @@
|
||||
<!-- 文件名称列 -->
|
||||
<el-table-column prop="fileName" label="文件" align="center">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
:key="scope.row.fileId"
|
||||
:href="scope.row.fileUrl"
|
||||
target="_blank"
|
||||
:type="scope.row.status == '1' ? 'primary' : 'info'"
|
||||
:underline="false"
|
||||
>
|
||||
<el-link :key="scope.row.fileId" :href="scope.row.fileUrl" target="_blank" type="primary" :underline="false">
|
||||
{{ scope.row.fileName }}
|
||||
</el-link>
|
||||
</template>
|
||||
@ -21,13 +15,18 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 审核状态列 -->
|
||||
<el-table-column label="审核状态" align="center" prop="auditStatus" width="100">
|
||||
<el-table-column label="审核状态" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="wfBusinessStatus" :value="scope.row.auditStatus" />
|
||||
<dict-tag v-if="scope.row.status == 1 && scope.row.type != 4" :options="wfBusinessStatus" :value="scope.row.auditStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否变更" align="center" prop="auditStatus" width="100">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.status == 1 ? '否' : '是' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 操作列 - 通过slot接收不同标签页的操作按钮 -->
|
||||
<el-table-column label="操作" width="240" align="center">
|
||||
<el-table-column label="操作" width="300" align="center">
|
||||
<template #default="scope">
|
||||
<slot name="operation" :row="scope.row"></slot>
|
||||
</template>
|
||||
|
@ -63,23 +63,15 @@
|
||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)" v-hasPermi="['design:volumeFile:query']">查看文件</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上传说明" align="center" prop="explainText">
|
||||
<el-table-column label="外部意见" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.fileVoList[0]?.explainText }}
|
||||
<el-link v-if="scope.row.opinion" :href="scope.row.opinion" target="_blank" type="primary"> 查看文件 </el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" fixed="right" width="200">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
v-if="scope.row.auditStatus != 'finish' && scope.row.auditStatus != 'termination' && scope.row.auditStatus != 'waiting'"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['design:volumeFile:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['design:volumeFile:edit']">修改</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@ -89,6 +81,7 @@
|
||||
v-hasPermi="['design:volumeFile:add']"
|
||||
>上传图纸</el-button
|
||||
>
|
||||
<el-button link type="primary" icon="Upload" @click="handleOpinion(scope.row)">外部意见</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -156,21 +149,28 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 查看文件列表 -->
|
||||
<el-dialog draggable title="图纸列表" v-model="viewVisible" width="45%">
|
||||
<el-dialog draggable title="图纸列表" v-model="viewVisible" width="1000px">
|
||||
<el-tabs type="border-card" v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
||||
<el-tab-pane label="蓝图" name="3"
|
||||
><TableContent :data="fileList" :wf-business-status="wf_business_status">
|
||||
<template #operation="{ row }">
|
||||
<el-button link type="primary" icon="edit" @click="handleAuditLantu(row)" v-if="row.auditStatus == 'draft' || row.auditStatus == 'back'"
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="edit"
|
||||
@click="handleAuditLantu(row)"
|
||||
v-if="(row.status != '2' && row.auditStatus == 'draft') || row.auditStatus == 'back'"
|
||||
>审核</el-button
|
||||
>
|
||||
<el-button link type="primary" icon="View" v-if="row.auditStatus != 'draft'" @click="handleAuditViewLantu(row)">查看流程</el-button>
|
||||
<el-button link type="primary" icon="View" v-if="row.status != '2' && row.auditStatus != 'draft'" @click="handleAuditViewLantu(row)"
|
||||
>查看流程</el-button
|
||||
>
|
||||
<el-button type="danger" link icon="Download" @click="handleDownload(row)"> 下载 </el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
link
|
||||
icon="View"
|
||||
v-if="row.auditStatus == 'back' || row.auditStatus == 'termination' || row.auditStatus == 'finish'"
|
||||
v-if="(row.status != '2' && row.auditStatus == 'back') || row.auditStatus == 'termination' || row.auditStatus == 'finish'"
|
||||
@click="handleViewHistory(row)"
|
||||
>查看单据</el-button
|
||||
>
|
||||
@ -196,17 +196,10 @@
|
||||
</template>
|
||||
</TableContent></el-tab-pane
|
||||
>
|
||||
<el-tab-pane label="变更" name="2"
|
||||
><TableContent :data="fileList" :wf-business-status="wf_business_status">
|
||||
<template #operation="{ row }">
|
||||
<el-button type="danger" link icon="Download" @click="handleDownload(row)"> 下载 </el-button>
|
||||
</template>
|
||||
</TableContent></el-tab-pane
|
||||
>
|
||||
<el-tab-pane label="作废 " name="4"
|
||||
><TableContent :data="fileList" :wf-business-status="wf_business_status">
|
||||
<template #operation="{ row }">
|
||||
<el-button type="danger" link icon="Download" @click="handleDownload(row)"> 下载1 </el-button>
|
||||
<el-button type="danger" link icon="Download" @click="handleDownload(row)"> 下载 </el-button>
|
||||
</template>
|
||||
</TableContent></el-tab-pane
|
||||
>
|
||||
@ -220,6 +213,18 @@
|
||||
<el-dialog draggable title="单据" v-model="dialogHistory" width="800px">
|
||||
<histroy ref="histroyRef"></histroy>
|
||||
</el-dialog>
|
||||
<el-dialog draggable title="上传外部意见" v-model="uploadOpinionVisible" width="500px" append-to-body>
|
||||
<el-form :model="updateRow" label-width="80px" :inline="false">
|
||||
<el-form-item label="外部意见">
|
||||
<file-upload :fileType="['pdf']" :isShowTip="false" :fileSize="100" :onUploadSuccess="onUploadSuccess" v-model="opinion"></file-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span style="font-size: 12px; color: #999999">注意:请上传pdf格式文件</span>
|
||||
<div style="display: flex; justify-content: flex-end">
|
||||
<el-button type="primary" @click="onSubmitOpinion">确定</el-button>
|
||||
<el-button @click="uploadOpinionVisible = false">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -253,9 +258,14 @@ const TableContentRef = ref<InstanceType<typeof TableContentRef>>();
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const activeName = ref('3');
|
||||
const uploadOpinionVisible = ref(false);
|
||||
const design = ref('');
|
||||
const total = ref(0);
|
||||
const dialogHistory = ref(false);
|
||||
const opinion = ref('');
|
||||
const updateRow = ref({
|
||||
opinion: []
|
||||
});
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
@ -415,6 +425,7 @@ const handleAdd = () => {
|
||||
const handleView = (row?: any) => {
|
||||
fileList.value = row.fileVoList;
|
||||
design.value = row.design;
|
||||
activeName.value = '3';
|
||||
getVolumeFileList('3');
|
||||
viewVisible.value = true;
|
||||
};
|
||||
@ -422,7 +433,34 @@ const handleView = (row?: any) => {
|
||||
/** 上传文件按钮操作 */
|
||||
const uploadVisible = ref(false);
|
||||
const viewVisible = ref(false);
|
||||
// 上传外部意见
|
||||
const handleOpinion = (row) => {
|
||||
uploadOpinionVisible.value = true;
|
||||
updateRow.value = row;
|
||||
opinion.value = '';
|
||||
};
|
||||
const onSubmitOpinion = async () => {
|
||||
// 提交外部意见
|
||||
if (opinion.value.length == 0) {
|
||||
proxy.$modal.msgError('请上传外部意见');
|
||||
return;
|
||||
}
|
||||
await updateVolumeCatalog({ ...updateRow.value });
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
uploadOpinionVisible.value = false;
|
||||
await getList();
|
||||
};
|
||||
const onUploadSuccess = (fileList, res) => {
|
||||
if (res.code == 200) {
|
||||
updateRow.value.opinion = res.data.url;
|
||||
}
|
||||
};
|
||||
const handleUpload = async (row?: any) => {
|
||||
// 判断是否有专业和设计人员
|
||||
if (!row?.principalName || !row?.specialtyName) {
|
||||
proxy?.$modal.warning('请先选择专业和设计人员');
|
||||
return;
|
||||
}
|
||||
resetUploadForm();
|
||||
uploadForm.volumeCatalogId = row.design;
|
||||
userList.value = row.noViewerList;
|
||||
|
@ -82,7 +82,7 @@
|
||||
<el-table-column label="质量标准" align="center" prop="qs" />
|
||||
<el-table-column label="规格型号" align="center" prop="specification" />
|
||||
<el-table-column label="计量单位" align="center" prop="unit" width="80" />
|
||||
<el-table-column label="需求数量" align="center" prop="demandQuantity" />
|
||||
<el-table-column label="需求数量" align="center" prop="quantity" />
|
||||
<el-table-column label="需求到货时间" align="center" prop="arrivalTime" width="250" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
</el-table>
|
||||
@ -123,22 +123,25 @@
|
||||
<el-table :data="form.planList">
|
||||
<el-table-column prop="name" align="center" label="物资名称">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.name" placeholder="请输入物资" />
|
||||
<!-- <el-input v-model="scope.row.name" placeholder="请输入物资" /> -->
|
||||
<el-select v-model="scope.row.suppliespriceId" placeholder="请选择" @change="(val) => selectName(val, scope.row)">
|
||||
<el-option v-for="item in nameList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="specification" align="center" label="规格型号" width="150">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.specification" placeholder="请输入规格型号" />
|
||||
<el-input v-model="scope.row.specification" placeholder="请输入规格型号" disabled />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unit" align="center" label="单位" width="130">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.unit" placeholder="请输入单位" />
|
||||
<el-input v-model="scope.row.unit" placeholder="请输入单位" disabled />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="demandQuantity" align="center" label="数量" width="130">
|
||||
<el-table-column prop="quantity" align="center" label="数量" width="130">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.demandQuantity" placeholder="请输入数量" type="number" min="0" />
|
||||
<el-input v-model="scope.row.quantity" placeholder="请输入数量" type="number" min="0" disabled />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="qs" align="center" label="质量标准" width="150">
|
||||
@ -153,7 +156,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" align="center" label="备注" width="150">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.remark" placeholder="请输入备注" />
|
||||
<el-input v-model="scope.row.remark" placeholder="请输入备注" disabled />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" align="center" label="操作" width="150">
|
||||
@ -175,7 +178,15 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Cailiaoshebei" lang="ts">
|
||||
import { getCailiaoshebei, updateCailiaoshebei, listBatch, getBatch, delBatch, listSelectCailiaoshebei } from '@/api/materials/batchPlan';
|
||||
import {
|
||||
getCailiaoshebei,
|
||||
updateCailiaoshebei,
|
||||
listBatch,
|
||||
getBatch,
|
||||
delBatch,
|
||||
listSelectCailiaoshebei,
|
||||
getDictList
|
||||
} from '@/api/materials/batchPlan';
|
||||
import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/batchPlan/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
|
||||
@ -221,7 +232,7 @@ const initFormData: any = {
|
||||
name: undefined,
|
||||
specification: undefined,
|
||||
unit: undefined,
|
||||
demandQuantity: undefined,
|
||||
quantity: undefined,
|
||||
qs: undefined,
|
||||
arrivalTime: undefined,
|
||||
remark: undefined
|
||||
@ -254,7 +265,7 @@ const data = reactive({
|
||||
});
|
||||
const batchNumber = ref('');
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
const nameList = ref([]);
|
||||
/** 查询物资-材料设备列表 */
|
||||
const getList = async (type?: string) => {
|
||||
loading.value = true;
|
||||
@ -271,6 +282,19 @@ const getList = async (type?: string) => {
|
||||
getMainList();
|
||||
};
|
||||
|
||||
const selectName = (val: any, row: any) => {
|
||||
const selected = nameList.value.find((item) => item.id === val);
|
||||
if (selected) {
|
||||
row.name = selected.name;
|
||||
row.specification = selected.specification;
|
||||
row.unit = selected.unit;
|
||||
row.qs = selected.qs;
|
||||
row.quantity = selected.quantity;
|
||||
row.remark = selected.remark;
|
||||
row.arrivalTime = selected.arrivalTime;
|
||||
}
|
||||
};
|
||||
|
||||
/** 节点单击事件 */
|
||||
const handleNodeClick = (data: any) => {
|
||||
queryParams.value.mainData.mrpBaseId = data.id;
|
||||
@ -304,7 +328,7 @@ const addRow = () => {
|
||||
name: undefined,
|
||||
specification: undefined,
|
||||
unit: undefined,
|
||||
demandQuantity: undefined,
|
||||
quantity: undefined,
|
||||
qs: undefined,
|
||||
arrivalTime: undefined,
|
||||
remark: undefined
|
||||
@ -328,7 +352,7 @@ const reset = () => {
|
||||
name: undefined,
|
||||
specification: undefined,
|
||||
unit: undefined,
|
||||
demandQuantity: undefined,
|
||||
quantity: undefined,
|
||||
qs: undefined,
|
||||
arrivalTime: undefined,
|
||||
remark: undefined
|
||||
@ -383,6 +407,7 @@ const handleUpdata = () => {
|
||||
/** 提交数据 */
|
||||
const submitTransferForm = async () => {
|
||||
const result = validateAndClean(form.value.planList);
|
||||
console.log('🚀 ~ submitTransferForm ~ form.value.planList:', form.value.planList);
|
||||
if (!result.valid) {
|
||||
proxy?.$modal.msgError('验证失败,主要信息存在部分字段缺失的数据项');
|
||||
return;
|
||||
@ -448,9 +473,15 @@ const handleAudit = async () => {
|
||||
});
|
||||
};
|
||||
|
||||
const getNameList = () => {
|
||||
getDictList({ projectId: currentProject.value?.id }).then((res) => {
|
||||
nameList.value = res.data;
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
// getSupplierList();
|
||||
getNameList();
|
||||
});
|
||||
|
||||
//监听项目id刷新数据
|
||||
@ -458,9 +489,8 @@ const listeningProject = watch(
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.mainData.projectId = nid;
|
||||
|
||||
queryParams.value.batchData.projectId = nid;
|
||||
form.value.mrpBaseBo.projectId = nid;
|
||||
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
@ -145,8 +145,13 @@
|
||||
<div v-for="(item, index) in form.itemList" :key="index" class="detail-item">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="名称" :prop="`itemList.${index}.name`" :rules="{ required: true, message: '名称不能为空', trigger: 'blur' }">
|
||||
<el-input v-model="item.name" placeholder="请输入名称" />
|
||||
<el-form-item
|
||||
disabled
|
||||
label="名称"
|
||||
:prop="`itemList.${index}.name`"
|
||||
:rules="{ required: true, message: '名称不能为空', trigger: 'blur' }"
|
||||
>
|
||||
<el-input disabled v-model="item.name" placeholder="请输入名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@ -155,12 +160,12 @@
|
||||
:prop="`itemList.${index}.specification`"
|
||||
:rules="{ required: true, message: '规格不能为空', trigger: 'blur' }"
|
||||
>
|
||||
<el-input v-model="item.specification" placeholder="请输入规格" />
|
||||
<el-input disabled v-model="item.specification" placeholder="请输入规格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位" :prop="`itemList.${index}.unit`" :rules="{ required: true, message: '单位不能为空', trigger: 'blur' }">
|
||||
<el-input v-model="item.unit" placeholder="请输入单位" />
|
||||
<el-input disabled v-model="item.unit" placeholder="请输入单位" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@ -169,7 +174,7 @@
|
||||
:prop="`itemList.${index}.quantity`"
|
||||
:rules="{ required: true, message: '数量不能为空', trigger: 'blur' }"
|
||||
>
|
||||
<el-input type="number" v-model="item.quantity" placeholder="请输入数量" />
|
||||
<el-input disabled type="number" v-model="item.quantity" placeholder="请输入数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@ -345,7 +350,20 @@ const data = reactive({
|
||||
supplierUnit: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {}
|
||||
rules: {
|
||||
// 物资采购单
|
||||
docId: [{ required: true, message: '请选择物资采购单', trigger: 'change' }],
|
||||
// 材料来源
|
||||
materialSource: [{ required: true, message: '请选择材料来源', trigger: 'change' }],
|
||||
// 表单编号
|
||||
formCode: [{ required: true, message: '请输入表单编号', trigger: 'blur' }],
|
||||
// 采购单编号
|
||||
docCode: [{ required: true, message: '请输入采购单编号', trigger: 'blur' }],
|
||||
// 供货单位
|
||||
supplierUnit: [{ required: true, message: '请输入供货单位', trigger: 'blur' }],
|
||||
// 订货单位
|
||||
orderingUnit: [{ required: true, message: '请输入订货单位', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
@ -391,6 +391,7 @@
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, toRaw, getCurrentInstance } from 'vue';
|
||||
import { materialsUsageDetails, materialsSonAdd, materialsSonDel, materialsSonEdit } from '@/api/materials/usageMaterials/index';
|
||||
import { routerRename } from '@/api/air';
|
||||
const { proxy } = getCurrentInstance();
|
||||
const dialogVisible2 = ref(false);
|
||||
const dialogType2 = ref('addSon'); // add 或 edit
|
||||
|
277
src/views/patch/index.vue
Normal file
277
src/views/patch/index.vue
Normal file
@ -0,0 +1,277 @@
|
||||
<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="项目ID" prop="projectId">
|
||||
<el-input v-model="queryParams.projectId" placeholder="请输入项目ID" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务名称" prop="taskName">
|
||||
<el-input v-model="queryParams.taskName" placeholder="请输入任务名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务描述" prop="describe">
|
||||
<el-input v-model="queryParams.describe" placeholder="请输入任务描述" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划完成时间" prop="pcd">
|
||||
<el-date-picker clearable v-model="queryParams.pcd" type="date" value-format="YYYY-MM-DD" placeholder="请选择计划完成时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="实际完成时间" prop="act">
|
||||
<el-date-picker clearable v-model="queryParams.act" type="date" value-format="YYYY-MM-DD" placeholder="请选择实际完成时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="完成进度" prop="completionProgress">
|
||||
<el-input v-model="queryParams.completionProgress" 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="['patch:patch:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['patch:patch:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['patch:patch:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['patch:patch:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="masterList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键ID" align="center" prop="id" v-if="true" />
|
||||
<el-table-column label="项目ID" align="center" prop="projectId" />
|
||||
<el-table-column label="任务名称" align="center" prop="taskName" />
|
||||
<el-table-column label="任务描述" align="center" prop="describe" />
|
||||
<el-table-column label="计划完成时间" align="center" prop="pcd" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.pcd, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实际完成时间" align="center" prop="act" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.act, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="完成进度" align="center" prop="completionProgress" />
|
||||
<el-table-column label="任务状态" align="center" prop="taskStatus" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<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="['patch:patch:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['patch:patch: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="masterFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="项目ID" prop="projectId">
|
||||
<el-input v-model="form.projectId" placeholder="请输入项目ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务名称" prop="taskName">
|
||||
<el-input v-model="form.taskName" placeholder="请输入任务名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务描述" prop="describe">
|
||||
<el-input v-model="form.describe" placeholder="请输入任务描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划完成时间" prop="pcd">
|
||||
<el-date-picker clearable v-model="form.pcd" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择计划完成时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="实际完成时间" prop="act">
|
||||
<el-date-picker clearable v-model="form.act" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择实际完成时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="完成进度" prop="completionProgress">
|
||||
<el-input v-model="form.completionProgress" placeholder="请输入完成进度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</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="Master" lang="ts">
|
||||
import { listMaster, getMaster, delMaster, addMaster, updateMaster } from '@/api/patch';
|
||||
import { MasterVO, MasterQuery, MasterForm } from '@/api/patch/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const masterList = ref<MasterVO[]>([]);
|
||||
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 masterFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: MasterForm = {
|
||||
id: undefined,
|
||||
projectId: undefined,
|
||||
taskName: undefined,
|
||||
describe: undefined,
|
||||
pcd: undefined,
|
||||
act: undefined,
|
||||
completionProgress: undefined,
|
||||
taskStatus: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
const data = reactive<PageData<MasterForm, MasterQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: undefined,
|
||||
taskName: undefined,
|
||||
describe: undefined,
|
||||
pcd: undefined,
|
||||
act: undefined,
|
||||
completionProgress: undefined,
|
||||
taskStatus: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询派单列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listMaster(queryParams.value);
|
||||
masterList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
masterFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: MasterVO[]) => {
|
||||
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?: MasterVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getMaster(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改派单';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
masterFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateMaster(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addMaster(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: MasterVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除派单编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delMaster(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'patch/patch/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`master_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
@ -149,6 +149,9 @@
|
||||
|
||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['project:project:edit']">修改 </el-button>
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['project:project:remove']">删除 </el-button>
|
||||
<el-button link type="primary" icon="upload" @click="handleUpload(scope.row)" v-hasPermi="['project:project:saveTenderFile']"
|
||||
>招标文件上传
|
||||
</el-button>
|
||||
</el-space>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -190,9 +193,9 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="项目类别" prop="projectCategory" label-width="100px">
|
||||
<el-select v-model="form.projectCategory" placeholder="请选择项目类别" clearable>
|
||||
<el-option v-for="dict in project_category_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
<el-form-item label="项目阶段" prop="projectStage" label-width="100px">
|
||||
<el-select v-model="form.projectStage" placeholder="请选择项目类别" clearable>
|
||||
<el-option v-for="dict in project_stage" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -359,6 +362,15 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="上传文件" v-model="fileVisble" width="400">
|
||||
<file-upload v-model="fileForm.tenderFiles" :limit="10" :file-type="['pdf']" :file-size="50" />
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button v-loading="buttonLoading" type="primary" @click="uploadSubmit"> 提交</el-button>
|
||||
<el-button @click="fileVisble = false">取消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -370,7 +382,7 @@ import {
|
||||
addProjectPilePoint,
|
||||
addProjectSquare,
|
||||
delProject,
|
||||
getChildProject,
|
||||
uploadProjectFile,
|
||||
getProject,
|
||||
listProject,
|
||||
updateProject
|
||||
@ -378,8 +390,8 @@ import {
|
||||
import { ProjectForm, ProjectQuery, ProjectVO, childProjectQuery, locationType } from '@/api/project/project/types';
|
||||
import amap from '@/components/amap/index.vue';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { sys_normal_disable, project_category_type, project_type } = toRefs<any>(
|
||||
proxy?.useDict('sys_normal_disable', 'project_category_type', 'project_type')
|
||||
const { sys_normal_disable, project_category_type, project_type, project_stage } = toRefs<any>(
|
||||
proxy?.useDict('sys_normal_disable', 'project_category_type', 'project_type', 'project_stage')
|
||||
);
|
||||
const projectList = ref<ProjectVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
@ -408,6 +420,11 @@ const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
const fileVisble = ref(false);
|
||||
const fileForm = ref({
|
||||
id: '',
|
||||
tenderFiles: ''
|
||||
});
|
||||
const jsonData = ref(null);
|
||||
const fullscreenLoading = ref(false);
|
||||
|
||||
@ -521,48 +538,6 @@ const setPoi = (location: locationType) => {
|
||||
const setCheckedNodes = (nodeList: any) => {
|
||||
nodes.value = nodeList;
|
||||
};
|
||||
//上传节点
|
||||
// const addFacilities = async () => {
|
||||
// if (!layerType.value) {
|
||||
// return proxy?.$modal.msgError('请选择图层类型');
|
||||
// }
|
||||
// if (!nodes.value.length) {
|
||||
// return proxy?.$modal.msgError('请选择需要上传的图层');
|
||||
// }
|
||||
// const data = {
|
||||
// projectId: projectId.value,
|
||||
// nameGeoJson: null,
|
||||
// locationGeoJson: null,
|
||||
// pointGeoJson: null
|
||||
// };
|
||||
// loading.value = true;
|
||||
// if (layerType.value == 1) {
|
||||
// if (nodes.value[0].option == '名称') {
|
||||
// data.nameGeoJson = jsonData.value[nodes.value[0].location.index];
|
||||
// data.locationGeoJson = jsonData.value[nodes.value[1].location.index];
|
||||
// } else {
|
||||
// data.nameGeoJson = jsonData.value[nodes.value[1].location.index];
|
||||
// data.locationGeoJson = jsonData.value[nodes.value[0].location.index];
|
||||
// }
|
||||
// await addProjectFacilities(data);
|
||||
// await proxy?.$modal.msgSuccess('添加成功');
|
||||
// } else if (layerType.value == 2) {
|
||||
// data.pointGeoJson = jsonData.value[nodes.value[0].location.index];
|
||||
// await addProjectPilePoint(data);
|
||||
// await proxy?.$modal.msgSuccess('添加成功');
|
||||
// } else if (layerType.value == 3) {
|
||||
// if (nodes.value[0].option == '名称') {
|
||||
// data.nameGeoJson = jsonData.value[nodes.value[0].location.index];
|
||||
// data.locationGeoJson = jsonData.value[nodes.value[1].location.index];
|
||||
// } else {
|
||||
// data.nameGeoJson = jsonData.value[nodes.value[1].location.index];
|
||||
// data.locationGeoJson = jsonData.value[nodes.value[0].location.index];
|
||||
// }
|
||||
// await addProjectSquare(data);
|
||||
// await proxy?.$modal.msgSuccess('添加成功');
|
||||
// }
|
||||
// loading.value = false;
|
||||
// };
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
@ -643,6 +618,24 @@ const submitForm = () => {
|
||||
});
|
||||
};
|
||||
|
||||
/** 上传文件 */
|
||||
const handleUpload = async (row?: ProjectVO) => {
|
||||
fileForm.value.id = row.id;
|
||||
fileForm.value.tenderFiles = row.tenderFiles;
|
||||
|
||||
fileVisble.value = true;
|
||||
};
|
||||
|
||||
const uploadSubmit = async () => {
|
||||
if (!fileForm.value.tenderFiles) return proxy.$modal.msgError('请上传文件');
|
||||
let res = await uploadProjectFile(fileForm.value);
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('上传成功');
|
||||
fileVisble.value = false;
|
||||
await getList();
|
||||
}
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: ProjectVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
|
285
src/views/tender/plan/index.vue
Normal file
285
src/views/tender/plan/index.vue
Normal file
@ -0,0 +1,285 @@
|
||||
<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="subpackageName">
|
||||
<el-input v-model="queryParams.subpackageName" placeholder="请输入分包名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分包内容" prop="subpackageContext">
|
||||
<el-input v-model="queryParams.subpackageContext" placeholder="请输入分包内容" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="限价" prop="limitPrice">
|
||||
<el-input v-model="queryParams.limitPrice" placeholder="请输入限价" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划招标时间" prop="planTenderTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.planTenderTime"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择计划招标时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="招标方式" prop="tenderMethod">
|
||||
<el-input v-model="queryParams.tenderMethod" placeholder="请输入招标方式" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同额" prop="contract">
|
||||
<el-input v-model="queryParams.contract" 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="['plan:plan:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['plan:plan:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['plan:plan:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['plan:plan:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="招标计划ID" align="center" prop="id" v-if="true" />
|
||||
<el-table-column label="分包类型" align="center" prop="subpackageType" />
|
||||
<el-table-column label="分包名称" align="center" prop="subpackageName" />
|
||||
<el-table-column label="分包内容" align="center" prop="subpackageContext" />
|
||||
<el-table-column label="限价" align="center" prop="limitPrice" />
|
||||
<el-table-column label="计划招标时间" align="center" prop="planTenderTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.planTenderTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="招标方式" align="center" prop="tenderMethod" />
|
||||
<el-table-column label="招标文件(多个)" align="center" prop="tenderFile" />
|
||||
<el-table-column label="中标文件(单个)" align="center" prop="bidFile" />
|
||||
<el-table-column label="合同额" align="center" prop="contract" />
|
||||
<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="['plan:plan:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['plan:plan: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="planFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="分包名称" prop="subpackageName">
|
||||
<el-input v-model="form.subpackageName" placeholder="请输入分包名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分包内容" prop="subpackageContext">
|
||||
<el-input v-model="form.subpackageContext" placeholder="请输入分包内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="限价" prop="limitPrice">
|
||||
<el-input v-model="form.limitPrice" placeholder="请输入限价" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划招标时间" prop="planTenderTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.planTenderTime"
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="请选择计划招标时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="招标方式" prop="tenderMethod">
|
||||
<el-input v-model="form.tenderMethod" placeholder="请输入招标方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="招标文件(多个)" prop="tenderFile">
|
||||
<file-upload v-model="form.tenderFile"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="中标文件(单个)" prop="bidFile">
|
||||
<file-upload v-model="form.bidFile"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同额" prop="contract">
|
||||
<el-input v-model="form.contract" placeholder="请输入合同额" />
|
||||
</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="Plan" lang="ts">
|
||||
import { listPlan, getPlan, delPlan, addPlan, updatePlan } from '@/api/plan/plan';
|
||||
import { PlanVO, PlanQuery, PlanForm } from '@/api/plan/plan/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const planList = ref<PlanVO[]>([]);
|
||||
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 planFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: PlanForm = {
|
||||
id: undefined,
|
||||
subpackageType: undefined,
|
||||
subpackageName: undefined,
|
||||
subpackageContext: undefined,
|
||||
limitPrice: undefined,
|
||||
planTenderTime: undefined,
|
||||
tenderMethod: undefined,
|
||||
tenderFile: undefined,
|
||||
bidFile: undefined,
|
||||
contract: undefined,
|
||||
}
|
||||
const data = reactive<PageData<PlanForm, PlanQuery>>({
|
||||
form: {...initFormData},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
subpackageType: undefined,
|
||||
subpackageName: undefined,
|
||||
subpackageContext: undefined,
|
||||
limitPrice: undefined,
|
||||
planTenderTime: undefined,
|
||||
tenderMethod: undefined,
|
||||
tenderFile: undefined,
|
||||
bidFile: undefined,
|
||||
contract: undefined,
|
||||
params: {
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "招标计划ID不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询招标计划列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listPlan(queryParams.value);
|
||||
planList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = {...initFormData};
|
||||
planFormRef.value?.resetFields();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: PlanVO[]) => {
|
||||
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?: PlanVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0]
|
||||
const res = await getPlan(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = "修改招标计划";
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
planFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updatePlan(form.value).finally(() => buttonLoading.value = false);
|
||||
} else {
|
||||
await addPlan(form.value).finally(() => buttonLoading.value = false);
|
||||
}
|
||||
proxy?.$modal.msgSuccess("操作成功");
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: PlanVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除招标计划编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
|
||||
await delPlan(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download('plan/plan/export', {
|
||||
...queryParams.value
|
||||
}, `plan_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
368
src/views/tender/supplierInput/index.vue
Normal file
368
src/views/tender/supplierInput/index.vue
Normal file
@ -0,0 +1,368 @@
|
||||
<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>
|
||||
<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="['supplierInput:supplierInput:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['supplierInput:supplierInput:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['supplierInput:supplierInput:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['supplierInput:supplierInput:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="supplierInputList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="" align="center" prop="id" v-if="true" />
|
||||
<el-table-column label="供应商类型" align="center" prop="supplierType" />
|
||||
<el-table-column label="入库资料" align="center" prop="inputFile" />
|
||||
<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="['supplierInput:supplierInput:edit']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['supplierInput:supplierInput: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="supplierInputFormRef" :model="form" :rules="rules" label-width="100px">
|
||||
<!-- 新增的供应商类型下拉框 -->
|
||||
<el-form-item label="供应商类型" prop="supplierType">
|
||||
<el-select v-model="form.supplierType" placeholder="请选择供应商类型">
|
||||
<el-option label="劳务" value="劳务"></el-option>
|
||||
<el-option label="技术服务" value="技术服务"></el-option>
|
||||
<el-option label="物资设备" value="物资设备"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="入库资料" prop="inputFile" l>
|
||||
<file-upload
|
||||
v-model="form.inputFile"
|
||||
:fileType="['doc', 'docx', 'pdf']"
|
||||
:autoUpload="false"
|
||||
ref="fileUploadRef"
|
||||
:method="form.id ? 'put' : 'post'"
|
||||
:data="{ supplierType: form.supplierType }"
|
||||
uploadUrl="/supplierInput/supplierInput"
|
||||
:limit="1"
|
||||
:onUploadSuccess="handleUploadSuccess"
|
||||
@handleChange="change"
|
||||
showFileList
|
||||
>
|
||||
<div>
|
||||
<el-button type="primary">上传文件</el-button><br />
|
||||
<transition-group
|
||||
class="upload-file-list el-upload-list el-upload-list--text"
|
||||
name="el-fade-in-linear"
|
||||
tag="ul"
|
||||
@click.stop
|
||||
v-if="fileUrl"
|
||||
>
|
||||
<li style="margin-top: 10px" class="el-upload-list__item ele-upload-list__item-content">
|
||||
<el-link :href="`${fileUrl}`" :underline="false" target="_blank">
|
||||
<el-button class="el-icon-document"> 下载文件 </el-button>
|
||||
</el-link>
|
||||
</li>
|
||||
</transition-group>
|
||||
</div>
|
||||
</file-upload>
|
||||
</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="SupplierInput" lang="ts">
|
||||
import { listSupplierInput, getSupplierInput, delSupplierInput, addSupplierInput, updateSupplierInput } from '@/api/supplierInput/supplierInput';
|
||||
import { SupplierInputVO, SupplierInputQuery, SupplierInputForm } from '@/api/supplierInput/supplierInput/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const fileUploadRef = ref(null);
|
||||
const supplierInputList = ref<SupplierInputVO[]>([]);
|
||||
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 supplierInputFormRef = ref<ElFormInstance>();
|
||||
const fileUrl = ref('');
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: SupplierInputForm = {
|
||||
id: undefined,
|
||||
supplierType: undefined,
|
||||
inputFile: undefined
|
||||
};
|
||||
|
||||
const data = reactive<PageData<SupplierInputForm, SupplierInputQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
supplierType: undefined,
|
||||
inputFile: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
// 添加供应商类型的验证规则
|
||||
supplierType: [{ required: true, message: '请选择供应商类型', trigger: 'change' }],
|
||||
id: [{ required: true, message: '不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询供应商入库列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listSupplierInput(queryParams.value);
|
||||
supplierInputList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
fileUrl.value = '';
|
||||
supplierInputFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
const handleUploadSuccess = () => {
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
buttonLoading.value = false;
|
||||
getList();
|
||||
};
|
||||
|
||||
const change = (fileList) => {
|
||||
fileUrl.value = '';
|
||||
};
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: SupplierInputVO[]) => {
|
||||
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?: SupplierInputVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getSupplierInput(_id);
|
||||
// Object.assign(form.value, res.data);
|
||||
form.value = {
|
||||
...form.value,
|
||||
...res.data,
|
||||
inputFile: ''
|
||||
};
|
||||
fileUrl.value = res.data.inputFile;
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改供应商入库';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
supplierInputFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
fileUploadRef.value.submitUpload().then(() => {
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: SupplierInputVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除供应商入库编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delSupplierInput(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'supplierInput/supplierInput/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`supplierInput_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.pdf {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
border-radius: 6px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
img {
|
||||
width: 40%;
|
||||
}
|
||||
&:hover {
|
||||
.Shadow {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
> span {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.upload-file-list {
|
||||
margin: 0;
|
||||
.el-upload-list__item {
|
||||
border: 1px solid #e4e7ed;
|
||||
line-height: 2;
|
||||
margin-bottom: 0;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
|
||||
.upload-file-list .ele-upload-list__item-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
color: inherit;
|
||||
}
|
||||
.Shadow {
|
||||
align-items: center;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
color: #fff;
|
||||
cursor: default;
|
||||
display: inline-flex;
|
||||
font-size: 20px;
|
||||
height: 100%;
|
||||
justify-content: center;
|
||||
left: 0;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
transition: opacity 0.3s;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.ele-upload-list__item-content-action .el-link {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.el-icon.avatar-uploader-icon {
|
||||
border: 1px dashed #cdd0d6;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.el-icon.avatar-uploader-icon:hover {
|
||||
border-color: #409eff;
|
||||
}
|
||||
|
||||
.el-icon.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 200px;
|
||||
height: 178px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user