招标
This commit is contained in:
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'
|
||||
});
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { MasterVO, MasterForm, MasterQuery } from '@/api/patch/master/types';
|
||||
import { MasterVO, MasterForm, MasterQuery } from '@/api/patch/types';
|
||||
|
||||
/**
|
||||
* 查询派单列表
|
||||
@ -33,7 +33,7 @@ export const getMaster = (id: string | number): AxiosPromise<MasterVO> => {
|
||||
*/
|
||||
export const addMaster = (data: MasterForm) => {
|
||||
return request({
|
||||
url: '/patch/',
|
||||
url: '/patch',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
@ -45,7 +45,7 @@ export const addMaster = (data: MasterForm) => {
|
||||
*/
|
||||
export const updateMaster = (data: MasterForm) => {
|
||||
return request({
|
||||
url: '/patch/',
|
||||
url: '/patch',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
@ -61,3 +61,47 @@ export const delMaster = (id: string | number | Array<string | number>) => {
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 完成进度
|
||||
* @param masterId
|
||||
*/
|
||||
export function getProgressDetail(masterId: string | number) {
|
||||
return request({
|
||||
url: `/patch/getProgressList/${masterId}`, // 你的后端进度详情接口地址
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 弹窗新增进度
|
||||
export const addProgress = (data) => {
|
||||
return request({
|
||||
url: '/patch/progress',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
// 弹窗修改进度
|
||||
export const editProgress = (data) => {
|
||||
return request({
|
||||
url: '/patch/editProgress',
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
// 删除进度
|
||||
export const deleteProgress = (id) => {
|
||||
return request({
|
||||
url: `/removeProgress/{id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
export const getUserName = () => {
|
||||
return request({
|
||||
url: `/patch/findThis`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
@ -51,13 +51,9 @@ export const updatePlan = (data: PlanForm) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除招标计划
|
||||
* @param id
|
||||
*/
|
||||
export const delPlan = (id: string | number | Array<string | number>) => {
|
||||
export const getSegmentedIndicatorPlanning = (id) => {
|
||||
return request({
|
||||
url: '/plan/plan/' + id,
|
||||
method: 'delete'
|
||||
url: '/tender/segmentedIndicatorPlanning/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
@ -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;
|
||||
|
||||
/**
|
||||
* 项目简称
|
||||
@ -128,10 +129,10 @@ export interface locationType {
|
||||
projectSite: string;
|
||||
}
|
||||
|
||||
export interface childProjectQuery{
|
||||
projectName:string;
|
||||
pid:string;
|
||||
id?:string
|
||||
export interface childProjectQuery {
|
||||
projectName: string;
|
||||
pid: string;
|
||||
id?: string;
|
||||
}
|
||||
|
||||
export interface ProjectForm extends BaseEntity {
|
||||
|
@ -310,11 +310,11 @@ const uploadedSuccessfully = (res: any) => {
|
||||
emit('update:modelValue', listToString(fileList.value));
|
||||
proxy?.$modal.closeLoading();
|
||||
}
|
||||
if (props.autoUpload && props.limit === fileList.value.length) {
|
||||
fileUploadRef.value?.clearFiles();
|
||||
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);
|
||||
};
|
||||
|
||||
@ -359,6 +359,8 @@ const customUpload = async (options: any) => {
|
||||
});
|
||||
handleUploadSuccess(res.data, options.file);
|
||||
} catch (err) {
|
||||
console.log(err, 'err');
|
||||
|
||||
handleUploadError();
|
||||
}
|
||||
} else {
|
||||
|
@ -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('操作成功');
|
||||
});
|
||||
});
|
||||
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);
|
||||
loading.value = false;
|
||||
buttonDisabled.value = false;
|
||||
detailFormTeRef.value.submit(businessId.value, () => {
|
||||
terminationTask(params).finally(() => {
|
||||
loading.value = false;
|
||||
buttonDisabled.value = false;
|
||||
dialog.visible = false;
|
||||
emits('submitCallback');
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
});
|
||||
});
|
||||
dialog.visible = false;
|
||||
emits('submitCallback');
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
};
|
||||
//终止任务
|
||||
const handleTerminationTask = async () => {
|
||||
|
@ -116,6 +116,7 @@ import { listContactTypeformtemplate } from '@/api/cory/contactformtemplate';
|
||||
import { addContactnotice, delContactnotice, listContactnotice } from '@/api/cory/contactnotice';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { wf_business_status } = toRefs(proxy?.useDict('wf_business_status'));
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
@ -293,4 +294,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,198 +294,256 @@ 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) {
|
||||
|
||||
try {
|
||||
const res = await extractBatch(body);
|
||||
if (res.code === 200) {
|
||||
form.id = res.data;
|
||||
await submit(status.value, form); // 执行暂存/提交流程
|
||||
} else {
|
||||
ElMessage.error(res.msg);
|
||||
}
|
||||
} catch (err) {
|
||||
ElMessage.error('提交失败,请重试');
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
dialog.visible = false;
|
||||
} else {
|
||||
ElMessage.error(res.msg);
|
||||
}
|
||||
// 表单验证通过,执行提交逻辑
|
||||
form.id = res.data;
|
||||
submit(status.value, form);
|
||||
} else {
|
||||
// 表单验证失败,提示用户并关闭加载状态
|
||||
proxy?.$modal.msgError('请完善必填信息后再提交');
|
||||
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;
|
||||
// 调用接口获取数据
|
||||
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') {
|
||||
disableAll.value = true;
|
||||
}
|
||||
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.catalogueList && data.catalogueList.length > 0) {
|
||||
// 清空现有列表
|
||||
form.documents = [];
|
||||
// 填充新数据
|
||||
data.catalogueList.forEach((item: any, index: number) => {
|
||||
form.documents.push({
|
||||
id: item.id || Date.now() + index, // 确保id唯一
|
||||
// 非草稿状态禁用表单
|
||||
if (data.status !== 'draft') {
|
||||
disableAll.value = true;
|
||||
}
|
||||
|
||||
// 回显资料列表
|
||||
if (data.catalogueList && data.catalogueList.length > 0) {
|
||||
form.documents = data.catalogueList.map((item: any, index: number) => ({
|
||||
id: item.id || Date.now() + index,
|
||||
catalogueName: item.catalogueName || '',
|
||||
remark: item.remark || '',
|
||||
volumeCatalogId: item.volumeCatalogId
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// 如果没有资料,保持一个空项
|
||||
form.documents = [
|
||||
{
|
||||
id: Date.now(),
|
||||
catalogueName: '',
|
||||
remark: '',
|
||||
volumeCatalogId: ''
|
||||
}
|
||||
];
|
||||
volumeCatalogId: item.volumeCatalogId || ''
|
||||
}));
|
||||
} else {
|
||||
form.documents = [
|
||||
{
|
||||
id: Date.now(),
|
||||
catalogueName: '',
|
||||
remark: '',
|
||||
volumeCatalogId: ''
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
ElMessage.error('获取表单数据失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
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;
|
||||
volumeCatalogList.value.forEach((e) => {
|
||||
volumeMap.set(e.design, e);
|
||||
});
|
||||
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();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -7,7 +7,8 @@
|
||||
<el-form :model="state.queryForm" :inline="true">
|
||||
<el-form-item label="版本号" prop="versions">
|
||||
<el-select v-model="state.queryForm.versions" placeholder="选择版本号">
|
||||
<el-option v-for="item in state.options" :key="item.versions" :label="item.versions" :value="item.versions" />
|
||||
<el-option v-for="item in state.options" :key="item.versions" :label="item.versions"
|
||||
:value="item.versions" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="表名" prop="sheet">
|
||||
@ -24,9 +25,13 @@
|
||||
<el-form-item>
|
||||
<el-upload ref="uploadRef" class="upload-demo" :http-request="importExcel" :show-file-list="false">
|
||||
<template #trigger>
|
||||
<el-button type="primary">导入excel</el-button>
|
||||
<el-button v-if="Object.keys(state.versionsData).length === 0 || state.versionsData.status == 'cancel' ||state.versionsData.status == 'back'" type="primary">导入excel</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
<el-button v-if="state.versionsData.status == 'draft'" type="primary" con="edit"
|
||||
@click="clickApprovalSheet()">审核</el-button>
|
||||
<el-button v-if="state.versionsData.status == 'waiting' || state.versionsData.status == 'finish'"
|
||||
icon="view" @click="lookApprovalFlow()" type="warning">查看流程</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@ -34,53 +39,32 @@
|
||||
<el-form :model="state.queryForm" :inline="true">
|
||||
<el-form-item label="版本号" prop="versions">
|
||||
<el-select v-model="state.queryForm.versions" placeholder="选择版本号" @change="handleChangeVersion">
|
||||
<el-option v-for="item in state.options" :key="item.versions" :label="item.versions" :value="item.versions" />
|
||||
<el-option v-for="item in state.options" :key="item.versions" :label="item.versions"
|
||||
:value="item.versions" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
class="upload-demo"
|
||||
:http-request="importExcel"
|
||||
style="margin-right: 12px"
|
||||
v-if="Object.keys(state.versionsData).length === 0 || state.versionsData.status == 'cancel'"
|
||||
:show-file-list="false"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">导入excel</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
<el-button v-if="state.versionsData.status == 'draft'" type="primary" con="edit" @click="clickApprovalSheet()">审核</el-button>
|
||||
<el-button
|
||||
v-if="state.versionsData.status == 'waiting' || state.versionsData.status == 'finish'"
|
||||
icon="view"
|
||||
@click="lookApprovalFlow()"
|
||||
type="warning"
|
||||
>查看流程</el-button
|
||||
>
|
||||
<el-button v-if="Object.keys(state.versionsData).length === 0 || state.versionsData.status == 'cancel'" type="primary">导入excel</el-button>
|
||||
<el-button v-if="state.versionsData.status == 'draft'" type="primary" con="edit"
|
||||
@click="clickApprovalSheet()">审核</el-button>
|
||||
<el-button v-if="state.versionsData.status == 'waiting' || state.versionsData.status == 'finish'"
|
||||
icon="view" @click="lookApprovalFlow()" type="warning">查看流程</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-table
|
||||
v-if="index < 3"
|
||||
:ref="(el) => (tableRef[index] = el)"
|
||||
:data="state.tableData"
|
||||
v-loading="state.loading.list"
|
||||
stripe
|
||||
:row-class-name="state.tableData.length === 0 ? 'table-null' : ''"
|
||||
style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)"
|
||||
row-key="id"
|
||||
lazy
|
||||
border
|
||||
:default-expand-all="true"
|
||||
>
|
||||
<el-table v-if="index < 3" :ref="(el) => (tableRef[index] = el)" :data="state.tableData"
|
||||
v-loading="state.loading.list" stripe :row-class-name="state.tableData.length === 0 ? 'table-null' : ''"
|
||||
style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)" row-key="id" lazy border
|
||||
:default-expand-all="true">
|
||||
<el-table-column prop="num" label="编号" />
|
||||
<el-table-column prop="name" label="工程或费用名称" />
|
||||
<el-table-column prop="unit" label="单位" />
|
||||
<el-table-column prop="specification" label="规格" />
|
||||
<el-table-column prop="quantity" label="数量" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
</el-table>
|
||||
<el-table v-if="index == 3" :data="state.tableData" style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)" row-key="id" border>
|
||||
<el-table v-if="index == 3" :data="state.tableData"
|
||||
style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)" row-key="id" border>
|
||||
<el-table-column prop="num" label="编号" />
|
||||
<el-table-column prop="name" label="名称" />
|
||||
<el-table-column prop="specification" label="规格" />
|
||||
@ -108,7 +92,7 @@ const currentProject = computed(() => userStore.selectedProject);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { work_order_type } = toRefs(proxy?.useDict('work_order_type'));
|
||||
const tableRef = ref({});
|
||||
console.log(currentProject.value);
|
||||
console.log(work_order_type);
|
||||
|
||||
// tableData
|
||||
// 版本号
|
||||
@ -138,6 +122,7 @@ const state = reactive({
|
||||
});
|
||||
// tab切换
|
||||
const handleTabChange = (tab) => {
|
||||
console.log('tab',tab);
|
||||
state.tableData = [];
|
||||
state.options = [];
|
||||
state.sheets = [];
|
||||
@ -171,10 +156,10 @@ async function getVersionNums(isSheet = true) {
|
||||
state.options = rows || [];
|
||||
if (state.options.length > 0) {
|
||||
state.queryForm.versions = state.options[0].versions;
|
||||
if (state.work_order_type == 3) {
|
||||
state.versionsData = state.options[0] || [];
|
||||
console.log('state.versionsData', state.versionsData);
|
||||
}
|
||||
// if (state.work_order_type == 3) {
|
||||
state.versionsData = state.options[0] || [];
|
||||
// console.log('state.versionsData', state.versionsData);
|
||||
// }
|
||||
// 等待表名加载完成
|
||||
console.log(isSheet, state.sheets.length);
|
||||
if (isSheet) {
|
||||
@ -317,7 +302,7 @@ function handleArr(arr, flag, table) {
|
||||
function clickApprovalSheet(row) {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/approval/billofQuantities/indexEdit`,
|
||||
path: `/approval/billofQuantities/indexEdit`+state.work_order_type,
|
||||
query: {
|
||||
id: state.queryForm.versions,
|
||||
type: 'update'
|
||||
@ -327,7 +312,7 @@ function clickApprovalSheet(row) {
|
||||
// 审核流程
|
||||
function lookApprovalFlow(row) {
|
||||
proxy.$router.push({
|
||||
path: `/approval/billofQuantities/indexEdit`,
|
||||
path: `/approval/billofQuantities/indexEdit`+state.work_order_type,
|
||||
query: {
|
||||
id: state.queryForm.versions,
|
||||
type: 'view'
|
||||
|
357
src/views/design/billofQuantities/indexEdit0.vue
Normal file
357
src/views/design/billofQuantities/indexEdit0.vue
Normal file
@ -0,0 +1,357 @@
|
||||
<template>
|
||||
<div class="p-4 bg-gray-50">
|
||||
<div class="max-w-4xl mx-auto">
|
||||
<!-- 顶部按钮区域 -->
|
||||
<el-card class="mb-4 rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md">
|
||||
<approvalButton
|
||||
@submitForm="submitForm"
|
||||
@approvalVerifyOpen="approvalVerifyOpen"
|
||||
@handleApprovalRecord="handleApprovalRecord"
|
||||
:buttonLoading="buttonLoading"
|
||||
:id="form.versions"
|
||||
:status="form.status"
|
||||
:pageType="routeParams.type"
|
||||
/>
|
||||
</el-card>
|
||||
<!-- 表单区域 -->
|
||||
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
||||
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
|
||||
<h3 class="text-lg font-semibold text-gray-800">投标工程清单</h3>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<el-form
|
||||
ref="leaveFormRef"
|
||||
v-loading="loading"
|
||||
:disabled="routeParams.type === 'view' || form.status == 'waiting'"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
class="space-y-4"
|
||||
>
|
||||
<div class="grid grid-cols-1 gap-4">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="版本号" prop="formNo">
|
||||
<el-input disabled v-model="form.versions" placeholder="请输入文件名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-table :data="tableData" style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)" row-key="id" border>
|
||||
<el-table-column prop="num" label="编号" />
|
||||
<el-table-column prop="name" label="名称" />
|
||||
<el-table-column prop="specification" label="规格" />
|
||||
<el-table-column prop="unit" label="单位" />
|
||||
<el-table-column prop="quantity" label="数量" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 提交组件 -->
|
||||
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||
<approvalRecord ref="approvalRecordRef"></approvalRecord>
|
||||
<!-- 流程选择对话框 -->
|
||||
<el-dialog
|
||||
draggable
|
||||
v-model="dialogVisible.visible"
|
||||
:title="dialogVisible.title"
|
||||
:before-close="handleClose"
|
||||
width="500"
|
||||
class="rounded-lg shadow-lg"
|
||||
>
|
||||
<div class="p-4">
|
||||
<p class="text-gray-600 mb-4">请选择要启动的流程:</p>
|
||||
<el-select v-model="flowCode" placeholder="请选择流程" style="width: 100%">
|
||||
<el-option v-for="item in flowCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer p-4 border-t border-gray-100 flex justify-end space-x-3">
|
||||
<el-button @click="handleClose" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors"
|
||||
>取消</el-button
|
||||
>
|
||||
<el-button type="primary" @click="submitFlow()" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors"
|
||||
>确认</el-button
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Leave" lang="ts">
|
||||
import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types';
|
||||
import { startWorkFlow } from '@/api/workflow/task';
|
||||
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
||||
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||
import ApprovalButton from '@/components/Process/approvalButton.vue';
|
||||
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
const { design_change_reason_type } = toRefs<any>(proxy?.useDict('design_change_reason_type'));
|
||||
import { detailsMaterialAndEquipmentApproval } from '@/api/design/billofQuantities/index';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
//路由参数
|
||||
const routeParams = ref<Record<string, any>>({});
|
||||
const flowCode = ref<string>('');
|
||||
const status = ref<string>('');
|
||||
const dialogVisible = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: '流程定义'
|
||||
});
|
||||
//提交组件
|
||||
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||
//审批记录组件
|
||||
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||
//按钮组件
|
||||
const flowCodeOptions = [
|
||||
{
|
||||
value: currentProject.value?.id + '_bidEquipmentList',
|
||||
label: '投标工程清单审核'
|
||||
}
|
||||
];
|
||||
|
||||
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 initFormData = {
|
||||
id: undefined,
|
||||
fileName: undefined,
|
||||
fileUrl: undefined,
|
||||
status: undefined,
|
||||
originalName: undefined
|
||||
};
|
||||
const data = reactive({
|
||||
form: { ...initFormData },
|
||||
tableData: [],
|
||||
rules: {}
|
||||
});
|
||||
|
||||
const handleClose = () => {
|
||||
dialogVisible.visible = false;
|
||||
flowCode.value = '';
|
||||
buttonLoading.value = false;
|
||||
};
|
||||
const { form, rules, tableData } = toRefs(data);
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
leaveFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 获取详情 */
|
||||
const getInfo = () => {
|
||||
loading.value = true;
|
||||
buttonLoading.value = false;
|
||||
nextTick(async () => {
|
||||
const res = await detailsMaterialAndEquipmentApproval(routeParams.value.id);
|
||||
console.log('res.data', res.data);
|
||||
|
||||
Object.assign(form.value, res.data);
|
||||
console.log('form', form.value);
|
||||
|
||||
tableData.value = res.data.auditData;
|
||||
loading.value = false;
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = (status1: string) => {
|
||||
status.value = status1;
|
||||
submit(status.value, form.value);
|
||||
};
|
||||
|
||||
const submitFlow = async () => {
|
||||
handleStartWorkFlow(form.value);
|
||||
dialogVisible.visible = false;
|
||||
};
|
||||
//提交申请
|
||||
const handleStartWorkFlow = async (data: LeaveForm) => {
|
||||
try {
|
||||
submitFormData.value.flowCode = flowCode.value;
|
||||
submitFormData.value.businessId = data.versions;
|
||||
//流程变量
|
||||
taskVariables.value = {
|
||||
// leave4/5 使用的流程变量
|
||||
userList: ['1', '3', '4']
|
||||
};
|
||||
submitFormData.value.variables = taskVariables.value;
|
||||
const resp = await startWorkFlow(submitFormData.value);
|
||||
if (submitVerifyRef.value) {
|
||||
buttonLoading.value = false;
|
||||
submitVerifyRef.value.openDialog(resp.data.taskId);
|
||||
}
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
};
|
||||
//审批记录
|
||||
const handleApprovalRecord = () => {
|
||||
approvalRecordRef.value.init(form.value.versions);
|
||||
};
|
||||
//提交回调
|
||||
const submitCallback = async () => {
|
||||
await proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
};
|
||||
//审批
|
||||
const approvalVerifyOpen = async () => {
|
||||
submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
||||
};
|
||||
// 图纸上传成功之后 开始提交
|
||||
const submit = async (status, data) => {
|
||||
form.value = data;
|
||||
if (status === 'draft') {
|
||||
buttonLoading.value = false;
|
||||
proxy?.$modal.msgSuccess('暂存成功');
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
} else {
|
||||
if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||
flowCode.value = flowCodeOptions[0].value;
|
||||
dialogVisible.visible = true;
|
||||
return;
|
||||
}
|
||||
//说明启动过先随意穿个参数
|
||||
if (flowCode.value === '' || flowCode.value === null) {
|
||||
flowCode.value = 'xx';
|
||||
}
|
||||
await handleStartWorkFlow(data);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(async () => {
|
||||
routeParams.value = proxy.$route.query;
|
||||
reset();
|
||||
loading.value = false;
|
||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||
getInfo();
|
||||
console.log('routeParams.value', routeParams.value);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
/* 全局样式 */
|
||||
:root {
|
||||
--primary: #409eff;
|
||||
--primary-light: #66b1ff;
|
||||
--primary-dark: #3a8ee6;
|
||||
--success: #67c23a;
|
||||
--warning: #e6a23c;
|
||||
--danger: #f56c6c;
|
||||
--info: #909399;
|
||||
}
|
||||
|
||||
/* 表单样式优化 */
|
||||
.el-form-item {
|
||||
.el-form-item__label {
|
||||
color: #606266;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.el-input__inner,
|
||||
.el-select .el-input__inner {
|
||||
border-radius: 4px;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
|
||||
&:focus {
|
||||
border-color: var(--primary-light);
|
||||
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.el-textarea__inner {
|
||||
border-radius: 4px;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
|
||||
&:focus {
|
||||
border-color: var(--primary-light);
|
||||
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 按钮样式优化 */
|
||||
.el-button {
|
||||
border-radius: 4px;
|
||||
transition: all 0.2s;
|
||||
|
||||
&.is-primary {
|
||||
background-color: var(--primary);
|
||||
border-color: var(--primary);
|
||||
|
||||
&:hover {
|
||||
background-color: var(--primary-light);
|
||||
border-color: var(--primary-light);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: var(--primary-dark);
|
||||
border-color: var(--primary-dark);
|
||||
}
|
||||
}
|
||||
|
||||
&.is-text {
|
||||
color: var(--primary);
|
||||
|
||||
&:hover {
|
||||
color: var(--primary-light);
|
||||
background-color: rgba(64, 158, 255, 0.05);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 卡片样式优化 */
|
||||
.el-card {
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
/* transform: translateY(-2px); */
|
||||
}
|
||||
}
|
||||
|
||||
/* 对话框样式优化 */
|
||||
.el-dialog {
|
||||
.el-dialog__header {
|
||||
background-color: #f5f7fa;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
padding: 15px 20px;
|
||||
}
|
||||
|
||||
.el-dialog__title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.el-dialog__footer {
|
||||
padding: 15px 20px;
|
||||
border-top: 1px solid #ebeef5;
|
||||
}
|
||||
}
|
||||
</style>
|
357
src/views/design/billofQuantities/indexEdit1.vue
Normal file
357
src/views/design/billofQuantities/indexEdit1.vue
Normal file
@ -0,0 +1,357 @@
|
||||
<template>
|
||||
<div class="p-4 bg-gray-50">
|
||||
<div class="max-w-4xl mx-auto">
|
||||
<!-- 顶部按钮区域 -->
|
||||
<el-card class="mb-4 rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md">
|
||||
<approvalButton
|
||||
@submitForm="submitForm"
|
||||
@approvalVerifyOpen="approvalVerifyOpen"
|
||||
@handleApprovalRecord="handleApprovalRecord"
|
||||
:buttonLoading="buttonLoading"
|
||||
:id="form.versions"
|
||||
:status="form.status"
|
||||
:pageType="routeParams.type"
|
||||
/>
|
||||
</el-card>
|
||||
<!-- 表单区域 -->
|
||||
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
||||
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
|
||||
<h3 class="text-lg font-semibold text-gray-800">限价工程量清单</h3>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<el-form
|
||||
ref="leaveFormRef"
|
||||
v-loading="loading"
|
||||
:disabled="routeParams.type === 'view' || form.status == 'waiting'"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
class="space-y-4"
|
||||
>
|
||||
<div class="grid grid-cols-1 gap-4">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="版本号" prop="formNo">
|
||||
<el-input disabled v-model="form.versions" placeholder="请输入文件名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-table :data="tableData" style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)" row-key="id" border>
|
||||
<el-table-column prop="num" label="编号" />
|
||||
<el-table-column prop="name" label="名称" />
|
||||
<el-table-column prop="specification" label="规格" />
|
||||
<el-table-column prop="unit" label="单位" />
|
||||
<el-table-column prop="quantity" label="数量" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 提交组件 -->
|
||||
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||
<approvalRecord ref="approvalRecordRef"></approvalRecord>
|
||||
<!-- 流程选择对话框 -->
|
||||
<el-dialog
|
||||
draggable
|
||||
v-model="dialogVisible.visible"
|
||||
:title="dialogVisible.title"
|
||||
:before-close="handleClose"
|
||||
width="500"
|
||||
class="rounded-lg shadow-lg"
|
||||
>
|
||||
<div class="p-4">
|
||||
<p class="text-gray-600 mb-4">请选择要启动的流程:</p>
|
||||
<el-select v-model="flowCode" placeholder="请选择流程" style="width: 100%">
|
||||
<el-option v-for="item in flowCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer p-4 border-t border-gray-100 flex justify-end space-x-3">
|
||||
<el-button @click="handleClose" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors"
|
||||
>取消</el-button
|
||||
>
|
||||
<el-button type="primary" @click="submitFlow()" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors"
|
||||
>确认</el-button
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Leave" lang="ts">
|
||||
import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types';
|
||||
import { startWorkFlow } from '@/api/workflow/task';
|
||||
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
||||
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||
import ApprovalButton from '@/components/Process/approvalButton.vue';
|
||||
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
const { design_change_reason_type } = toRefs<any>(proxy?.useDict('design_change_reason_type'));
|
||||
import { detailsMaterialAndEquipmentApproval } from '@/api/design/billofQuantities/index';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
//路由参数
|
||||
const routeParams = ref<Record<string, any>>({});
|
||||
const flowCode = ref<string>('');
|
||||
const status = ref<string>('');
|
||||
const dialogVisible = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: '流程定义'
|
||||
});
|
||||
//提交组件
|
||||
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||
//审批记录组件
|
||||
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||
//按钮组件
|
||||
const flowCodeOptions = [
|
||||
{
|
||||
value: currentProject.value?.id + '_priceEquipmentList',
|
||||
label: '限价工程量清单'
|
||||
}
|
||||
];
|
||||
|
||||
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 initFormData = {
|
||||
id: undefined,
|
||||
fileName: undefined,
|
||||
fileUrl: undefined,
|
||||
status: undefined,
|
||||
originalName: undefined
|
||||
};
|
||||
const data = reactive({
|
||||
form: { ...initFormData },
|
||||
tableData: [],
|
||||
rules: {}
|
||||
});
|
||||
|
||||
const handleClose = () => {
|
||||
dialogVisible.visible = false;
|
||||
flowCode.value = '';
|
||||
buttonLoading.value = false;
|
||||
};
|
||||
const { form, rules, tableData } = toRefs(data);
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
leaveFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 获取详情 */
|
||||
const getInfo = () => {
|
||||
loading.value = true;
|
||||
buttonLoading.value = false;
|
||||
nextTick(async () => {
|
||||
const res = await detailsMaterialAndEquipmentApproval(routeParams.value.id);
|
||||
console.log('res.data', res.data);
|
||||
|
||||
Object.assign(form.value, res.data);
|
||||
console.log('form', form.value);
|
||||
|
||||
tableData.value = res.data.auditData;
|
||||
loading.value = false;
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = (status1: string) => {
|
||||
status.value = status1;
|
||||
submit(status.value, form.value);
|
||||
};
|
||||
|
||||
const submitFlow = async () => {
|
||||
handleStartWorkFlow(form.value);
|
||||
dialogVisible.visible = false;
|
||||
};
|
||||
//提交申请
|
||||
const handleStartWorkFlow = async (data: LeaveForm) => {
|
||||
try {
|
||||
submitFormData.value.flowCode = flowCode.value;
|
||||
submitFormData.value.businessId = data.versions;
|
||||
//流程变量
|
||||
taskVariables.value = {
|
||||
// leave4/5 使用的流程变量
|
||||
userList: ['1', '3', '4']
|
||||
};
|
||||
submitFormData.value.variables = taskVariables.value;
|
||||
const resp = await startWorkFlow(submitFormData.value);
|
||||
if (submitVerifyRef.value) {
|
||||
buttonLoading.value = false;
|
||||
submitVerifyRef.value.openDialog(resp.data.taskId);
|
||||
}
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
};
|
||||
//审批记录
|
||||
const handleApprovalRecord = () => {
|
||||
approvalRecordRef.value.init(form.value.versions);
|
||||
};
|
||||
//提交回调
|
||||
const submitCallback = async () => {
|
||||
await proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
};
|
||||
//审批
|
||||
const approvalVerifyOpen = async () => {
|
||||
submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
||||
};
|
||||
// 图纸上传成功之后 开始提交
|
||||
const submit = async (status, data) => {
|
||||
form.value = data;
|
||||
if (status === 'draft') {
|
||||
buttonLoading.value = false;
|
||||
proxy?.$modal.msgSuccess('暂存成功');
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
} else {
|
||||
if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||
flowCode.value = flowCodeOptions[0].value;
|
||||
dialogVisible.visible = true;
|
||||
return;
|
||||
}
|
||||
//说明启动过先随意穿个参数
|
||||
if (flowCode.value === '' || flowCode.value === null) {
|
||||
flowCode.value = 'xx';
|
||||
}
|
||||
await handleStartWorkFlow(data);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(async () => {
|
||||
routeParams.value = proxy.$route.query;
|
||||
reset();
|
||||
loading.value = false;
|
||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||
getInfo();
|
||||
console.log('routeParams.value', routeParams.value);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
/* 全局样式 */
|
||||
:root {
|
||||
--primary: #409eff;
|
||||
--primary-light: #66b1ff;
|
||||
--primary-dark: #3a8ee6;
|
||||
--success: #67c23a;
|
||||
--warning: #e6a23c;
|
||||
--danger: #f56c6c;
|
||||
--info: #909399;
|
||||
}
|
||||
|
||||
/* 表单样式优化 */
|
||||
.el-form-item {
|
||||
.el-form-item__label {
|
||||
color: #606266;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.el-input__inner,
|
||||
.el-select .el-input__inner {
|
||||
border-radius: 4px;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
|
||||
&:focus {
|
||||
border-color: var(--primary-light);
|
||||
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.el-textarea__inner {
|
||||
border-radius: 4px;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
|
||||
&:focus {
|
||||
border-color: var(--primary-light);
|
||||
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 按钮样式优化 */
|
||||
.el-button {
|
||||
border-radius: 4px;
|
||||
transition: all 0.2s;
|
||||
|
||||
&.is-primary {
|
||||
background-color: var(--primary);
|
||||
border-color: var(--primary);
|
||||
|
||||
&:hover {
|
||||
background-color: var(--primary-light);
|
||||
border-color: var(--primary-light);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: var(--primary-dark);
|
||||
border-color: var(--primary-dark);
|
||||
}
|
||||
}
|
||||
|
||||
&.is-text {
|
||||
color: var(--primary);
|
||||
|
||||
&:hover {
|
||||
color: var(--primary-light);
|
||||
background-color: rgba(64, 158, 255, 0.05);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 卡片样式优化 */
|
||||
.el-card {
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
/* transform: translateY(-2px); */
|
||||
}
|
||||
}
|
||||
|
||||
/* 对话框样式优化 */
|
||||
.el-dialog {
|
||||
.el-dialog__header {
|
||||
background-color: #f5f7fa;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
padding: 15px 20px;
|
||||
}
|
||||
|
||||
.el-dialog__title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.el-dialog__footer {
|
||||
padding: 15px 20px;
|
||||
border-top: 1px solid #ebeef5;
|
||||
}
|
||||
}
|
||||
</style>
|
357
src/views/design/billofQuantities/indexEdit2.vue
Normal file
357
src/views/design/billofQuantities/indexEdit2.vue
Normal file
@ -0,0 +1,357 @@
|
||||
<template>
|
||||
<div class="p-4 bg-gray-50">
|
||||
<div class="max-w-4xl mx-auto">
|
||||
<!-- 顶部按钮区域 -->
|
||||
<el-card class="mb-4 rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md">
|
||||
<approvalButton
|
||||
@submitForm="submitForm"
|
||||
@approvalVerifyOpen="approvalVerifyOpen"
|
||||
@handleApprovalRecord="handleApprovalRecord"
|
||||
:buttonLoading="buttonLoading"
|
||||
:id="form.versions"
|
||||
:status="form.status"
|
||||
:pageType="routeParams.type"
|
||||
/>
|
||||
</el-card>
|
||||
<!-- 表单区域 -->
|
||||
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
||||
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
|
||||
<h3 class="text-lg font-semibold text-gray-800">招采工程量清单</h3>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<el-form
|
||||
ref="leaveFormRef"
|
||||
v-loading="loading"
|
||||
:disabled="routeParams.type === 'view' || form.status == 'waiting'"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
class="space-y-4"
|
||||
>
|
||||
<div class="grid grid-cols-1 gap-4">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="版本号" prop="formNo">
|
||||
<el-input disabled v-model="form.versions" placeholder="请输入文件名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-table :data="tableData" style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)" row-key="id" border>
|
||||
<el-table-column prop="num" label="编号" />
|
||||
<el-table-column prop="name" label="名称" />
|
||||
<el-table-column prop="specification" label="规格" />
|
||||
<el-table-column prop="unit" label="单位" />
|
||||
<el-table-column prop="quantity" label="数量" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 提交组件 -->
|
||||
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||
<approvalRecord ref="approvalRecordRef"></approvalRecord>
|
||||
<!-- 流程选择对话框 -->
|
||||
<el-dialog
|
||||
draggable
|
||||
v-model="dialogVisible.visible"
|
||||
:title="dialogVisible.title"
|
||||
:before-close="handleClose"
|
||||
width="500"
|
||||
class="rounded-lg shadow-lg"
|
||||
>
|
||||
<div class="p-4">
|
||||
<p class="text-gray-600 mb-4">请选择要启动的流程:</p>
|
||||
<el-select v-model="flowCode" placeholder="请选择流程" style="width: 100%">
|
||||
<el-option v-for="item in flowCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer p-4 border-t border-gray-100 flex justify-end space-x-3">
|
||||
<el-button @click="handleClose" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors"
|
||||
>取消</el-button
|
||||
>
|
||||
<el-button type="primary" @click="submitFlow()" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors"
|
||||
>确认</el-button
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Leave" lang="ts">
|
||||
import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types';
|
||||
import { startWorkFlow } from '@/api/workflow/task';
|
||||
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
||||
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||
import ApprovalButton from '@/components/Process/approvalButton.vue';
|
||||
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
const { design_change_reason_type } = toRefs<any>(proxy?.useDict('design_change_reason_type'));
|
||||
import { detailsMaterialAndEquipmentApproval } from '@/api/design/billofQuantities/index';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
//路由参数
|
||||
const routeParams = ref<Record<string, any>>({});
|
||||
const flowCode = ref<string>('');
|
||||
const status = ref<string>('');
|
||||
const dialogVisible = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: '流程定义'
|
||||
});
|
||||
//提交组件
|
||||
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||
//审批记录组件
|
||||
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||
//按钮组件
|
||||
const flowCodeOptions = [
|
||||
{
|
||||
value: currentProject.value?.id + '_pickEquipmentList',
|
||||
label: '招采工程量清单审核'
|
||||
}
|
||||
];
|
||||
|
||||
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 initFormData = {
|
||||
id: undefined,
|
||||
fileName: undefined,
|
||||
fileUrl: undefined,
|
||||
status: undefined,
|
||||
originalName: undefined
|
||||
};
|
||||
const data = reactive({
|
||||
form: { ...initFormData },
|
||||
tableData: [],
|
||||
rules: {}
|
||||
});
|
||||
|
||||
const handleClose = () => {
|
||||
dialogVisible.visible = false;
|
||||
flowCode.value = '';
|
||||
buttonLoading.value = false;
|
||||
};
|
||||
const { form, rules, tableData } = toRefs(data);
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
leaveFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 获取详情 */
|
||||
const getInfo = () => {
|
||||
loading.value = true;
|
||||
buttonLoading.value = false;
|
||||
nextTick(async () => {
|
||||
const res = await detailsMaterialAndEquipmentApproval(routeParams.value.id);
|
||||
console.log('res.data', res.data);
|
||||
|
||||
Object.assign(form.value, res.data);
|
||||
console.log('form', form.value);
|
||||
|
||||
tableData.value = res.data.auditData;
|
||||
loading.value = false;
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = (status1: string) => {
|
||||
status.value = status1;
|
||||
submit(status.value, form.value);
|
||||
};
|
||||
|
||||
const submitFlow = async () => {
|
||||
handleStartWorkFlow(form.value);
|
||||
dialogVisible.visible = false;
|
||||
};
|
||||
//提交申请
|
||||
const handleStartWorkFlow = async (data: LeaveForm) => {
|
||||
try {
|
||||
submitFormData.value.flowCode = flowCode.value;
|
||||
submitFormData.value.businessId = data.versions;
|
||||
//流程变量
|
||||
taskVariables.value = {
|
||||
// leave4/5 使用的流程变量
|
||||
userList: ['1', '3', '4']
|
||||
};
|
||||
submitFormData.value.variables = taskVariables.value;
|
||||
const resp = await startWorkFlow(submitFormData.value);
|
||||
if (submitVerifyRef.value) {
|
||||
buttonLoading.value = false;
|
||||
submitVerifyRef.value.openDialog(resp.data.taskId);
|
||||
}
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
};
|
||||
//审批记录
|
||||
const handleApprovalRecord = () => {
|
||||
approvalRecordRef.value.init(form.value.versions);
|
||||
};
|
||||
//提交回调
|
||||
const submitCallback = async () => {
|
||||
await proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
};
|
||||
//审批
|
||||
const approvalVerifyOpen = async () => {
|
||||
submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
||||
};
|
||||
// 图纸上传成功之后 开始提交
|
||||
const submit = async (status, data) => {
|
||||
form.value = data;
|
||||
if (status === 'draft') {
|
||||
buttonLoading.value = false;
|
||||
proxy?.$modal.msgSuccess('暂存成功');
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
} else {
|
||||
if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||
flowCode.value = flowCodeOptions[0].value;
|
||||
dialogVisible.visible = true;
|
||||
return;
|
||||
}
|
||||
//说明启动过先随意穿个参数
|
||||
if (flowCode.value === '' || flowCode.value === null) {
|
||||
flowCode.value = 'xx';
|
||||
}
|
||||
await handleStartWorkFlow(data);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(async () => {
|
||||
routeParams.value = proxy.$route.query;
|
||||
reset();
|
||||
loading.value = false;
|
||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||
getInfo();
|
||||
console.log('routeParams.value', routeParams.value);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
/* 全局样式 */
|
||||
:root {
|
||||
--primary: #409eff;
|
||||
--primary-light: #66b1ff;
|
||||
--primary-dark: #3a8ee6;
|
||||
--success: #67c23a;
|
||||
--warning: #e6a23c;
|
||||
--danger: #f56c6c;
|
||||
--info: #909399;
|
||||
}
|
||||
|
||||
/* 表单样式优化 */
|
||||
.el-form-item {
|
||||
.el-form-item__label {
|
||||
color: #606266;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.el-input__inner,
|
||||
.el-select .el-input__inner {
|
||||
border-radius: 4px;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
|
||||
&:focus {
|
||||
border-color: var(--primary-light);
|
||||
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.el-textarea__inner {
|
||||
border-radius: 4px;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
|
||||
&:focus {
|
||||
border-color: var(--primary-light);
|
||||
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 按钮样式优化 */
|
||||
.el-button {
|
||||
border-radius: 4px;
|
||||
transition: all 0.2s;
|
||||
|
||||
&.is-primary {
|
||||
background-color: var(--primary);
|
||||
border-color: var(--primary);
|
||||
|
||||
&:hover {
|
||||
background-color: var(--primary-light);
|
||||
border-color: var(--primary-light);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: var(--primary-dark);
|
||||
border-color: var(--primary-dark);
|
||||
}
|
||||
}
|
||||
|
||||
&.is-text {
|
||||
color: var(--primary);
|
||||
|
||||
&:hover {
|
||||
color: var(--primary-light);
|
||||
background-color: rgba(64, 158, 255, 0.05);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 卡片样式优化 */
|
||||
.el-card {
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
/* transform: translateY(-2px); */
|
||||
}
|
||||
}
|
||||
|
||||
/* 对话框样式优化 */
|
||||
.el-dialog {
|
||||
.el-dialog__header {
|
||||
background-color: #f5f7fa;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
padding: 15px 20px;
|
||||
}
|
||||
|
||||
.el-dialog__title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.el-dialog__footer {
|
||||
padding: 15px 20px;
|
||||
border-top: 1px solid #ebeef5;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -114,7 +114,7 @@ const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||
const flowCodeOptions = [
|
||||
{
|
||||
value: currentProject.value?.id + '_equipmentList',
|
||||
label: '工程量清单审核'
|
||||
label: '物资设备清单审核'
|
||||
}
|
||||
];
|
||||
|
@ -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-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="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-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,77 +1,78 @@
|
||||
<template>
|
||||
<div class="p-2 volumeCatalog">
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="卷册号" prop="volumeNumber">
|
||||
<el-input v-model="queryParams.volumeNumber" placeholder="请输入卷册号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="资料名称" prop="documentName">
|
||||
<el-input v-model="queryParams.documentName" placeholder="请输入资料名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery" v-hasPermi="['design:volumeCatalog:query']">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery" v-hasPermi="['design:volumeCatalog:query']">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</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="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">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
:key="scope.row.fileId"
|
||||
:href="scope.row.fileUrl"
|
||||
target="_blank"
|
||||
:type="scope.row.status == '1' ? 'primary' : 'info'"
|
||||
:underline="false"
|
||||
@click="handleBookFile(scope.row)"
|
||||
>
|
||||
{{ scope.row.fileName }}
|
||||
</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">
|
||||
<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>
|
||||
<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>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog draggable title="文件列表" v-model="viewVisible1" width="500px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="boxs">
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="卷册号" prop="volumeNumber">
|
||||
<el-input v-model="queryParams.volumeNumber" placeholder="请输入卷册号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="资料名称" prop="documentName">
|
||||
<el-input v-model="queryParams.documentName" placeholder="请输入资料名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery" v-hasPermi="['design:volumeCatalog:query']">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery" v-hasPermi="['design:volumeCatalog:query']">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</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="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="primary"
|
||||
:underline="false"
|
||||
@click="handleBookFile(scope.row)"
|
||||
>
|
||||
{{ scope.row.fileName }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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>
|
||||
<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,21 +270,16 @@ const setFormData = (data: Partial<FormData>) => {
|
||||
};
|
||||
|
||||
// 提交表单
|
||||
const submit = async (businessId) => {
|
||||
try {
|
||||
// 先验证表单
|
||||
const isValid = await validate();
|
||||
if (isValid) {
|
||||
formData.subprojectName = subProjectMap.get(formData.subprojectId);
|
||||
formData.drawingreviewId = businessId;
|
||||
const res = await drawingreviewReceipts(formData);
|
||||
if (res.code === 200) {
|
||||
// // 提交成功处理逻辑
|
||||
// console.log('提交成功');
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('提交失败:', error);
|
||||
const submit = async (businessId, cb) => {
|
||||
// 先验证表单
|
||||
await formRef.value?.validate();
|
||||
cb();
|
||||
formData.subprojectName = subProjectMap.get(formData.subprojectId);
|
||||
formData.drawingreviewId = businessId;
|
||||
const res = await drawingreviewReceipts(formData);
|
||||
if (res.code === 200) {
|
||||
// // 提交成功处理逻辑
|
||||
// console.log('提交成功');
|
||||
}
|
||||
};
|
||||
onMounted(() => {
|
||||
|
@ -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">
|
||||
@ -178,7 +183,7 @@
|
||||
:prop="`itemList.${index}.acceptedQuantity`"
|
||||
:rules="{ required: true, message: '验收数量不能为空', trigger: 'blur' }"
|
||||
>
|
||||
<el-input type="number" v-model="item.acceptedQuantity" placeholder="请输入验收" />
|
||||
<el-input type="number" v-model="item.acceptedQuantity" 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
|
||||
|
@ -1,27 +1,14 @@
|
||||
<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>
|
||||
@ -31,6 +18,7 @@
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<!-- 任务列表卡片 -->
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
@ -52,10 +40,9 @@
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="masterList" @selection-change="handleSelectionChange">
|
||||
<!-- 任务列表表格 -->
|
||||
<el-table v-loading="loading" :data="masterList" @selection-change="handleSelectionChange" border>
|
||||
<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">
|
||||
@ -68,8 +55,25 @@
|
||||
<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 prop="completionProgress" label="完成进度" align="center">
|
||||
<template #default="scope">
|
||||
<el-button type="text" @click="showProgressDetail(scope.row.id)" class="text-primary">
|
||||
{{ scope.row.completionProgress || '未设置' }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务状态" align="center" prop="taskStatus">
|
||||
<template #default="scope">
|
||||
<span
|
||||
:class="[Number(scope.row.taskStatus) === 0 ? 'text-warning' : Number(scope.row.taskStatus) === 1 ? 'text-success' : 'text-danger']"
|
||||
>
|
||||
{{
|
||||
Number(scope.row.taskStatus) === 0 ? '未完成' : Number(scope.row.taskStatus) === 1 ? '已完成' : `未知状态(${scope.row.taskStatus})`
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
@ -83,33 +87,103 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 进度详情弹窗 -->
|
||||
<el-dialog :title="`进度详情(当前总进度:${currentTotalProgress}%)`" v-model="progressDialogVisible" width="1000px" destroy-on-close>
|
||||
<div class="mb-4">
|
||||
<el-button type="primary" plain icon="Plus" size="small" @click="handleProgressAdd()" v-hasPermi="['patch:progress:add']">
|
||||
新增进度
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table v-loading="progressLoading" :data="progressList" border empty-text="暂无进度数据" style="width: 100%">
|
||||
<el-table-column prop="slaveName" label="执行人姓名" align="center" width="150" />
|
||||
<el-table-column prop="progress" label="进度" align="center" width="120" />
|
||||
<el-table-column prop="remark" label="备注" align="center" />
|
||||
<el-table-column prop="updateTime" label="更新时间" align="center" width="200">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="140">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改进度" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
size="small"
|
||||
@click="handleProgressUpdate(scope.row)"
|
||||
v-hasPermi="['patch:progress:edit']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除进度" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Delete"
|
||||
size="small"
|
||||
@click="handleProgressDelete(scope.row)"
|
||||
v-hasPermi="['patch:progress:remove']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 新增/修改进度弹窗 -->
|
||||
<el-dialog :title="progressDialog.title" v-model="progressDialog.visible" width="500px" append-to-body destroy-on-close>
|
||||
<el-form ref="progressFormRef" :model="progressForm" :rules="progressRules" label-width="120px">
|
||||
<el-input v-model="progressForm.ordersId" placeholder="关联的任务ID" readonly style="color: #666; background: #f5f7fa" type="hidden" />
|
||||
<el-input v-model="progressForm.projectId" type="hidden" />
|
||||
<!-- 修改执行人姓名选择框 -->
|
||||
<el-form-item label="执行人姓名" prop="slaveName">
|
||||
<el-select v-model="progressForm.slaveName" placeholder="请选择执行人姓名" clearable style="width: 100%" @change="handleSlaveChange">
|
||||
<el-option v-for="item in slaveOptions" :key="item.id" :label="item.name" :value="item.name" :data-id="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-input v-model="progressForm.slaveId" placeholder="请输入执行人ID" v-if="false" />
|
||||
|
||||
<el-form-item label="进度" prop="progress">
|
||||
<el-input v-model="progressForm.progress" placeholder="请输入进度(0-100之间的数字)" type="number" @input="handleProgressInput" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="progressForm.remark" type="textarea" placeholder="请输入备注" rows="3" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="progressBtnLoading" type="primary" @click="submitProgressForm">确 定</el-button>
|
||||
<el-button @click="cancelProgressForm">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<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-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body destroy-on-close>
|
||||
<el-form ref="masterFormRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-input v-model="form.projectId" placeholder="请输入项目ID" :readonly="!!currentProjectId" :disabled="!!currentProjectId" v-if="false" />
|
||||
<template #help>
|
||||
<span v-if="currentProjectId" class="text-success">已自动关联当前选中项目</span>
|
||||
</template>
|
||||
<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-date-picker clearable v-model="form.pcd" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择计划完成时间" />
|
||||
</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-date-picker clearable v-model="form.act" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择实际完成时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="完成进度" prop="completionProgress">
|
||||
<el-input v-model="form.completionProgress" placeholder="请输入完成进度" />
|
||||
<el-form-item label="任务描述" prop="describe">
|
||||
<el-input v-model="form.describe" type="textarea" placeholder="请输入任务描述" rows="3" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" rows="3" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
@ -123,11 +197,123 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Master" lang="ts">
|
||||
import { listMaster, getMaster, delMaster, addMaster, updateMaster } from '@/api/patch';
|
||||
// 1. 导入接口
|
||||
import {
|
||||
listMaster,
|
||||
getMaster,
|
||||
delMaster,
|
||||
addMaster,
|
||||
updateMaster,
|
||||
getProgressDetail,
|
||||
addProgress,
|
||||
editProgress,
|
||||
deleteProgress,
|
||||
getUserName
|
||||
} from '@/api/patch';
|
||||
import { MasterVO, MasterQuery, MasterForm } from '@/api/patch/types';
|
||||
|
||||
// 2. 导入Vue核心依赖
|
||||
import { getCurrentInstance, ComponentInternalInstance, onMounted, ref, reactive, toRefs, nextTick, computed, watch } from 'vue';
|
||||
import type { ElFormInstance } from 'element-plus';
|
||||
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
// 获取用户 store
|
||||
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取当前选中的项目ID
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const currentProjectId = computed(() => currentProject.value?.id);
|
||||
// 1. 调整类型定义,匹配接口返回的字段
|
||||
const slaveOptions = ref<Array<{ id: number; name: string }>>([]);
|
||||
// 在脚本中添加选择变化的处理函数
|
||||
const handleSlaveChange = (name) => {
|
||||
// 找到选中的用户对象
|
||||
const selectedUser = slaveOptions.value.find((item) => item.name === name);
|
||||
if (selectedUser) {
|
||||
// 自动填充userId到slaveId
|
||||
progressForm.slaveId = selectedUser.id;
|
||||
} else {
|
||||
// 未选中时清空ID
|
||||
progressForm.slaveId = '';
|
||||
}
|
||||
};
|
||||
|
||||
async function initSlaveOptions() {
|
||||
try {
|
||||
const response = await getUserName();
|
||||
// 确保获取到正确的数组数据(接口返回在data字段中)
|
||||
const userDataList = Array.isArray(response?.data) ? response.data : [];
|
||||
|
||||
// 转换数据结构,只提取需要的字段(userId作为id,nickName作为name)
|
||||
slaveOptions.value = userDataList
|
||||
.filter((item) => item?.userId && item?.nickName) // 过滤有效数据
|
||||
.map((item) => ({
|
||||
id: item.userId, // 使用userId作为选项的id
|
||||
name: item.nickName // 使用nickName作为显示名称
|
||||
}));
|
||||
|
||||
console.log('slaveOptions 已更新:', slaveOptions.value);
|
||||
} catch (error) {
|
||||
console.error('获取用户数据失败:', error);
|
||||
slaveOptions.value = []; // 错误时重置为空数组
|
||||
}
|
||||
}
|
||||
initSlaveOptions();
|
||||
// 3. 类型声明
|
||||
interface DialogOption {
|
||||
visible: boolean;
|
||||
title: string;
|
||||
}
|
||||
interface PageData<F, Q> {
|
||||
form: F;
|
||||
queryParams: Q;
|
||||
rules: Record<string, any[]>;
|
||||
}
|
||||
interface ProgressDetail {
|
||||
id?: string | number;
|
||||
ordersId: string | number;
|
||||
slaveId: string | number;
|
||||
slaveName: string;
|
||||
progress: string;
|
||||
remark?: string;
|
||||
updateTime?: string;
|
||||
projectId?: string | number;
|
||||
}
|
||||
interface ProgressForm extends Omit<ProgressDetail, 'updateTime'> {}
|
||||
|
||||
// 4. 获取组件实例
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
// 5. 环境变量获取
|
||||
const isDev = import.meta.env.MODE === 'development';
|
||||
|
||||
// 6. 状态管理
|
||||
const progressDialogVisible = ref(false);
|
||||
const progressList = ref<ProgressDetail[]>([]);
|
||||
const progressLoading = ref(false);
|
||||
const currentMasterId = ref<string | number>('');
|
||||
const currentTotalProgress = ref<number>(0); // 当前任务的所有执行人进度总和
|
||||
|
||||
const progressDialog = reactive<DialogOption>({ visible: false, title: '' });
|
||||
const progressFormRef = ref<ElFormInstance>();
|
||||
const progressForm = reactive<ProgressForm>({
|
||||
projectId: currentProjectId.value,
|
||||
id: undefined,
|
||||
ordersId: '',
|
||||
slaveId: '',
|
||||
slaveName: '',
|
||||
progress: '',
|
||||
remark: ''
|
||||
});
|
||||
const progressBtnLoading = ref(false);
|
||||
|
||||
const progressRules = reactive<Record<string, any[]>>({
|
||||
ordersId: [{ required: true, message: '关联任务ID不能为空', trigger: 'blur' }],
|
||||
slaveId: [{ required: true, message: '请输入执行人ID', trigger: 'blur' }],
|
||||
slaveName: [{ required: true, message: '请输入执行人姓名', trigger: 'blur' }],
|
||||
progress: [{ required: true, message: '请输入进度', trigger: 'blur' }]
|
||||
});
|
||||
|
||||
const masterList = ref<MasterVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
@ -139,15 +325,11 @@ const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const masterFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
const dialog = reactive<DialogOption>({ visible: false, title: '' });
|
||||
|
||||
const initFormData: MasterForm = {
|
||||
id: undefined,
|
||||
projectId: undefined,
|
||||
projectId: currentProjectId.value,
|
||||
taskName: undefined,
|
||||
describe: undefined,
|
||||
pcd: undefined,
|
||||
@ -156,12 +338,13 @@ const initFormData: MasterForm = {
|
||||
taskStatus: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
|
||||
const data = reactive<PageData<MasterForm, MasterQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: undefined,
|
||||
projectId: currentProjectId.value, // 默认查询当前项目的任务
|
||||
taskName: undefined,
|
||||
describe: undefined,
|
||||
pcd: undefined,
|
||||
@ -171,107 +354,332 @@ const data = reactive<PageData<MasterForm, MasterQuery>>({
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }]
|
||||
projectId: [{ required: true, message: '请输入项目ID', trigger: 'blur' }],
|
||||
taskName: [{ required: true, message: '请输入任务名称', trigger: 'blur' }],
|
||||
completionProgress: [{ required: true, message: '请输入完成进度', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询派单列表 */
|
||||
// 监听当前项目ID变化,自动更新相关数据
|
||||
watch(currentProjectId, (newVal) => {
|
||||
// 更新查询参数中的项目ID
|
||||
queryParams.value.projectId = newVal;
|
||||
|
||||
// 更新表单中的项目ID(如果是新增状态)
|
||||
if (!form.value.id) {
|
||||
form.value.projectId = newVal;
|
||||
}
|
||||
|
||||
// 更新进度表单中的项目ID
|
||||
progressForm.projectId = newVal;
|
||||
|
||||
// 重新加载任务列表
|
||||
getList();
|
||||
});
|
||||
|
||||
// 7. 核心方法
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listMaster(queryParams.value);
|
||||
masterList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
try {
|
||||
const res = await listMaster(queryParams.value);
|
||||
masterList.value = res.rows || [];
|
||||
total.value = res.total || 0;
|
||||
} catch (error) {
|
||||
console.error('获取任务列表失败', error);
|
||||
proxy?.$modal.msgError('获取任务列表失败');
|
||||
masterList.value = [];
|
||||
total.value = 0;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const showProgressDetail = async (masterId: string | number) => {
|
||||
if (!masterId || (typeof masterId === 'string' && masterId.trim() === '')) {
|
||||
proxy?.$modal.msgError('无效的任务ID,无法加载进度详情');
|
||||
return;
|
||||
}
|
||||
currentMasterId.value = masterId;
|
||||
|
||||
progressDialogVisible.value = true;
|
||||
progressLoading.value = true;
|
||||
progressList.value = [];
|
||||
currentTotalProgress.value = 0; // 重置总和
|
||||
|
||||
try {
|
||||
const res = await getProgressDetail(masterId);
|
||||
progressList.value = res.data || [];
|
||||
// 计算所有执行人的进度总和
|
||||
currentTotalProgress.value = progressList.value.reduce((total, item) => {
|
||||
const progressNum = Number(item.progress) || 0;
|
||||
return total + progressNum;
|
||||
}, 0);
|
||||
} catch (error) {
|
||||
console.error('获取进度详情失败', error);
|
||||
proxy?.$modal.msgError('获取进度详情失败');
|
||||
} finally {
|
||||
progressLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const resetProgressForm = () => {
|
||||
progressForm.id = undefined;
|
||||
progressForm.slaveId = '';
|
||||
progressForm.slaveName = '';
|
||||
progressForm.progress = '';
|
||||
progressForm.remark = '';
|
||||
progressForm.projectId = currentProjectId.value; // 重置时关联当前项目
|
||||
|
||||
progressFormRef.value?.resetFields();
|
||||
|
||||
nextTick(() => {
|
||||
progressForm.ordersId = currentMasterId.value;
|
||||
});
|
||||
};
|
||||
|
||||
const handleProgressAdd = () => {
|
||||
if (!currentMasterId.value) {
|
||||
proxy?.$modal.msgError('请先从任务列表打开「进度详情」,再新增进度');
|
||||
return;
|
||||
}
|
||||
resetProgressForm();
|
||||
progressDialog.visible = true;
|
||||
progressDialog.title = '新增进度';
|
||||
};
|
||||
|
||||
const handleProgressUpdate = (row: ProgressDetail) => {
|
||||
progressForm.id = row.id;
|
||||
progressForm.ordersId = row.ordersId;
|
||||
progressForm.slaveId = row.slaveId;
|
||||
progressForm.slaveName = row.slaveName;
|
||||
progressForm.progress = row.progress;
|
||||
progressForm.remark = row.remark || '';
|
||||
progressForm.projectId = row.projectId || currentProjectId.value; // 保持项目ID一致
|
||||
progressDialog.visible = true;
|
||||
progressDialog.title = '修改进度';
|
||||
};
|
||||
|
||||
const submitProgressForm = () => {
|
||||
progressFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (!valid) return;
|
||||
|
||||
if (!progressForm.ordersId) {
|
||||
proxy?.$modal.msgError('关联任务ID丢失,请关闭弹窗重新打开进度详情');
|
||||
progressBtnLoading.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// 确保进度总和不超过100
|
||||
const newProgress = Number(progressForm.progress) || 0;
|
||||
let expectedTotal = 0;
|
||||
|
||||
if (progressForm.id) {
|
||||
// 编辑场景:总和 = 当前总和 - 旧进度 + 新进度
|
||||
const oldProgressItem = progressList.value.find((item) => item.id === progressForm.id);
|
||||
const oldProgress = oldProgressItem ? Number(oldProgressItem.progress) || 0 : 0;
|
||||
expectedTotal = currentTotalProgress.value - oldProgress + newProgress;
|
||||
} else {
|
||||
// 新增场景:总和 = 当前总和 + 新进度
|
||||
expectedTotal = currentTotalProgress.value + newProgress;
|
||||
}
|
||||
|
||||
if (expectedTotal > 100) {
|
||||
proxy?.$modal.msgError(`进度总和不能超过100%,当前预计总和为${expectedTotal}%`);
|
||||
progressBtnLoading.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
progressBtnLoading.value = true;
|
||||
try {
|
||||
if (progressForm.id) {
|
||||
await editProgress(progressForm);
|
||||
proxy?.$modal.msgSuccess('修改进度成功');
|
||||
} else {
|
||||
await addProgress(progressForm);
|
||||
proxy?.$modal.msgSuccess('新增进度成功');
|
||||
}
|
||||
progressDialog.visible = false;
|
||||
await showProgressDetail(currentMasterId.value); // 刷新进度列表
|
||||
getList(); // 同步刷新任务列表
|
||||
} catch (error) {
|
||||
console.error(`${progressForm.id ? '修改' : '新增'}进度失败`, error);
|
||||
proxy?.$modal.msgError(`${progressForm.id ? '修改' : '新增'}进度失败`);
|
||||
} finally {
|
||||
progressBtnLoading.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const cancelProgressForm = () => {
|
||||
progressDialog.visible = false;
|
||||
getList();
|
||||
};
|
||||
|
||||
const handleProgressDelete = async (row: ProgressDetail) => {
|
||||
if (!row.id) return;
|
||||
|
||||
try {
|
||||
await proxy?.$modal.confirm(`是否确认删除该进度记录?`);
|
||||
await deleteProgress(row.id);
|
||||
proxy?.$modal.msgSuccess('删除进度成功');
|
||||
await showProgressDetail(currentMasterId.value);
|
||||
getList();
|
||||
} catch (error) {
|
||||
console.error('删除进度失败', error);
|
||||
if (error !== 'cancel') {
|
||||
proxy?.$modal.msgError('删除进度失败');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
form.value = { ...initFormData, projectId: currentProjectId.value };
|
||||
masterFormRef.value?.resetFields();
|
||||
dialog.visible = false;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
form.value = { ...initFormData, projectId: currentProjectId.value };
|
||||
masterFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
// 重置查询时保留当前项目ID
|
||||
queryParams.value.projectId = currentProjectId.value;
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: MasterVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
single.value = selection.length !== 1;
|
||||
multiple.value = selection.length === 0;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
// 新增任务时自动填充当前项目ID
|
||||
form.value.projectId = currentProjectId.value;
|
||||
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 = '修改派单';
|
||||
if (!_id) {
|
||||
proxy?.$modal.msgWarning('请选择需要修改的任务');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const res = await getMaster(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改派单';
|
||||
} catch (error) {
|
||||
console.error('获取任务详情失败', error);
|
||||
proxy?.$modal.msgError('获取任务详情失败');
|
||||
}
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
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));
|
||||
if (!valid) return;
|
||||
buttonLoading.value = true;
|
||||
try {
|
||||
// 确保提交时使用当前项目ID
|
||||
if (!form.value.id && currentProjectId.value) {
|
||||
form.value.projectId = currentProjectId.value;
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
|
||||
if (form.value.id) await updateMaster(form.value);
|
||||
else await addMaster(form.value);
|
||||
proxy?.$modal.msgSuccess(`${form.value.id ? '修改' : '新增'}成功`);
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
} catch (error) {
|
||||
console.error(`${form.value.id ? '修改' : '新增'}任务失败`, error);
|
||||
proxy?.$modal.msgError(`${form.value.id ? '修改' : '新增'}任务失败`);
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
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();
|
||||
if (!_ids || (_ids instanceof Array && _ids.length === 0)) {
|
||||
proxy?.$modal.msgWarning('请选择需要删除的任务');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await proxy?.$modal.confirm(`是否确认删除选中的${row ? '任务' : '任务们'}?`);
|
||||
await delMaster(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
} catch (error) {
|
||||
console.error('删除任务失败', error);
|
||||
if (error !== 'cancel') proxy?.$modal.msgError('删除任务失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const handleProgressInput = () => {
|
||||
let value = progressForm.progress;
|
||||
|
||||
// 清除非数字字符(保留小数点)
|
||||
if (typeof value === 'string') {
|
||||
value = value.replace(/[^\d.]/g, '');
|
||||
// 确保只有一个小数点
|
||||
const dotIndex = value.indexOf('.');
|
||||
if (dotIndex !== -1) {
|
||||
value = value.slice(0, dotIndex + 1) + value.slice(dotIndex + 1).replace(/\./g, '');
|
||||
}
|
||||
}
|
||||
|
||||
// 转换为数字处理
|
||||
let num = Number(value);
|
||||
|
||||
// 限制范围在0-100
|
||||
if (num < 0) num = 0;
|
||||
if (num > 100) num = 100;
|
||||
|
||||
// 处理空值情况
|
||||
if (value === '' || isNaN(num)) {
|
||||
progressForm.progress = '';
|
||||
} else {
|
||||
progressForm.progress = num.toString();
|
||||
}
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'patch/patch/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`master_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
proxy?.download('patch/patch/export', { ...queryParams.value }, `任务列表_${new Date().getTime()}.xlsx`);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.mb-4 {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.el-table .small-padding .cell {
|
||||
padding: 0 5px;
|
||||
}
|
||||
.el-table .fixed-width {
|
||||
width: 120px !important;
|
||||
}
|
||||
.el-table-column .el-button--text + .el-button--text {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
|
@ -212,6 +212,7 @@ type ProgressCategoryOption = {
|
||||
name: string;
|
||||
children?: ProgressCategoryOption[];
|
||||
};
|
||||
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
|
@ -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;
|
||||
|
@ -73,7 +73,16 @@
|
||||
<el-table-column label="限价" align="center" prop="limitPrice" />
|
||||
<el-table-column label="合同额" align="center" prop="contractPrice" />
|
||||
<el-table-column label="分包内容" align="center" prop="content" />
|
||||
<el-table-column label="中标通知书" align="center" prop="bidFile" />
|
||||
<el-table-column label="中标通知书" align="center" prop="bidFile">
|
||||
<template #default="scope">
|
||||
<el-link @click="handleView(scope.row, 'bidFile')" type="primary" v-if="scope.row.bidFile">查看</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="招标通知书" align="center" prop="tenderFile">
|
||||
<template #default="scope">
|
||||
<el-link @click="handleView(scope.row, 'tenderFile')" type="primary" v-if="scope.row.tenderFile">查看</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
@ -135,16 +144,21 @@
|
||||
<el-date-picker clearable v-model="form.plannedBiddingTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择计划招标时间" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="招标方式(公招,邀标)" prop="plannedBiddingMethod">
|
||||
<el-input v-model="form.plannedBiddingMethod" placeholder="请输入招标方式(公招,邀标)" />
|
||||
<!-- 核心修改:招标方式改为下拉框,根据限价自动赋值 -->
|
||||
<el-form-item label="招标方式" prop="plannedBiddingMethod">
|
||||
<el-select v-model="form.plannedBiddingMethod" placeholder="自动生成/选择" :disabled="!!form.limitPrice">
|
||||
<el-option label="公招" value="公招"></el-option>
|
||||
<el-option label="邀标" value="邀标"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="总价" prop="price" v-if="false">
|
||||
<el-input v-model="form.price" placeholder="请输入总价" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 限价输入:添加@input事件,实时触发招标方式判断 -->
|
||||
<el-form-item label="限价" prop="limitPrice">
|
||||
<el-input v-model="form.limitPrice" placeholder="请输入限价" />
|
||||
<el-input v-model.number="form.limitPrice" placeholder="请输入限价" type="number" @input="autoSetBiddingMethod" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="合同额" prop="contractPrice">
|
||||
@ -156,7 +170,10 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="中标通知书" prop="bidFile">
|
||||
<file-upload v-model="form.bidFile" />
|
||||
<file-upload v-model="form.bidFile" :limit="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="招标通知书" prop="files">
|
||||
<file-upload v-model="form.tenderFile" :limit="100" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
@ -166,25 +183,40 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="文件列表" v-model="viewVisible" width="45%">
|
||||
<el-table :data="viewFileList" style="width: 100%" border>
|
||||
<el-table-column prop="fileName" label="文件" align="center">
|
||||
<template #default="scope">
|
||||
<el-link :key="scope.row.ossId" :href="scope.row.url" target="_blank" type="primary" :underline="false">
|
||||
{{ scope.row.originalName || '查看文件' }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button type="primary" @click="viewVisible = false">关闭</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Plan" lang="ts">
|
||||
import { listPlan, getPlan, delPlan, addPlan, updatePlan } from '@/api/plan/plan';
|
||||
import { listPlan, getPlan, addPlan, updatePlan, getSegmentedIndicatorPlanning } from '@/api/plan/plan/index';
|
||||
import { PlanVO, PlanQuery, PlanForm } from '@/api/plan/plan/types';
|
||||
import { getCurrentInstance, onMounted, ref, reactive, toRefs, computed, watch } from 'vue';
|
||||
import type { ElFormInstance } from 'element-plus';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { UploadFilled } from '@element-plus/icons-vue';
|
||||
import type { UploadFile, UploadRawFile } from 'element-plus';
|
||||
// 导入文件上传接口(根据实际项目路径调整)
|
||||
import { uploadFile } from '@/api/plan/file';
|
||||
import { listByIds } from '@/api/system/oss';
|
||||
|
||||
// 从用户Store获取当前选中项目及ID
|
||||
const userStore = useUserStoreHook();
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const currentProjectId = computed(() => currentProject.value?.id);
|
||||
|
||||
const viewVisible = ref(false);
|
||||
// 类型定义
|
||||
interface DialogOption {
|
||||
visible: boolean;
|
||||
@ -222,6 +254,7 @@ const fileUploadDialog = reactive({
|
||||
title: '上传文件'
|
||||
});
|
||||
const fileList = ref<UploadFile[]>([]);
|
||||
const viewFileList = ref([]);
|
||||
const uploadLoading = ref(false);
|
||||
const selectedPlanId = ref<string | number>('');
|
||||
|
||||
@ -229,7 +262,9 @@ const selectedPlanId = ref<string | number>('');
|
||||
const initFormData: PlanForm & { dictName?: string; content?: string } = {
|
||||
id: '1958116259107012609',
|
||||
projectId: currentProjectId.value,
|
||||
file: [],
|
||||
plannedBiddingMethod: undefined,
|
||||
files: undefined,
|
||||
price: undefined,
|
||||
limitPrice: undefined,
|
||||
contractPrice: undefined,
|
||||
@ -260,7 +295,7 @@ const data = reactive<PageData<typeof initFormData, PlanQuery & { dictName?: str
|
||||
rules: {
|
||||
projectId: [{ required: true, message: '请输入项目ID', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
||||
plannedBiddingMethod: [{ required: true, message: '请输入招标方式', trigger: 'blur' }],
|
||||
plannedBiddingMethod: [{ required: true, message: '请选择或输入限价生成招标方式', trigger: 'blur' }],
|
||||
limitPrice: [{ required: true, message: '请输入限价', trigger: 'blur' }],
|
||||
contractPrice: [{ required: true, message: '请输入合同额', trigger: 'blur' }],
|
||||
content: [{ required: true, message: '请输入分包内容', trigger: 'blur' }]
|
||||
@ -293,6 +328,27 @@ const getList = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// const handleSuccess = (list, res, fileType) => {
|
||||
// console.log(list);
|
||||
// const arr = list.map((item) => {
|
||||
// return { fileId: item.ossId, fileUrl: item.url, fileType };
|
||||
// });
|
||||
// console.log(arr);
|
||||
// if (!form.value.file) form.value.file = [];
|
||||
// form.value.file = [...form.value.file, ...arr];
|
||||
// console.log(form.value.file);
|
||||
// };
|
||||
|
||||
const handleView = async (row, type) => {
|
||||
const res = await listByIds(row[type]);
|
||||
if (type == 'tenderFile') {
|
||||
viewVisible.value = true;
|
||||
viewFileList.value = res.data;
|
||||
} else {
|
||||
window.open(res.data[0].url);
|
||||
}
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
@ -334,13 +390,19 @@ const handleUpdate = async (row?: PlanVO) => {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const res = await getPlan(_id);
|
||||
// const res = await getPlan(_id);
|
||||
const res = await getSegmentedIndicatorPlanning(_id);
|
||||
|
||||
Object.assign(form.value, res.data, {
|
||||
id: res.data.id || initFormData.id,
|
||||
dictName: res.data.dictName || initFormData.dictName,
|
||||
content: res.data.content || initFormData.content,
|
||||
projectId: res.data.projectId || currentProjectId.value
|
||||
});
|
||||
console.log(form.value);
|
||||
|
||||
// 回显时根据限价同步招标方式(避免数据不一致)
|
||||
autoSetBiddingMethod();
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改招标计划';
|
||||
} catch (error) {
|
||||
@ -349,6 +411,13 @@ const handleUpdate = async (row?: PlanVO) => {
|
||||
}
|
||||
};
|
||||
|
||||
/** 核心:根据限价自动设置招标方式 */
|
||||
const autoSetBiddingMethod = () => {
|
||||
const limit = form.value.limitPrice;
|
||||
// 逻辑:限价>1000万→公招,否则→邀标,为空则清空
|
||||
form.value.plannedBiddingMethod = limit ? (limit > 1000 ? '公招' : '邀标') : '';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
planFormRef.value?.validate(async (valid: boolean) => {
|
||||
@ -376,7 +445,7 @@ const submitForm = () => {
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
/** 删除按钮操作(原代码存在但模板未引用,保留逻辑) */
|
||||
const handleDelete = async (row?: PlanVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
if (!_ids || (_ids instanceof Array && _ids.length === 0)) {
|
||||
@ -450,7 +519,6 @@ const submitFileUpload = async () => {
|
||||
|
||||
proxy?.$modal.msgSuccess('文件上传成功');
|
||||
fileUploadDialog.visible = false;
|
||||
// 可以在这里刷新文件列表或页面数据
|
||||
} catch (error) {
|
||||
proxy?.$modal.msgError('文件上传失败');
|
||||
} finally {
|
||||
@ -467,10 +535,8 @@ const cancelFileUpload = () => {
|
||||
/** 文件预览 */
|
||||
const handleFilePreview = (file: UploadFile) => {
|
||||
console.log('预览文件:', file);
|
||||
// 实现文件预览逻辑,例如:
|
||||
// if (file.url) {
|
||||
// window.open(file.url);
|
||||
// }
|
||||
// 可扩展:通过文件URL打开预览
|
||||
// if (file.url) window.open(file.url);
|
||||
};
|
||||
|
||||
/** 移除文件 */
|
||||
|
@ -1,9 +1,27 @@
|
||||
<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="supplierType">
|
||||
<el-select v-model="queryParams.supplierType" placeholder="请选择类型" clearable>
|
||||
<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="supplierName">
|
||||
<el-input v-model="queryParams.supplierName" placeholder="请输入企业名称" clearable style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态" prop="state">
|
||||
<el-select v-model="queryParams.state" placeholder="请选择状态" clearable>
|
||||
<el-option label="待审核" value="0"></el-option>
|
||||
<el-option label="已通过" value="1"></el-option>
|
||||
<el-option label="未通过" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
@ -13,6 +31,7 @@
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<!-- 列表及操作区域 -->
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
@ -42,12 +61,31 @@
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="supplierInputList" @selection-change="handleSelectionChange">
|
||||
<!-- 数据表格 -->
|
||||
<el-table v-loading="loading" :data="supplierInputList" @selection-change="handleSelectionChange" border>
|
||||
<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">
|
||||
<el-table-column label="ID" align="center" prop="id" width="80" />
|
||||
<el-table-column label="企业登记注册类型" align="center" prop="supplierType" width="140" />
|
||||
<el-table-column label="企业名称" align="center" prop="supplierName" width="180" />
|
||||
<el-table-column label="法定代表人" align="center" prop="supplierPerson" width="120" />
|
||||
<el-table-column label="统一社会信用代码" align="center" prop="supplierCode" width="180" />
|
||||
<el-table-column label="负责人" align="center" prop="personName" width="100" />
|
||||
<el-table-column label="负责人电话" align="center" prop="personPhone" width="120" />
|
||||
<el-table-column label="纳税规模" align="center" prop="taxScale" width="120" />
|
||||
<el-table-column label="资质等级" align="center" prop="supplierLivel" width="120" />
|
||||
<el-table-column label="审核状态" align="center" prop="state" width="120">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.state === '1' ? 'success' : scope.row.state === '2' ? 'danger' : 'warning'">
|
||||
{{ scope.row.state === '1' ? '已通过' : scope.row.state === '2' ? '未通过' : '待审核' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入库资料" align="center" prop="inputFile" width="120">
|
||||
<template #default="scope">
|
||||
<el-link v-if="scope.row.inputFile" :href="scope.row.inputFile" target="_blank" underline>查看文件</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button
|
||||
@ -71,53 +109,256 @@
|
||||
</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"
|
||||
<!-- 新增/修改对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="800px" append-to-body>
|
||||
<el-form ref="supplierInputFormRef" :model="form" :rules="rules" label-width="140px">
|
||||
<!-- 第一行:基础信息(2列布局) -->
|
||||
<el-row :gutter="20" class="mb-4">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="企业登记注册类型" prop="supplierType">
|
||||
<el-select v-model="form.supplierType" placeholder="请选择供应商类型" @change="handleTypeChange">
|
||||
<el-option label="劳务" value="劳务"></el-option>
|
||||
<el-option label="技术服务" value="技术服务"></el-option>
|
||||
<el-option label="物资设备" value="物资设备"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="企业名称" prop="supplierName">
|
||||
<el-input v-model="form.supplierName" placeholder="请输入企业名称" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第二行:企业信息 -->
|
||||
<el-row :gutter="20" class="mb-4">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="企业法定代表人" prop="supplierPerson">
|
||||
<el-input v-model="form.supplierPerson" placeholder="请输入法定代表人" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="统一社会信用代码" prop="supplierCode">
|
||||
<el-input v-model="form.supplierCode" placeholder="请输入统一社会信用代码" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第三行:地址与联系人 -->
|
||||
<el-row :gutter="20" class="mb-4">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="企业注册地址" prop="supplierAddres">
|
||||
<el-input v-model="form.supplierAddres" placeholder="请输入注册地址" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="负责人姓名" prop="personName">
|
||||
<el-input v-model="form.personName" placeholder="请输入负责人姓名" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第四行:联系电话与纳税规模 -->
|
||||
<el-row :gutter="20" class="mb-4">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="负责人联系电话" prop="personPhone">
|
||||
<el-input v-model="form.personPhone" placeholder="请输入联系电话" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="纳税规模" prop="taxScale">
|
||||
<el-select v-model="form.taxScale" placeholder="请选择纳税规模">
|
||||
<el-option label="一般纳税人" value="一般纳税人"></el-option>
|
||||
<el-option label="小规模纳税人" value="小规模纳税人"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第五行:银行信息 -->
|
||||
<el-row :gutter="20" class="mb-4">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开户行户名" prop="bankPersonName">
|
||||
<el-input v-model="form.bankPersonName" placeholder="请输入开户行户名" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开户银行" prop="bankName">
|
||||
<el-input v-model="form.bankName" placeholder="请输入开户银行" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第六行:银行账号与经营范围 -->
|
||||
<el-row :gutter="20" class="mb-4">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开户行账号" prop="bankAccount">
|
||||
<el-input v-model="form.bankAccount" placeholder="请输入开户行账号" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="经营范围" prop="scope">
|
||||
<el-input v-model="form.scope" placeholder="请输入经营范围" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第七行:企业资质 -->
|
||||
<el-row :gutter="20" class="mb-4">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="企业资质等级" prop="supplierLivel">
|
||||
<el-input v-model="form.supplierLivel" placeholder="请输入资质等级" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发证日期" prop="issueDate">
|
||||
<el-date-picker v-model="form.issueDate" type="date" placeholder="请选择发证日期" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第八行:证书有效期与营业额 -->
|
||||
<el-row :gutter="20" class="mb-4">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="证书有效期" prop="certificateValidity">
|
||||
<el-date-picker v-model="form.certificateValidity" type="date" placeholder="请选择证书有效期" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="近三年营业额" prop="pastThreeYears">
|
||||
<el-input v-model="form.pastThreeYears" placeholder="请输入近三年营业额" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第九行:安全生产许可证(仅劳务类型显示) -->
|
||||
<el-row :gutter="20" class="mb-4" v-if="form.supplierType === '劳务'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="安全生产许可证编号" prop="safeCode">
|
||||
<el-input v-model="form.safeCode" placeholder="请输入许可证编号" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="安全生产许可证发证日期" prop="safeCodeData">
|
||||
<el-date-picker v-model="form.safeCodeData" type="date" placeholder="请选择发证日期" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第十行:安全生产许可证有效期(仅劳务类型显示) -->
|
||||
<el-row :gutter="20" class="mb-4" v-if="form.supplierType === '劳务'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="安全生产许可证有效期" prop="safeCertificateValidity">
|
||||
<el-input v-model="form.safeCertificateValidity" placeholder="请输入有效期" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<!-- 空列占位 -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第十一行:注册人员数量(仅劳务类型显示) -->
|
||||
<el-row :gutter="20" class="mb-4" v-if="form.supplierType === '劳务'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="一建建造师" prop="build1">
|
||||
<el-input v-model="form.build1" placeholder="请输入一建建造师数量" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="二建建造师" prop="build2">
|
||||
<el-input v-model="form.build2" placeholder="请输入二建建造师数量" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="注册造价工程师" prop="build3">
|
||||
<el-input v-model="form.build3" placeholder="请输入注册造价工程师数量" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="其他(分别写)" prop="build4">
|
||||
<el-input v-model="form.build4" placeholder="请输入其他人员数量" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<!-- 空列占位 -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第十二行:职称人员数量(仅劳务类型显示) -->
|
||||
<el-row :gutter="20" class="mb-4" v-if="form.supplierType === '劳务'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="职称人员数量" prop="personnelNumber1">
|
||||
<el-input v-model="form.personnelNumber1" placeholder="请输入职称人员数量" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="职称人员数量" prop="personnelNumber2">
|
||||
<el-input v-model="form.personnelNumber2" placeholder="请输入职称人员数量" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="职称人员数量" prop="personnelNumber3">
|
||||
<el-input v-model="form.personnelNumber3" placeholder="请输入职称人员数量" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="职称人员数量" prop="personnelNumber4">
|
||||
<el-input v-model="form.personnelNumber4" placeholder="请输入职称人员数量" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<!-- 空列占位 -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第十三行:审核状态 -->
|
||||
<el-row :gutter="20" class="mb-4">
|
||||
<el-col :span="12">
|
||||
<!-- 空列占位,保持布局对称 -->
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核状态" prop="state" v-if="dialog.title === '修改供应商入库'">
|
||||
<el-select v-model="form.state" disabled>
|
||||
<el-option label="待审核" value="0"></el-option>
|
||||
<el-option label="已通过" value="1"></el-option>
|
||||
<el-option label="未通过" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第十四行:入库资料上传 -->
|
||||
<el-row class="mb-4">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="入库资料" prop="inputFile">
|
||||
<file-upload
|
||||
v-model="form.inputFile"
|
||||
:fileType="['doc', 'docx', 'pdf']"
|
||||
:autoUpload="false"
|
||||
ref="fileUploadRef"
|
||||
:method="form.id ? 'put' : 'post'"
|
||||
:data="form"
|
||||
uploadUrl="/supplierInput/supplierInput"
|
||||
:limit="1"
|
||||
:onUploadSuccess="handleUploadSuccess"
|
||||
@handleChange="change"
|
||||
showFileList
|
||||
>
|
||||
<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>
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<!-- 对话框底部按钮 -->
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
@ -129,11 +370,23 @@
|
||||
</template>
|
||||
|
||||
<script setup name="SupplierInput" lang="ts">
|
||||
import { ComponentInternalInstance, getCurrentInstance, onMounted, ref, reactive, toRefs, computed } from 'vue';
|
||||
import { ElFormInstance } from 'element-plus';
|
||||
import { listSupplierInput, getSupplierInput, delSupplierInput, addSupplierInput, updateSupplierInput } from '@/api/supplierInput/supplierInput';
|
||||
import { SupplierInputVO, SupplierInputQuery, SupplierInputForm } from '@/api/supplierInput/supplierInput/types';
|
||||
import { SupplierInputVO, SupplierInputQuery, SupplierInputForm, PageData, DialogOption } from '@/api/supplierInput/supplierInput/types';
|
||||
import Pagination from '@/components/Pagination/index.vue';
|
||||
import RightToolbar from '@/components/RightToolbar/index.vue';
|
||||
import FileUpload from '@/components/FileUpload/index.vue';
|
||||
|
||||
// 实例代理
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const fileUploadRef = ref(null);
|
||||
|
||||
// 组件引用
|
||||
const fileUploadRef = ref<InstanceType<typeof FileUpload> | null>(null);
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const supplierInputFormRef = ref<ElFormInstance>();
|
||||
|
||||
// 基础数据
|
||||
const supplierInputList = ref<SupplierInputVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
@ -142,151 +395,269 @@ 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 = {
|
||||
// 初始化表单数据
|
||||
const initFormData: any = {
|
||||
id: undefined,
|
||||
supplierType: undefined,
|
||||
inputFile: undefined
|
||||
supplierName: undefined,
|
||||
supplierPerson: undefined,
|
||||
supplierCode: undefined,
|
||||
supplierAddres: undefined,
|
||||
personName: undefined,
|
||||
personPhone: undefined,
|
||||
bankPersonName: undefined,
|
||||
bankName: undefined,
|
||||
bankAccount: undefined,
|
||||
taxScale: undefined,
|
||||
scope: undefined,
|
||||
supplierLivel: undefined,
|
||||
issueDate: undefined,
|
||||
certificateValidity: undefined,
|
||||
pastThreeYears: undefined,
|
||||
safeCode: undefined,
|
||||
safeCodeData: undefined,
|
||||
safeCertificateValidity: undefined,
|
||||
registeredNumber: undefined,
|
||||
personnelNumber: undefined,
|
||||
fileId: undefined,
|
||||
inputFile: undefined,
|
||||
state: '0' // 新增默认待审核
|
||||
};
|
||||
|
||||
// 核心数据(表单+查询参数)
|
||||
const data = reactive<PageData<SupplierInputForm, SupplierInputQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
supplierType: undefined,
|
||||
supplierName: undefined,
|
||||
state: undefined,
|
||||
inputFile: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
// 添加供应商类型的验证规则
|
||||
supplierType: [{ required: true, message: '请选择供应商类型', trigger: 'change' }],
|
||||
id: [{ required: true, message: '不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
// 解构响应式数据
|
||||
const { queryParams, form } = toRefs(data);
|
||||
|
||||
// 动态验证规则:仅劳务类型需要校验【安全生产许可证+人员数量】字段
|
||||
const rules = computed(() => {
|
||||
const baseRules = {
|
||||
supplierType: [{ required: true, message: '请选择企业登记注册类型', trigger: 'change' }],
|
||||
supplierName: [{ required: true, message: '请输入企业名称', trigger: 'blur' }],
|
||||
supplierPerson: [{ required: true, message: '请输入法定代表人', trigger: 'blur' }],
|
||||
supplierCode: [{ required: true, message: '请输入统一社会信用代码', trigger: 'blur' }],
|
||||
personName: [{ required: true, message: '请输入负责人姓名', trigger: 'blur' }],
|
||||
personPhone: [
|
||||
{ required: true, message: '请输入负责人联系电话', trigger: 'blur' },
|
||||
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号格式', trigger: 'blur' }
|
||||
],
|
||||
id: [{ required: true, message: 'ID不能为空', trigger: 'blur' }],
|
||||
build1: [{ required: true, message: '请输入一建建造师数量', trigger: 'change' }]
|
||||
};
|
||||
|
||||
// 仅当类型为"劳务"时,添加安全生产许可证+人员数量校验
|
||||
if (form.value.supplierType === '劳务') {
|
||||
return {
|
||||
...baseRules,
|
||||
// 安全生产许可证相关校验
|
||||
safeCode: [{ required: true, message: '请输入安全生产许可证编号', trigger: 'blur' }],
|
||||
safeCodeData: [{ required: true, message: '请选择安全生产许可证发证日期', trigger: 'change' }],
|
||||
safeCertificateValidity: [{ required: true, message: '请输入安全生产许可证有效期', trigger: 'blur' }],
|
||||
// 人员数量相关校验
|
||||
registeredNumber: [{ required: true, message: '请输入注册人员数量', trigger: 'blur' }]
|
||||
// personnelNumber: [{ required: true, message: '请输入职称人员数量', trigger: 'blur' }]
|
||||
};
|
||||
}
|
||||
|
||||
return baseRules;
|
||||
});
|
||||
|
||||
/** 企业类型变更时的处理:清空隐藏字段数据+重置校验 */
|
||||
const handleTypeChange = () => {
|
||||
// 非劳务类型:清空安全生产许可证+人员数量字段
|
||||
if (form.value.supplierType !== '劳务') {
|
||||
form.value.safeCode = undefined;
|
||||
form.value.safeCodeData = undefined;
|
||||
form.value.safeCertificateValidity = undefined;
|
||||
form.value.registeredNumber = undefined;
|
||||
form.value.personnelNumber = undefined;
|
||||
}
|
||||
// 重置隐藏字段的校验状态,避免错误提示残留
|
||||
supplierInputFormRef.value?.clearValidate(['safeCode', 'safeCodeData', 'safeCertificateValidity', 'registeredNumber', 'personnelNumber']);
|
||||
};
|
||||
|
||||
/** 查询供应商入库列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listSupplierInput(queryParams.value);
|
||||
supplierInputList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
try {
|
||||
const res = await listSupplierInput(queryParams.value);
|
||||
supplierInputList.value = res.rows;
|
||||
total.value = res.total;
|
||||
} catch (error) {
|
||||
proxy?.$modal.msgError('查询失败,请重试');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
/** 取消操作 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
/** 表单重置:清空所有字段 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
fileUrl.value = '';
|
||||
form.value.inputFile = '';
|
||||
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) => {
|
||||
/** 文件上传成功回调 */
|
||||
// const handleUploadSuccess = () => {
|
||||
// proxy?.$modal.msgSuccess('操作成功');
|
||||
// dialog.visible = false;
|
||||
// buttonLoading.value = false;
|
||||
// getList();
|
||||
// };
|
||||
|
||||
/** 文件选择变更 */
|
||||
const change = () => {
|
||||
fileUrl.value = '';
|
||||
};
|
||||
/** 多选框选中数据 */
|
||||
|
||||
/** 表格多选回调 */
|
||||
const handleSelectionChange = (selection: SupplierInputVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
single.value = selection.length !== 1;
|
||||
multiple.value = selection.length === 0;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
/** 新增操作 */
|
||||
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 = '修改供应商入库';
|
||||
if (!_id) return proxy?.$modal.msgWarning('请选择需要修改的数据');
|
||||
|
||||
try {
|
||||
const res = await getSupplierInput(_id);
|
||||
form.value = { ...form.value, ...res.data, inputFile: '' };
|
||||
fileUrl.value = res.data.inputFile;
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改供应商入库';
|
||||
} catch (error) {
|
||||
proxy?.$modal.msgError('获取数据失败,请重试');
|
||||
}
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
/** 提交表单 */
|
||||
const submitForm = () => {
|
||||
console.log(1);
|
||||
|
||||
supplierInputFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
fileUploadRef.value.submitUpload().then(() => {
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
getList();
|
||||
});
|
||||
if (!valid) return;
|
||||
form.value.registeredNumber = `${form.value.build1},${form.value.build2},${form.value.build3},${form.value.build4}`;
|
||||
form.value.personnelNumber = `${form.value.personnelNumber1},${form.value.personnelNumber2},${form.value.personnelNumber3},${form.value.personnelNumber4}`;
|
||||
buttonLoading.value = true;
|
||||
try {
|
||||
if (fileUploadRef.value) {
|
||||
await fileUploadRef.value.submitUpload().then((res) => {
|
||||
console.log(res);
|
||||
if (res == 'noFile') {
|
||||
proxy?.$modal.msgError('请上传文件');
|
||||
return;
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
proxy?.$modal.msgError('提交失败,请重试');
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
/** 删除操作 */
|
||||
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();
|
||||
if (!_ids || (Array.isArray(_ids) && _ids.length === 0)) {
|
||||
return proxy?.$modal.msgWarning('请选择需要删除的数据');
|
||||
}
|
||||
|
||||
try {
|
||||
await proxy?.$modal.confirm(`是否确认删除供应商入库编号为"${_ids}"的数据项?`);
|
||||
await delSupplierInput(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
getList();
|
||||
} catch (error) {
|
||||
proxy?.$modal.msgError('删除失败,请重试');
|
||||
}
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
/** 导出操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'supplierInput/supplierInput/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`supplierInput_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
proxy?.download('supplierInput/supplierInput/export', { ...queryParams.value }, `supplierInput_${new Date().getTime()}.xlsx`);
|
||||
};
|
||||
|
||||
/** 页面挂载时查询列表 */
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
/* 文件上传样式 */
|
||||
.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;
|
||||
}
|
||||
|
||||
/* PDF预览样式(若有) */
|
||||
.pdf {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@ -308,22 +679,6 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
.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);
|
||||
@ -342,9 +697,7 @@ onMounted(() => {
|
||||
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;
|
||||
@ -352,17 +705,31 @@ onMounted(() => {
|
||||
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;
|
||||
&:hover {
|
||||
border-color: #409eff;
|
||||
}
|
||||
}
|
||||
|
||||
/* 表格操作列样式 */
|
||||
.small-padding {
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.fixed-width {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
/* 行间距调整 */
|
||||
.mb8 {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.mb-4 {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
</style>
|
||||
|
0
src/views/tender/supplierInput/indexEdit.vue
Normal file
0
src/views/tender/supplierInput/indexEdit.vue
Normal file
Reference in New Issue
Block a user