Merge branch 'main' of http://xny.yj-3d.com:3000/taoge/new_project into ljx
This commit is contained in:
@ -6,7 +6,7 @@ VITE_APP_ENV = 'development'
|
|||||||
|
|
||||||
# 开发环境
|
# 开发环境
|
||||||
# 李陈杰 209
|
# 李陈杰 209
|
||||||
# VITE_APP_BASE_API = 'http://192.168.110.209:8899'
|
VITE_APP_BASE_API = 'http://192.168.110.149:8899'
|
||||||
# 曾涛
|
# 曾涛
|
||||||
VITE_APP_BASE_API = 'http://192.168.110.180:8899'
|
VITE_APP_BASE_API = 'http://192.168.110.180:8899'
|
||||||
# 罗成
|
# 罗成
|
||||||
|
BIN
public/catalog.xlsx
Normal file
BIN
public/catalog.xlsx
Normal file
Binary file not shown.
BIN
public/enterRoad.xlsx
Normal file
BIN
public/enterRoad.xlsx
Normal file
Binary file not shown.
BIN
public/landBlock.xlsx
Normal file
BIN
public/landBlock.xlsx
Normal file
Binary file not shown.
@ -5,6 +5,7 @@ import {
|
|||||||
FormalitiesAreConsolidatedForm,
|
FormalitiesAreConsolidatedForm,
|
||||||
FormalitiesAreConsolidatedQuery
|
FormalitiesAreConsolidatedQuery
|
||||||
} from '@/api/formalities/formalitiesAreConsolidated/types';
|
} from '@/api/formalities/formalitiesAreConsolidated/types';
|
||||||
|
import { ListOfFormalitiesQuery, ListOfFormalitiesVO } from '../listOfFormalities/types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询合规性手续合账列表
|
* 查询合规性手续合账列表
|
||||||
@ -101,3 +102,17 @@ export const delFormalitiesAnnex = (id: string | number | Array<string | number>
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询手续办理清单模板属性列表
|
||||||
|
* @param query
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const getTemplateTreeList = (query?: any): AxiosPromise<ListOfFormalitiesVO[]> => {
|
||||||
|
return request({
|
||||||
|
url: '/formalities/formalitiesAreConsolidated/getTree',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
};
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import { AxiosPromise } from 'axios';
|
import { AxiosPromise } from 'axios';
|
||||||
import { ProgressCategoryTemplateVO, ProgressCategoryTemplateForm, ProgressCategoryTemplateQuery } from '@/api/progress/progressCategoryTemplate/types';
|
import {
|
||||||
|
ProgressCategoryTemplateVO,
|
||||||
|
ProgressCategoryTemplateForm,
|
||||||
|
ProgressCategoryTemplateQuery
|
||||||
|
} from '@/api/progress/progressCategoryTemplate/types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询进度类别模版列表
|
* 查询进度类别模版列表
|
||||||
@ -61,3 +65,10 @@ export const delProgressCategoryTemplate = (id: string | number | Array<string |
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getTabList = () => {
|
||||||
|
return request({
|
||||||
|
url: '/progress/progressCategoryTemplate/listSystemTop',
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
@ -61,3 +61,12 @@ export const delEnterRoad = (id: string | number | Array<string | number>) => {
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 道路信息导入
|
||||||
|
export const importEnterRoad = (projectId: any, data: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/land/enterRoad/upload/' + projectId,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
@ -76,3 +76,12 @@ export const delLandBlock = (id: string | number | Array<string | number>) => {
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 地块信息导入
|
||||||
|
export const importLandBlock = (projectId:any,data: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/land/landBlock/upload/'+projectId,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
@ -48,7 +48,13 @@
|
|||||||
tag="ul"
|
tag="ul"
|
||||||
@click.stop
|
@click.stop
|
||||||
>
|
>
|
||||||
<li style="margin-top: 10px" v-for="(file, index) in fileList" :key="file.uid" class="el-upload-list__item ele-upload-list__item-content">
|
<li
|
||||||
|
style="margin-top: 10px"
|
||||||
|
v-for="(file, index) in fileList"
|
||||||
|
:key="file.uid"
|
||||||
|
class="el-upload-list__item ele-upload-list__item-content"
|
||||||
|
v-if="autoUpload"
|
||||||
|
>
|
||||||
<el-link :href="`${file.url}`" :underline="false" target="_blank">
|
<el-link :href="`${file.url}`" :underline="false" target="_blank">
|
||||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
||||||
</el-link>
|
</el-link>
|
||||||
@ -213,31 +219,27 @@ watch(
|
|||||||
);
|
);
|
||||||
// 上传前校检格式和大小
|
// 上传前校检格式和大小
|
||||||
const handleBeforeUpload = (file: any) => {
|
const handleBeforeUpload = (file: any) => {
|
||||||
// 校检文件类型
|
if (!validateFile(file)) return false;
|
||||||
if (props.fileType.length) {
|
proxy?.$modal.loading('正在上传文件,请稍候...');
|
||||||
const fileName = file.name.split('.');
|
number.value++;
|
||||||
const fileExt = fileName[fileName.length - 1];
|
return true;
|
||||||
const isTypeOk = props.fileType.indexOf(fileExt) >= 0;
|
};
|
||||||
if (!isTypeOk) {
|
|
||||||
proxy?.$modal.msgError(`文件格式不正确, 请上传${props.fileType.join('/')}格式文件!`);
|
//校检格式和大小
|
||||||
return false;
|
const validateFile = (file: File) => {
|
||||||
}
|
const ext = file.name.split('.').pop()?.toLowerCase();
|
||||||
|
if (props.fileType.length && !props.fileType.includes(ext!)) {
|
||||||
|
proxy?.$modal.msgError(`文件格式不正确,请上传 ${props.fileType.join('/')} 格式文件!`);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
// 校检文件名是否包含特殊字符
|
|
||||||
if (file.name.includes(',')) {
|
if (file.name.includes(',')) {
|
||||||
proxy?.$modal.msgError('文件名不正确,不能包含英文逗号!');
|
proxy?.$modal.msgError('文件名不正确,不能包含英文逗号!');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// 校检文件大小
|
if (props.fileSize && file.size / 1024 / 1024 > props.fileSize) {
|
||||||
if (props.fileSize) {
|
proxy?.$modal.msgError(`上传文件大小不能超过 ${props.fileSize} MB!`);
|
||||||
const isLt = file.size / 1024 / 1024 < props.fileSize;
|
return false;
|
||||||
if (!isLt) {
|
|
||||||
proxy?.$modal.msgError(`上传文件大小不能超过 ${props.fileSize} MB!`);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
proxy?.$modal.loading('正在上传文件,请稍候...');
|
|
||||||
number.value++;
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -278,13 +280,25 @@ const handleUploadSuccess = (res: any, file: UploadFileWithOssId) => {
|
|||||||
uploadedSuccessfully(res);
|
uploadedSuccessfully(res);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleChange = (file: any, fileList: any) => {
|
const handleChange = (file: any, filelist: any) => {
|
||||||
|
if (!props.autoUpload) {
|
||||||
|
// 手动上传模式:在选中文件时拦截非法文件
|
||||||
|
const isValid = validateFile(file.raw || file);
|
||||||
|
if (!isValid) {
|
||||||
|
fileUploadRef.value?.handleRemove(file); // 直接移除非法文件
|
||||||
|
console.log(file, filelist, fileList.value);
|
||||||
|
fileList.value = [...fileList.value]; // 触发列表更新
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
// 记录 status = 'ready' 的文件
|
// 记录 status = 'ready' 的文件
|
||||||
if (file.status === 'ready') {
|
if (file.status === 'ready') {
|
||||||
pendingFiles.value.push(file);
|
pendingFiles.value.push(file);
|
||||||
|
fileList.value = pendingFiles.value;
|
||||||
}
|
}
|
||||||
|
console.log(fileList.value);
|
||||||
|
|
||||||
emit('handleChange', file, fileList);
|
emit('handleChange', file, filelist);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 删除文件
|
// 删除文件
|
||||||
@ -332,11 +346,6 @@ const uploadedSuccessfully = (res: any) => {
|
|||||||
emit('update:modelValue', listToString(fileList.value));
|
emit('update:modelValue', listToString(fileList.value));
|
||||||
proxy?.$modal.closeLoading();
|
proxy?.$modal.closeLoading();
|
||||||
}
|
}
|
||||||
// if (props.autoUpload && props.limit === fileList.value.length) {
|
|
||||||
// fileUploadRef.value?.clearFiles();
|
|
||||||
// fileList.value = [];
|
|
||||||
// emit('update:modelValue', ''); // 同步到外部 v-model
|
|
||||||
// }
|
|
||||||
props.onUploadSuccess?.(fileList.value, res);
|
props.onUploadSuccess?.(fileList.value, res);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -400,6 +409,11 @@ const submitUpload = async () => {
|
|||||||
if (!pendingFiles.value.length) {
|
if (!pendingFiles.value.length) {
|
||||||
return 'noFile';
|
return 'noFile';
|
||||||
}
|
}
|
||||||
|
const validFiles = pendingFiles.value.filter((f: any) => validateFile(f.raw || f));
|
||||||
|
if (!validFiles.length) {
|
||||||
|
proxy?.$modal.msgError('没有符合条件的文件可上传');
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
proxy?.$modal.loading('正在上传文件,请稍候...');
|
proxy?.$modal.loading('正在上传文件,请稍候...');
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
@ -70,12 +70,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer p-4 border-t border-gray-100 flex justify-end space-x-3">
|
<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 @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
|
<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>
|
||||||
>
|
|
||||||
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
@ -187,7 +187,7 @@ const handleDownload = (row) => {
|
|||||||
{
|
{
|
||||||
id: row.id
|
id: row.id
|
||||||
},
|
},
|
||||||
`互提资料.zip`
|
`互提资料.docx`
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
const handleViewFile = (row) => {
|
const handleViewFile = (row) => {
|
||||||
|
@ -17,7 +17,13 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-table :data="FileList" style="width: 100%" height="64vh">
|
<el-table :data="FileList" style="width: 100%" height="64vh">
|
||||||
<el-table-column type="index" align="center" label="序号" width="180" />
|
<el-table-column type="index" align="center" label="序号" width="180" />
|
||||||
<el-table-column prop="fileName" align="center" label="文件名称" />
|
<el-table-column align="center" label="文件名称">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link :key="scope.row.fileName" :href="scope.row.fileUrl" target="_blank" type="primary" :underline="false">
|
||||||
|
{{ scope.row.fileName }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="流程状态" align="center" prop="status">
|
<el-table-column label="流程状态" align="center" prop="status">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="wf_business_status" :value="scope.row.status" />
|
<dict-tag :options="wf_business_status" :value="scope.row.status" />
|
||||||
|
@ -1,86 +1,172 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-6 bg-gray-50">
|
<div class="p-6 bg-gray-50 min-h-screen">
|
||||||
<div
|
<div class="received mx-auto bg-white rounded-xl shadow-sm overflow-hidden transition-all duration-300 hover:shadow-md">
|
||||||
class="received mx-auto bg-white rounded-xl shadow-sm overflow-hidden transition-all duration-300 hover:shadow-md">
|
|
||||||
<!-- 表单标题区域 -->
|
<!-- 表单标题区域 -->
|
||||||
<div class="bg-gradient-to-r from-blue-500 to-blue-600 text-white p-6">
|
<div class="bg-gradient-to-r from-blue-500 to-blue-600 text-white p-6">
|
||||||
<h2 class="text-2xl font-bold flex items-center"><i class="el-icon-user-circle mr-3"></i>收集资料清单</h2>
|
<h2 class="text-2xl font-bold flex items-center"><i class="el-icon-user-circle mr-3"></i>收集资料清单</h2>
|
||||||
<p class="text-blue-100 mt-2 opacity-90">请填写相关资料信息</p>
|
<p class="text-blue-100 mt-2 opacity-90">请填写相关资料信息</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 表单内容区域 -->
|
<el-form ref="mainFormRef" :model="form" :rules="mainRules" label-width="120px" class="p-6 md:p-8">
|
||||||
<el-form ref="mainFormRef" :model="form" :rules="mainRules" label-width="120px" class="p-6">
|
|
||||||
<!-- 基本信息区域 -->
|
<!-- 基本信息区域 -->
|
||||||
<div class="bg-blue-50 p-4 rounded-lg mb-6">
|
<div class="bg-blue-50 p-4 rounded-lg mb-6 md:mb-8">
|
||||||
<h3 class="text-lg font-semibold text-blue-700 mb-4">基本信息</h3>
|
<h3 class="text-lg font-semibold text-blue-700 mb-4">基本信息</h3>
|
||||||
|
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
<el-form-item label="收资人" prop="userId" class="mb-4">
|
<el-form-item label="收资人" prop="userId" class="mb-0">
|
||||||
<el-select :disabled="disabledAll" v-model="form.userId" placeholder="请选择收资人"
|
<el-select
|
||||||
class="w-full transition-all duration-300 border-gray-300 focus:border-blue-400 focus:ring-1 focus:ring-blue-400">
|
:disabled="disabledAll"
|
||||||
|
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-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="专业" prop="user_major" class="mb-4">
|
|
||||||
<el-select :disabled="disabledAll" v-model="form.user_major" placeholder="请选择专业"
|
<el-form-item label="专业" prop="user_major" class="mb-0">
|
||||||
class="transition-all duration-300 border-gray-300"
|
<el-select
|
||||||
:rules="{ required: true, message: '请选择专业', trigger: 'change' }">
|
:disabled="disabledAll"
|
||||||
|
v-model="form.user_major"
|
||||||
|
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 des_user_major" :key="item.value" :label="item.label" :value="item.value" />
|
<el-option v-for="item in des_user_major" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="电话" prop="phone" class="mb-4">
|
<el-form-item label="电话" prop="phone" class="mb-0">
|
||||||
<el-input :disabled="disabledAll" placeholder="请输入电话" v-model="form.phone" autocomplete="off" />
|
<el-input :disabled="disabledAll" placeholder="请输入电话" v-model="form.phone" autocomplete="off" class="w-full" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="邮箱" prop="email" class="mb-4">
|
<el-form-item label="邮箱" prop="email" class="mb-0">
|
||||||
<el-input :disabled="disabledAll" placeholder="请输入邮箱" v-model="form.email" autocomplete="off" />
|
<el-input :disabled="disabledAll" placeholder="请输入邮箱" v-model="form.email" autocomplete="off" class="w-full" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 资料文件区域 -->
|
<!-- 资料文件区域 -->
|
||||||
<div class="mb-6">
|
<div class="mb-8">
|
||||||
<div class="flex items-center justify-between mb-4">
|
<div class="flex items-center justify-between mb-5">
|
||||||
<h3 class="text-lg font-semibold text-blue-700">资料文件清单</h3>
|
<h3 class="text-lg font-semibold text-blue-700">资料文件清单</h3>
|
||||||
<el-button type="primary" size="small" @click="addDocumentItem" v-if="!disabledAll" icon="Plus"> 添加资料
|
<el-button type="primary" size="small" @click="addDocumentItem" v-if="!disabledAll" icon="Plus" class="transition-all hover:bg-blue-600">
|
||||||
|
添加资料
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-form ref="documentsFormRef" :model="form" class="space-y-4">
|
|
||||||
<div v-for="(item, index) in form.documents" :key="item.id"
|
<!-- 资料列表表单 -->
|
||||||
class="bg-gray-50 p-4 rounded-lg transition-all duration-200 hover:shadow-sm">
|
<el-form ref="documentsFormRef" :model="form" class="space-y-5">
|
||||||
<div class="flex justify-between items-start mb-2">
|
<div
|
||||||
<span class="text-sm font-medium text-gray-600">资料 {{ index + 1 }}</span>
|
v-for="(item, index) in form.documents"
|
||||||
<el-button type="text" size="small" text-color="#ff4d4f" @click="removeDocumentItem(index)"
|
:key="item.id"
|
||||||
icon="el-icon-delete" v-if="form.documents.length > 1 && !disabledAll">
|
class="bg-gray-50 p-5 rounded-lg transition-all duration-200 hover:shadow-sm border border-gray-100"
|
||||||
|
>
|
||||||
|
<div class="flex justify-between items-center mb-4 pb-3 border-b border-gray-200">
|
||||||
|
<span class="text-sm font-medium text-gray-700">资料 {{ index + 1 }}</span>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
text-color="#ff4d4f"
|
||||||
|
@click="removeDocumentItem(index)"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
v-if="form.documents.length > 1 && !disabledAll"
|
||||||
|
class="transition-all hover:text-red-600"
|
||||||
|
>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex flex-col md:flex-row gap-5 items-stretch">
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
<el-form-item
|
||||||
<el-form-item label="文件目录名称" :prop="`documents.${index}.catalogueName`"
|
label="文件目录名称"
|
||||||
:rules="[{ required: true, message: '请输入文件目录名称', trigger: 'blur' }]" class="mb-4">
|
:prop="`documents.${index}.catalogueName`"
|
||||||
<el-input :disabled="disabledAll" placeholder="请输入文件目录名称" v-model="item.catalogueName"
|
:rules="[{ required: true, message: '请输入文件目录名称', trigger: 'blur' }]"
|
||||||
autocomplete="off" />
|
class="flex-1 min-w-[280px] mb-0"
|
||||||
|
>
|
||||||
|
<el-input :disabled="disabledAll" placeholder="请输入文件目录名称" v-model="item.catalogueName" autocomplete="off" class="w-full" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" :prop="`documents.${index}.remark`" class="mb-4">
|
<el-form-item
|
||||||
<el-input :disabled="disabledAll" placeholder="请输入备注" v-model="item.remark" autocomplete="off" />
|
label="人员"
|
||||||
|
:prop="`documents.${index}.userId`"
|
||||||
|
:rules="[{ required: true, message: '请选择人员', trigger: 'blur' }]"
|
||||||
|
class="flex-1 min-w-[220px] mb-0"
|
||||||
|
>
|
||||||
|
<el-select
|
||||||
|
:disabled="disabledAll"
|
||||||
|
v-model="item.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="user in userList" :key="user.userId" :label="user.nickName" :value="user.userId" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" :prop="`documents.${index}.remark`" class="flex-1 min-w-[220px] mb-0">
|
||||||
|
<el-input :disabled="disabledAll" placeholder="请输入备注" v-model="item.remark" autocomplete="off" class="w-full" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<!-- 操作按钮区域 -->
|
|
||||||
<div class="flex justify-center gap-4 mt-8">
|
<!-- 操作按钮区域:居中+间距优化 -->
|
||||||
<el-button type="primary" @click="submitForm" v-hasPermi="['design:collect:add']"
|
<div class="flex flex-wrap justify-center gap-4 md:gap-6 mt-10">
|
||||||
v-if="!form.id || form.status == 'draft'" size="large">确认提交</el-button>
|
<el-button
|
||||||
<el-button type="primary" @click="update" v-hasPermi="['design:collect:query']"
|
type="primary"
|
||||||
v-show="form.id && form.status == 'draft'" icon="Edit" size="large">审核</el-button>
|
@click="submitForm"
|
||||||
<el-button type="primary" @click="update" v-hasPermi="['design:collect:query']" v-show="form.status == 'back'"
|
v-hasPermi="['design:collect:add']"
|
||||||
size="large" icon="Edit">重新发起审核</el-button>
|
v-if="!form.id || form.status == 'draft'"
|
||||||
<el-button type="primary" @click="onView" v-hasPermi="['design:collect:query']"
|
size="large"
|
||||||
v-show="form.id && form.status != 'draft'" icon="view" size="large">查看流程</el-button>
|
class="px-8 transition-all hover:bg-blue-600"
|
||||||
<el-button type="success" v-hasPermi="['design:collect:export']" @click="onLoad"
|
>
|
||||||
v-show="form.id && form.status != 'draft'" icon="Download" size="large">导出</el-button>
|
确认提交
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="update"
|
||||||
|
v-hasPermi="['design:collect:query']"
|
||||||
|
v-show="form.id && form.status == 'draft'"
|
||||||
|
icon="Edit"
|
||||||
|
size="large"
|
||||||
|
class="px-8 transition-all hover:bg-blue-600"
|
||||||
|
>
|
||||||
|
审核
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="update"
|
||||||
|
v-hasPermi="['design:collect:query']"
|
||||||
|
v-show="form.status == 'back'"
|
||||||
|
size="large"
|
||||||
|
icon="Edit"
|
||||||
|
class="px-8 transition-all hover:bg-blue-600"
|
||||||
|
>
|
||||||
|
重新发起审核
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="onView"
|
||||||
|
v-hasPermi="['design:collect:query']"
|
||||||
|
v-show="form.id && form.status != 'draft'"
|
||||||
|
icon="view"
|
||||||
|
size="large"
|
||||||
|
class="px-8 transition-all hover:bg-blue-600"
|
||||||
|
>
|
||||||
|
查看流程
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
v-hasPermi="['design:collect:export']"
|
||||||
|
@click="onLoad"
|
||||||
|
v-show="form.id && form.status != 'draft'"
|
||||||
|
icon="Download"
|
||||||
|
size="large"
|
||||||
|
class="px-8 transition-all hover:bg-green-600"
|
||||||
|
>
|
||||||
|
导出
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@ -88,51 +174,59 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="DataCollectionForm" lang="ts">
|
<script setup name="DataCollectionForm" lang="ts">
|
||||||
import { ref, reactive, computed, onMounted } from 'vue';
|
import { ref, reactive, computed, onMounted, onUnmounted, watch, getCurrentInstance } from 'vue';
|
||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
import { ElMessage, ElLoading } from 'element-plus';
|
import { ElMessage, ElLoading, FormRules } from 'element-plus';
|
||||||
import { systemUserList } from '@/api/design/appointment';
|
import { systemUserList } from '@/api/design/appointment';
|
||||||
import { collectBatch, byProjectId, exportWord } from '@/api/design/received';
|
import { collectBatch, byProjectId, exportWord } from '@/api/design/received';
|
||||||
import { getUser } from '@/api/system/user';
|
import { getUser } from '@/api/system/user';
|
||||||
// 用户状态管理
|
import type { ComponentInternalInstance, ElFormInstance } from 'element-plus';
|
||||||
// 获取用户 store
|
|
||||||
|
// 全局实例与状态管理
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
const userStore = useUserStoreHook();
|
const userStore = useUserStoreHook();
|
||||||
// 从 store 中获取当前选中的项目
|
|
||||||
const currentProject = computed(() => userStore.selectedProject);
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
const { des_user_major } = toRefs<any>(proxy?.useDict('des_user_major'));
|
const { des_user_major } = toRefs<any>(proxy?.useDict('des_user_major'));
|
||||||
const userId = computed(() => userStore.userId);
|
const userId = computed(() => userStore.userId);
|
||||||
|
|
||||||
// 表单引用
|
// 表单引用
|
||||||
const mainFormRef = ref();
|
const mainFormRef = ref<ElFormInstance>();
|
||||||
// 用户列表
|
const documentsFormRef = ref<ElFormInstance>();
|
||||||
const userList = ref([]);
|
|
||||||
const userMap = new Map();
|
// 数据定义
|
||||||
const disabledAll = ref(false);
|
const userList = ref<any[]>([]);
|
||||||
// 表单数据
|
const userMap = new Map<string, string>(); // 存储用户ID与昵称映射
|
||||||
|
const disabledAll = ref(false); // 表单是否全部禁用
|
||||||
|
|
||||||
|
// 表单核心数据
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
projectId: currentProject.value?.id,
|
projectId: currentProject.value?.id,
|
||||||
userId: '', // 收资人
|
userId: '', // 收资人
|
||||||
user_major: '', // 专业
|
user_major: '', // 专业
|
||||||
phone: '', // 电话
|
phone: '', // 电话
|
||||||
email: '', // 邮箱
|
email: '', // 邮箱
|
||||||
id: '',
|
id: '', // 表单ID
|
||||||
status: '',
|
status: '', // 表单状态
|
||||||
documents: [
|
documents: [
|
||||||
{
|
{
|
||||||
id: Date.now(),
|
id: Date.now(),
|
||||||
catalogueName: '', // 文件目录名称
|
catalogueName: '', // 文件目录名称
|
||||||
remark: '' // 备注
|
remark: '', // 备注
|
||||||
|
userId: '' // 负责人员
|
||||||
}
|
}
|
||||||
] as Array<{
|
] as Array<{
|
||||||
id: number;
|
id: number;
|
||||||
catalogueName: string;
|
catalogueName: string;
|
||||||
remark: string;
|
remark: string;
|
||||||
|
userId: string;
|
||||||
|
num?: number; // 序号(提交时用)
|
||||||
|
userName?: string; // 人员名称(提交时用)
|
||||||
}>
|
}>
|
||||||
});
|
});
|
||||||
|
|
||||||
// 主表单验证规则
|
// 主表单验证规则
|
||||||
const mainRules = reactive({
|
const mainRules = reactive({
|
||||||
userId: [{ required: true, message: '请输入收资人', trigger: 'blur' }],
|
userId: [{ required: true, message: '请选择收资人', trigger: 'blur' }],
|
||||||
user_major: [{ required: true, message: '请选择专业', trigger: 'change' }],
|
user_major: [{ required: true, message: '请选择专业', trigger: 'change' }],
|
||||||
phone: [
|
phone: [
|
||||||
{ required: true, message: '请输入电话', trigger: 'blur' },
|
{ required: true, message: '请输入电话', trigger: 'blur' },
|
||||||
@ -144,138 +238,160 @@ const mainRules = reactive({
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
// 添加资料项
|
/** 添加资料项 */
|
||||||
const addDocumentItem = () => {
|
const addDocumentItem = () => {
|
||||||
form.documents.push({
|
form.documents.push({
|
||||||
id: Date.now(),
|
id: Date.now(), // 用时间戳保证ID唯一
|
||||||
catalogueName: '',
|
catalogueName: '',
|
||||||
remark: ''
|
remark: '',
|
||||||
|
userId: ''
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 删除资料项
|
/** 删除资料项 */
|
||||||
const removeDocumentItem = (index: number) => {
|
const removeDocumentItem = (index: number) => {
|
||||||
|
if (form.documents.length <= 1) {
|
||||||
|
ElMessage.warning('至少需要保留一条资料记录');
|
||||||
|
return;
|
||||||
|
}
|
||||||
form.documents.splice(index, 1);
|
form.documents.splice(index, 1);
|
||||||
};
|
};
|
||||||
// 查询数据 再次回显
|
|
||||||
|
/** 回显项目对应的表单数据 */
|
||||||
const byProjectIdAll = async () => {
|
const byProjectIdAll = async () => {
|
||||||
// 调用接口获取数据
|
|
||||||
const res = await byProjectId(currentProject.value?.id);
|
|
||||||
console.log(res);
|
|
||||||
form.documents = [
|
|
||||||
{
|
|
||||||
id: Date.now(),
|
|
||||||
catalogueName: '',
|
|
||||||
remark: ''
|
|
||||||
}
|
|
||||||
];
|
|
||||||
disabledAll.value = false;
|
|
||||||
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 (form.status == 'finish') {
|
|
||||||
// 表单全部禁用
|
|
||||||
disabledAll.value = true;
|
|
||||||
}
|
|
||||||
// 回显资料文件列表
|
|
||||||
if (data.catalogueList && data.catalogueList.length > 0) {
|
|
||||||
// 清空现有列表
|
|
||||||
form.documents = [];
|
|
||||||
// 填充新数据
|
|
||||||
data.catalogueList.forEach((item: any, index: number) => {
|
|
||||||
form.documents.push({
|
|
||||||
id: item.id || Date.now() + index, // 确保id唯一
|
|
||||||
catalogueName: item.catalogueName || '',
|
|
||||||
remark: item.remark || ''
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
console.log(11111111);
|
|
||||||
|
|
||||||
// 如果没有资料,保持一个空项
|
|
||||||
form.documents = [
|
|
||||||
{
|
|
||||||
id: Date.now(),
|
|
||||||
catalogueName: '',
|
|
||||||
remark: ''
|
|
||||||
}
|
|
||||||
];
|
|
||||||
console.log(form.documents);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// 提交表单
|
|
||||||
const submitForm = async () => {
|
|
||||||
if (!mainFormRef.value) return;
|
|
||||||
try {
|
try {
|
||||||
const valid = await mainFormRef.value.validate();
|
const res = await byProjectId(currentProject.value?.id);
|
||||||
if (valid) {
|
// 重置表单默认值
|
||||||
// 这里可以添加提交逻辑
|
form.documents = [
|
||||||
form.documents.map((item, i) => {
|
{
|
||||||
item.num = i + 1;
|
id: Date.now(),
|
||||||
});
|
catalogueName: '',
|
||||||
let body = {
|
remark: '',
|
||||||
desCollectBo: {
|
userId: ''
|
||||||
projectId: currentProject.value?.id,
|
}
|
||||||
userId: form.userId, // 收资人
|
];
|
||||||
userMajor: form.user_major, // 专业
|
disabledAll.value = false;
|
||||||
id: form.id,
|
|
||||||
phone: form.phone, // 电话
|
if (res.code == 200 && res.data) {
|
||||||
email: form.email, // 邮箱
|
const data = res.data;
|
||||||
userName: userMap.get(form.userId)
|
// 回显基本信息
|
||||||
},
|
form.userId = data.userId || '';
|
||||||
catalogueList: form.documents
|
form.user_major = data.userMajor || '';
|
||||||
};
|
form.phone = data.phone || '';
|
||||||
let res = await collectBatch(body);
|
form.email = data.email || '';
|
||||||
if (res.code == 200) {
|
form.id = data.id || '';
|
||||||
byProjectIdAll();
|
form.status = data.status || '';
|
||||||
ElMessage.success('表单提交成功');
|
|
||||||
} else {
|
// 已完成状态禁用所有输入
|
||||||
ElMessage.success(res.msg);
|
if (form.status === 'finish') {
|
||||||
|
disabledAll.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 回显资料列表
|
||||||
|
if (data.catalogueList && data.catalogueList.length > 0) {
|
||||||
|
form.documents = data.catalogueList.map((item: any, index: number) => ({
|
||||||
|
id: item.id || Date.now() + index, // 确保ID唯一
|
||||||
|
catalogueName: item.catalogueName || '',
|
||||||
|
remark: item.remark || '',
|
||||||
|
userId: item.userId || ''
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log(form);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
ElMessage.error('请完善表单信息后再提交');
|
ElMessage.error('获取表单数据失败,请刷新重试');
|
||||||
|
console.error('数据回显错误:', error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// 重置表单
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const submitForm = async () => {
|
||||||
|
if (!mainFormRef.value) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 先验证主表单
|
||||||
|
await mainFormRef.value.validate();
|
||||||
|
// 再验证资料列表表单(如果存在)
|
||||||
|
if (documentsFormRef.value) {
|
||||||
|
await documentsFormRef.value.validate();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理提交数据(补充序号和人员名称)
|
||||||
|
const submitDocuments = form.documents.map((item, i) => ({
|
||||||
|
...item,
|
||||||
|
num: i + 1,
|
||||||
|
userName: userMap.get(item.userId) || ''
|
||||||
|
}));
|
||||||
|
|
||||||
|
const submitData = {
|
||||||
|
desCollectBo: {
|
||||||
|
projectId: currentProject.value?.id,
|
||||||
|
userId: form.userId,
|
||||||
|
userMajor: form.user_major,
|
||||||
|
id: form.id,
|
||||||
|
phone: form.phone,
|
||||||
|
email: form.email,
|
||||||
|
userName: userMap.get(form.userId) || ''
|
||||||
|
},
|
||||||
|
catalogueList: submitDocuments
|
||||||
|
};
|
||||||
|
|
||||||
|
// 调用接口提交
|
||||||
|
const res = await collectBatch(submitData);
|
||||||
|
if (res.code === 200) {
|
||||||
|
ElMessage.success('表单提交成功');
|
||||||
|
byProjectIdAll(); // 重新拉取最新数据
|
||||||
|
} else {
|
||||||
|
ElMessage.warning(res.msg || '提交失败,请重试');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.error('请完善表单必填信息后再提交');
|
||||||
|
console.error('表单验证失败:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
if (mainFormRef.value) {
|
if (mainFormRef.value) {
|
||||||
mainFormRef.value.resetFields();
|
mainFormRef.value.resetFields();
|
||||||
|
// form表单数据重置
|
||||||
|
form.userId = '';
|
||||||
|
form.user_major = '';
|
||||||
|
form.phone = '';
|
||||||
|
form.email = '';
|
||||||
|
form.id = '';
|
||||||
|
form.status = '';
|
||||||
}
|
}
|
||||||
// 重置资料列表,保留一个空项
|
// 重置资料列表为1条空记录
|
||||||
form.documents = [
|
form.documents = [
|
||||||
{
|
{
|
||||||
id: Date.now(),
|
id: Date.now(),
|
||||||
catalogueName: '',
|
catalogueName: '',
|
||||||
remark: ''
|
remark: '',
|
||||||
|
userId: ''
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
/** 查询当前部门的所有用户 */
|
|
||||||
const getDeptAllUser = async (deptId: any) => {
|
/** 获取当前部门的所有用户 */
|
||||||
|
const getDeptAllUser = async (deptId: string | number) => {
|
||||||
try {
|
try {
|
||||||
const res = await systemUserList({ deptId });
|
const res = await systemUserList({ deptId });
|
||||||
// 实际项目中使用接口返回的数据
|
userList.value = res.rows || [];
|
||||||
userList.value = res.rows;
|
// 构建用户ID-昵称映射
|
||||||
userList.value.forEach((user) => {
|
userList.value.forEach((user) => {
|
||||||
userMap.set(user.userId, user.nickName);
|
userMap.set(user.userId, user.nickName);
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
ElMessage.error('获取用户列表失败');
|
ElMessage.error('获取用户列表失败,请刷新重试');
|
||||||
|
console.error('用户列表获取错误:', error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** 跳转审核页面 */
|
||||||
const update = () => {
|
const update = () => {
|
||||||
proxy.$tab.closePage(proxy.$route);
|
proxy?.$tab.closePage(proxy?.$route);
|
||||||
proxy.$router.push({
|
proxy?.$router.push({
|
||||||
path: `/approval/received/indexEdit`,
|
path: `/approval/received/indexEdit`,
|
||||||
query: {
|
query: {
|
||||||
id: form.id,
|
id: form.id,
|
||||||
@ -283,9 +399,11 @@ const update = () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** 跳转流程查看页面 */
|
||||||
const onView = () => {
|
const onView = () => {
|
||||||
proxy.$tab.closePage(proxy.$route);
|
proxy?.$tab.closePage(proxy?.$route);
|
||||||
proxy.$router.push({
|
proxy?.$router.push({
|
||||||
path: `/approval/received/indexEdit`,
|
path: `/approval/received/indexEdit`,
|
||||||
query: {
|
query: {
|
||||||
id: form.id,
|
id: form.id,
|
||||||
@ -293,96 +411,158 @@ const onView = () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
/** 获取当前用户详情 */
|
|
||||||
|
/** 获取当前用户详情(回显个人信息) */
|
||||||
const getUserDetail = async () => {
|
const getUserDetail = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getUser(userId.value);
|
const res = await getUser(userId.value);
|
||||||
// userInfo.value = res.data.user;
|
if (res.data?.user) {
|
||||||
form.userId = res.data.user.userId;
|
form.userId = res.data.user.userId;
|
||||||
form.phone = res.data.user.phonenumber;
|
form.phone = res.data.user.phonenumber || '';
|
||||||
form.email = res.data.user.email;
|
form.email = res.data.user.email || '';
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
ElMessage.error('获取用户信息失败');
|
ElMessage.error('获取个人信息失败,部分字段需手动填写');
|
||||||
|
console.error('用户详情获取错误:', err);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 页面挂载时初始化数据
|
/** 导出文件 */
|
||||||
onMounted(() => {
|
|
||||||
// 可以在这里添加初始化逻辑
|
|
||||||
getUserDetail();
|
|
||||||
getDeptAllUser(userStore.deptId).then(() => {
|
|
||||||
byProjectIdAll();
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
const onLoad = async () => {
|
const onLoad = async () => {
|
||||||
// 导出接口
|
if (!form.id) {
|
||||||
proxy?.download(
|
ElMessage.warning('请先保存表单再导出');
|
||||||
'design/collect/exportWord',
|
return;
|
||||||
{
|
}
|
||||||
id: form.id
|
try {
|
||||||
},
|
proxy?.download('design/collect/exportWord', { id: form.id }, `收资清单_${new Date().getTime()}.zip`);
|
||||||
`收资清单.zip`
|
} catch (error) {
|
||||||
);
|
ElMessage.error('导出失败,请重试');
|
||||||
|
console.error('文件导出错误:', error);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
//监听项目id刷新数据
|
|
||||||
const listeningProject = watch(
|
/** 页面挂载初始化 */
|
||||||
() => currentProject.value?.id,
|
onMounted(() => {
|
||||||
(nid, oid) => {
|
// 先获取当前用户信息,再获取部门用户列表,最后回显表单数据
|
||||||
getUserDetail();
|
getUserDetail().then(() => {
|
||||||
getDeptAllUser(userStore.deptId).then(() => {
|
getDeptAllUser(userStore.deptId).then(() => {
|
||||||
byProjectIdAll();
|
byProjectIdAll();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
/** 监听项目切换,刷新数据 */
|
||||||
|
const listeningProject = watch(
|
||||||
|
() => currentProject.value?.id,
|
||||||
|
(newId, oldId) => {
|
||||||
|
if (newId !== oldId) {
|
||||||
|
resetForm();
|
||||||
|
form.projectId = newId;
|
||||||
|
getUserDetail().then(() => {
|
||||||
|
getDeptAllUser(userStore.deptId).then(() => {
|
||||||
|
byProjectIdAll();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** 页面卸载清理监听 */
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
listeningProject();
|
listeningProject();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss" scoped>
|
||||||
|
// 主容器样式
|
||||||
.received {
|
.received {
|
||||||
width: 90%;
|
width: 95%;
|
||||||
max-width: 1000px;
|
max-width: 1200px;
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-bottom: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 全局样式调整,使界面更柔和
|
// 自定义滚动条(优化长列表体验)
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
}
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #e5e7eb;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
::-webkit-scrollbar-thumb:hover {
|
||||||
|
background-color: #d1d5db;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Element 组件样式覆盖(统一风格)
|
||||||
::v-deep .el-input__inner,
|
::v-deep .el-input__inner,
|
||||||
::v-deep .el-select__input {
|
::v-deep .el-select__input,
|
||||||
border-radius: 6px;
|
::v-deep .el-select-dropdown__item {
|
||||||
border-color: #dcdfe6;
|
border-radius: 6px !important;
|
||||||
transition: all 0.2s ease;
|
border-color: #dcdfe6 !important;
|
||||||
|
transition: all 0.2s ease !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .el-input__inner:focus,
|
::v-deep .el-input__inner:focus,
|
||||||
::v-deep .el-select__input:focus {
|
::v-deep .el-select__input:focus {
|
||||||
border-color: #409eff;
|
border-color: #409eff !important;
|
||||||
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
|
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2) !important;
|
||||||
|
outline: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .el-button {
|
::v-deep .el-form-item {
|
||||||
border-radius: 6px;
|
margin-bottom: 0 !important;
|
||||||
transition: all 0.2s ease;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .el-form-item__label {
|
::v-deep .el-form-item__label {
|
||||||
font-weight: 500;
|
font-weight: 500 !important;
|
||||||
color: #606266;
|
color: #606266 !important;
|
||||||
|
padding-right: 12px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 响应式调整
|
::v-deep .el-button--primary {
|
||||||
@media (max-width: 768px) {
|
background-color: #409eff !important;
|
||||||
.received {
|
border-color: #409eff !important;
|
||||||
width: 95%;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep .el-form-item {
|
::v-deep .el-button--primary:hover {
|
||||||
margin-bottom: 16px;
|
background-color: #3390e0 !important;
|
||||||
|
border-color: #3390e0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-button--success {
|
||||||
|
background-color: #52c41a !important;
|
||||||
|
border-color: #52c41a !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-button--success:hover {
|
||||||
|
background-color: #47b811 !important;
|
||||||
|
border-color: #47b811 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 响应式适配(小屏幕调整)
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.p-6.md\:p-8 {
|
||||||
|
padding: 4px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .el-form-item__label {
|
::v-deep .el-form-item__label {
|
||||||
width: 100px;
|
width: 100px !important;
|
||||||
|
font-size: 14px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex.flex-col.md\:flex-row.gap-5 {
|
||||||
|
gap: 3px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-button--large {
|
||||||
|
padding: 8px 16px !important;
|
||||||
|
font-size: 14px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-blue-50.p-4 {
|
||||||
|
padding: 15px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -31,7 +31,11 @@
|
|||||||
>
|
>
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
<el-form-item label="设计方案" prop="fileUrl" class="mb-2">
|
<el-form-item label="设计方案" prop="fileUrl" class="mb-2">
|
||||||
|
<el-link v-if="form.fileUrl" :href="form.fileUrl" target="_blank" type="primary" :underline="false">
|
||||||
|
{{ form.fileName }}
|
||||||
|
</el-link>
|
||||||
<file-upload
|
<file-upload
|
||||||
|
v-else
|
||||||
:limit="1"
|
:limit="1"
|
||||||
:fileType="['pdf']"
|
:fileType="['pdf']"
|
||||||
:fileSize="100"
|
:fileSize="100"
|
||||||
|
@ -29,7 +29,10 @@
|
|||||||
class="space-y-4"
|
class="space-y-4"
|
||||||
>
|
>
|
||||||
<el-form-item label="图纸文件" prop="fileId" class="mb-2 md:col-span-2">
|
<el-form-item label="图纸文件" prop="fileId" class="mb-2 md:col-span-2">
|
||||||
<el-input v-model="form.fileName" disabled placeholder="图纸名称" />
|
<el-link v-if="form.fileUrl" :href="form.fileUrl" target="_blank" type="primary" :underline="false">
|
||||||
|
{{ form.fileName }}
|
||||||
|
</el-link>
|
||||||
|
<!-- <el-input v-model="form.fileName" disabled placeholder="图纸名称" /> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@ -123,7 +126,8 @@ const initFormData = {
|
|||||||
fileUrl: undefined,
|
fileUrl: undefined,
|
||||||
status: undefined,
|
status: undefined,
|
||||||
originalName: undefined,
|
originalName: undefined,
|
||||||
fileVoList: []
|
fileVoList: [],
|
||||||
|
auditStatus: undefined
|
||||||
};
|
};
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: { ...initFormData },
|
form: { ...initFormData },
|
||||||
|
@ -75,44 +75,6 @@
|
|||||||
资料名称: {{ info.projectName || '未定义' }} | 卷册号: {{ info.volumeNumber || '未定义' }}
|
资料名称: {{ info.projectName || '未定义' }} | 卷册号: {{ info.volumeNumber || '未定义' }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 基本信息区域 - 缩小间隔,增强label与内容区分 -->
|
|
||||||
<div class="p-3 md:p-4 border-b border-gray-100 dark:border-gray-700/50">
|
|
||||||
<h3 class="text-base md:text-lg font-semibold mb-2 flex items-center text-gray-800 dark:text-gray-200">
|
|
||||||
<el-icon style="margin-right: 10px" :size="24" color="#409EFF">
|
|
||||||
<Document />
|
|
||||||
</el-icon>
|
|
||||||
|
|
||||||
基本信息
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2 md:gap-3">
|
|
||||||
<InfoItem label="项目名称" value="projectName" :data="info" />
|
|
||||||
<InfoItem label="资料名称" value="documentName" :data="info" />
|
|
||||||
<InfoItem label="卷册号" value="volumeNumber" :data="info" />
|
|
||||||
<InfoItem label="设计子项名称" value="designSubitem" :data="info" />
|
|
||||||
<InfoItem label="专业名称" value="specialtyName" :data="info" />
|
|
||||||
<InfoItem label="文件格式" value="fileType" :data="info" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 人员信息区域 -->
|
|
||||||
<div class="p-3 md:p-4 border-b border-gray-100 dark:border-gray-700/50">
|
|
||||||
<h3 class="text-base md:text-lg font-semibold mb-2 flex items-center text-gray-800 dark:text-gray-200">
|
|
||||||
<el-icon style="margin-right: 10px" :size="24" color="#409EFF">
|
|
||||||
<Document />
|
|
||||||
</el-icon>
|
|
||||||
人员信息
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-2 md:gap-3">
|
|
||||||
<InfoItem label="负责人" value="principal" :data="info" />
|
|
||||||
<InfoItem label="设计人员" value="principalName" :data="info" />
|
|
||||||
<InfoItem label="审核人员" value="reviewerName" :data="info" />
|
|
||||||
<InfoItem label="创建时间" value="createTime" :data="info" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 状态信息区域 -->
|
<!-- 状态信息区域 -->
|
||||||
<div class="p-3 md:p-4">
|
<div class="p-3 md:p-4">
|
||||||
<h3 class="text-base md:text-lg font-semibold mb-2 flex items-center text-gray-800 dark:text-gray-200">
|
<h3 class="text-base md:text-lg font-semibold mb-2 flex items-center text-gray-800 dark:text-gray-200">
|
||||||
@ -150,13 +112,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="info-item">
|
<!-- <div class="info-item">
|
||||||
<span class="info-label">文件大小</span>
|
<span class="info-label">文件大小</span>
|
||||||
<div class="info-value mt-0.5 flex items-center">
|
<div class="info-value mt-0.5 flex items-center">
|
||||||
<i class="fa fa-hdd-o text-gray-400 dark:text-gray-500 mr-1.5"></i>
|
<i class="fa fa-hdd-o text-gray-400 dark:text-gray-500 mr-1.5"></i>
|
||||||
{{ info.fileSize || '未知' }}
|
{{ info.fileSize || '未知' }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div class="info-item">
|
<div class="info-item">
|
||||||
<span class="info-label">更新时间</span>
|
<span class="info-label">更新时间</span>
|
||||||
@ -189,6 +151,42 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 基本信息区域 - 缩小间隔,增强label与内容区分 -->
|
||||||
|
<div class="p-3 md:p-4 border-b border-gray-100 dark:border-gray-700/50">
|
||||||
|
<h3 class="text-base md:text-lg font-semibold mb-2 flex items-center text-gray-800 dark:text-gray-200">
|
||||||
|
<el-icon style="margin-right: 10px" :size="24" color="#409EFF">
|
||||||
|
<Document />
|
||||||
|
</el-icon>
|
||||||
|
|
||||||
|
基本信息
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2 md:gap-3">
|
||||||
|
<InfoItem label="项目名称" value="projectName" :data="info" />
|
||||||
|
<InfoItem label="资料名称" value="documentName" :data="info" />
|
||||||
|
<InfoItem label="卷册号" value="volumeNumber" :data="info" />
|
||||||
|
<InfoItem label="设计子项名称" value="designSubitem" :data="info" />
|
||||||
|
<InfoItem label="专业名称" value="specialtyName" :data="info" />
|
||||||
|
<InfoItem label="文件格式" value="fileType" :data="info" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 人员信息区域 -->
|
||||||
|
<div class="p-3 md:p-4 border-b border-gray-100 dark:border-gray-700/50">
|
||||||
|
<h3 class="text-base md:text-lg font-semibold mb-2 flex items-center text-gray-800 dark:text-gray-200">
|
||||||
|
<el-icon style="margin-right: 10px" :size="24" color="#409EFF">
|
||||||
|
<Document />
|
||||||
|
</el-icon>
|
||||||
|
人员信息
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-2 md:gap-3">
|
||||||
|
<InfoItem label="负责人" value="principal" :data="info" />
|
||||||
|
<InfoItem label="设计人员" value="principalName" :data="info" />
|
||||||
|
<InfoItem label="审核人员" value="reviewerName" :data="info" />
|
||||||
|
<InfoItem label="创建时间" value="createTime" :data="info" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
@ -42,6 +42,9 @@
|
|||||||
<el-button type="warning" plain icon="Upload">导入</el-button>
|
<el-button type="warning" plain icon="Upload">导入</el-button>
|
||||||
</file-upload>
|
</file-upload>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" plain icon="Download" @click="exportFile">导出模版</el-button>
|
||||||
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
@ -607,6 +610,24 @@ const getVolumeFileList = async (type) => {
|
|||||||
fileList.value = res.rows;
|
fileList.value = res.rows;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const exportFile = () => {
|
||||||
|
// 导出模版文件
|
||||||
|
try {
|
||||||
|
// 创建a标签
|
||||||
|
const link = document.createElement('a');
|
||||||
|
// 设置PDF文件路径 - 相对于public目录
|
||||||
|
link.href = '/catalog.xlsx';
|
||||||
|
// 设置下载后的文件名
|
||||||
|
link.download = '设计出图计划导入模版.xlsx';
|
||||||
|
// 触发点击
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
// 清理
|
||||||
|
document.body.removeChild(link);
|
||||||
|
} catch (error) {
|
||||||
|
alert('下载失败,请重试');
|
||||||
|
}
|
||||||
|
};
|
||||||
// 切换
|
// 切换
|
||||||
const handleClick = (val) => {
|
const handleClick = (val) => {
|
||||||
getVolumeFileList(val.props.name);
|
getVolumeFileList(val.props.name);
|
||||||
|
@ -46,6 +46,9 @@
|
|||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain icon="Plus" @click="handleAdd()" v-hasPermi="['formalities:listOfFormalities:add']">新增</el-button>
|
||||||
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
@ -213,6 +216,28 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<el-dialog title="新增合规性手续合账" v-model="templateVisbile" width="450">
|
||||||
|
<el-form-item label="合规性手续模板">
|
||||||
|
<el-cascader
|
||||||
|
v-model="tempValue"
|
||||||
|
:options="tempTreeList"
|
||||||
|
:props="{
|
||||||
|
multiple: true,
|
||||||
|
value: 'id',
|
||||||
|
label: 'name',
|
||||||
|
disabled: (node: any) => {
|
||||||
|
return (node.pid == 0 && !node.children.length) || node.status == 1; // 有 parent 的是二级,没有 parent 的是一级,禁用一级
|
||||||
|
}
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<template #footer>
|
||||||
|
<span>
|
||||||
|
<el-button @click="templateVisbile = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="setTemp">确定</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -225,7 +250,8 @@ import {
|
|||||||
updateFormalitiesAreConsolidated,
|
updateFormalitiesAreConsolidated,
|
||||||
listFormalitiesAnnex,
|
listFormalitiesAnnex,
|
||||||
delFormalitiesAnnex,
|
delFormalitiesAnnex,
|
||||||
editStatus
|
editStatus,
|
||||||
|
getTemplateTreeList
|
||||||
} from '@/api/formalities/formalitiesAreConsolidated';
|
} from '@/api/formalities/formalitiesAreConsolidated';
|
||||||
import {
|
import {
|
||||||
FormalitiesAreConsolidatedVO,
|
FormalitiesAreConsolidatedVO,
|
||||||
@ -272,6 +298,8 @@ const statusForm = ref({
|
|||||||
projectId: currentProject.value?.id,
|
projectId: currentProject.value?.id,
|
||||||
processingStatus: undefined
|
processingStatus: undefined
|
||||||
});
|
});
|
||||||
|
const templateVisbile = ref(false);
|
||||||
|
const tempTreeList = ref([]);
|
||||||
|
|
||||||
const initFormData: FormalitiesAreConsolidatedForm = {
|
const initFormData: FormalitiesAreConsolidatedForm = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
@ -307,6 +335,8 @@ const data = reactive<PageData<FormalitiesAreConsolidatedForm, FormalitiesAreCon
|
|||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
const tempValue = ref(null);
|
||||||
|
|
||||||
/** 查询合规性手续合账列表 */
|
/** 查询合规性手续合账列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
@ -367,6 +397,39 @@ const handleUpdate = async (row?: FormalitiesAreConsolidatedVO) => {
|
|||||||
dialog.title = '修改合规性手续合账';
|
dialog.title = '修改合规性手续合账';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//新增
|
||||||
|
const handleAdd = async () => {
|
||||||
|
tempValue.value = null;
|
||||||
|
const res = await getTemplateTreeList({ projectId: currentProject.value.id });
|
||||||
|
tempTreeList.value = res.data;
|
||||||
|
templateVisbile.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 选择模板
|
||||||
|
const setTemp = async () => {
|
||||||
|
// form.value.formalitiesPid = tempValue.value[tempValue.value.length - 1];
|
||||||
|
if (!tempValue.value || !tempValue.value.length) {
|
||||||
|
proxy?.$modal.msgWarning('请选择模板');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let addBusFormalitiesAreConsolidatedBos = tempValue.value.map((item) => {
|
||||||
|
return {
|
||||||
|
formalitiesId: item[1],
|
||||||
|
formalitiesPid: item[0]
|
||||||
|
};
|
||||||
|
});
|
||||||
|
const data = {
|
||||||
|
addBusFormalitiesAreConsolidatedBos,
|
||||||
|
projectId: currentProject.value.id
|
||||||
|
};
|
||||||
|
const res = await addFormalitiesAreConsolidated(data);
|
||||||
|
if (res.code == 200) {
|
||||||
|
proxy?.$modal.msgSuccess('操作成功');
|
||||||
|
templateVisbile.value = false;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/** 上传按钮操作 */
|
/** 上传按钮操作 */
|
||||||
const handleUpload = (row) => {
|
const handleUpload = (row) => {
|
||||||
form.value.id = row.id;
|
form.value.id = row.id;
|
||||||
|
@ -6,20 +6,44 @@
|
|||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5" :offset="0"><el-button type="primary"
|
<el-col :span="1.5" :offset="0"
|
||||||
v-hasPermi="['cailiaoshebei:materialbatchdemandplan:add']" size="default" @click="handleAdd"
|
><el-button
|
||||||
icon="FolderAdd" plain>新增</el-button></el-col>
|
type="primary"
|
||||||
<el-col :span="1.5" :offset="0"><el-button type="danger" size="default"
|
v-hasPermi="['cailiaoshebei:materialbatchdemandplan:add']"
|
||||||
v-hasPermi="['cailiaoshebei:materialbatchdemandplan:remove']" @click="handleDeleteBatch"
|
size="default"
|
||||||
icon="FolderDelete" plain>删除</el-button></el-col>
|
@click="handleAdd"
|
||||||
|
icon="FolderAdd"
|
||||||
|
plain
|
||||||
|
>新增</el-button
|
||||||
|
></el-col
|
||||||
|
>
|
||||||
|
<el-col :span="1.5" :offset="0"
|
||||||
|
><el-button
|
||||||
|
type="danger"
|
||||||
|
size="default"
|
||||||
|
v-hasPermi="['cailiaoshebei:materialbatchdemandplan:remove']"
|
||||||
|
@click="handleDeleteBatch"
|
||||||
|
:disabled="form.mrpBaseBo.status != 'draft'"
|
||||||
|
icon="FolderDelete"
|
||||||
|
plain
|
||||||
|
>删除</el-button
|
||||||
|
></el-col
|
||||||
|
>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-input v-model="batchNumber" placeholder="请输入批次号" @input="searchBatchList" prefix-icon="Search"
|
<el-input v-model="batchNumber" placeholder="请输入批次号" @input="searchBatchList" prefix-icon="Search" clearable />
|
||||||
clearable />
|
<el-tree
|
||||||
<el-tree ref="batchTreeRef" class="mt-2" node-key="id" :data="batchOptions"
|
ref="batchTreeRef"
|
||||||
:props="{ label: 'planCode', children: 'children' }" :expand-on-click-node="false" highlight-current
|
class="mt-2"
|
||||||
default-expand-all @node-click="handleNodeClick">
|
node-key="id"
|
||||||
|
:data="batchOptions"
|
||||||
|
:props="{ label: 'planCode', children: 'children' }"
|
||||||
|
:expand-on-click-node="false"
|
||||||
|
highlight-current
|
||||||
|
default-expand-all
|
||||||
|
@node-click="handleNodeClick"
|
||||||
|
>
|
||||||
<template #default="{ node, data }">
|
<template #default="{ node, data }">
|
||||||
<div class="custom-tree-node">
|
<div class="custom-tree-node">
|
||||||
{{ node.label }}
|
{{ node.label }}
|
||||||
@ -27,8 +51,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.batchData.pageNum"
|
<pagination
|
||||||
v-model:limit="queryParams.batchData.pageSize" @pagination="getList" layout="prev, pager, next,jumper" />
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.batchData.pageNum"
|
||||||
|
v-model:limit="queryParams.batchData.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
layout="prev, pager, next,jumper"
|
||||||
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="19">
|
<el-col :span="19">
|
||||||
@ -36,12 +66,14 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5" v-if="form.mrpBaseBo.status == 'draft'">
|
<el-col :span="1.5" v-if="form.mrpBaseBo.status == 'draft'">
|
||||||
<el-button type="primary" plain icon="Edit" @click="handleUpdata"
|
<el-button type="primary" plain icon="Edit" @click="handleUpdata" v-hasPermi="['cailiaoshebei:materialbatchdemandplan:edit']"
|
||||||
v-hasPermi="['cailiaoshebei:materialbatchdemandplan:edit']">修改</el-button>
|
>修改</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button plain type="warning" icon="Finished" @click="handleAudit()"
|
<el-button plain type="warning" icon="Finished" @click="handleAudit()" v-hasPermi="['cailiaoshebei:materialbatchdemandplan:query']"
|
||||||
v-hasPermi="['cailiaoshebei:materialbatchdemandplan:query']">审核</el-button>
|
>审核</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
@ -59,8 +91,13 @@
|
|||||||
<el-table-column label="需求到货时间" align="center" prop="arrivalTime" width="250" />
|
<el-table-column label="需求到货时间" align="center" prop="arrivalTime" width="250" />
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination v-show="mainTotal > 0" :total="mainTotal" v-model:page="queryParams.mainData.pageNum"
|
<pagination
|
||||||
v-model:limit="queryParams.mainData.pageSize" @pagination="getMainList" />
|
v-show="mainTotal > 0"
|
||||||
|
:total="mainTotal"
|
||||||
|
v-model:page="queryParams.mainData.pageNum"
|
||||||
|
v-model:limit="queryParams.mainData.pageSize"
|
||||||
|
@pagination="getMainList"
|
||||||
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -77,8 +114,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" :offset="0">
|
<el-col :span="8" :offset="0">
|
||||||
<el-form-item label="编制日期" prop="mrpBaseBo.preparedDate">
|
<el-form-item label="编制日期" prop="mrpBaseBo.preparedDate">
|
||||||
<el-date-picker v-model="form.mrpBaseBo.preparedDate" type="date" value-format="YYYY-MM-DD"
|
<el-date-picker v-model="form.mrpBaseBo.preparedDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择编制日期" />
|
||||||
placeholder="请选择编制日期" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" :offset="0">
|
<el-col :span="8" :offset="0">
|
||||||
@ -91,20 +127,20 @@
|
|||||||
<el-divider>主要信息</el-divider>
|
<el-divider>主要信息</el-divider>
|
||||||
<el-table :data="form.planList">
|
<el-table :data="form.planList">
|
||||||
<el-table-column prop="name" align="center" label="版本号 " width="150">
|
<el-table-column prop="name" align="center" label="版本号 " width="150">
|
||||||
|
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-select v-model="scope.row.versions" placeholder="请选择"
|
<el-select v-model="scope.row.versions" placeholder="请选择" @change="(val) => selectNameVersion(val, scope.row)">
|
||||||
@change="(val) => selectNameVersion(val, scope.row)">
|
<el-option v-for="item in versionList" :key="item.versions" :label="item.versions" :value="item.versions" />
|
||||||
|
|
||||||
<el-option v-for="item in versionList" :key="item.versions" :label="item.versions"
|
|
||||||
:value="item.versions" />
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="name" align="center" label="物资名称">
|
<el-table-column prop="name" align="center" label="物资名称">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-select :disabled="!scope.row.versions" v-model="scope.row.suppliespriceId" placeholder="请选择"
|
<el-select
|
||||||
@change="(val) => selectName(val, scope.row)">
|
:disabled="!scope.row.versions"
|
||||||
|
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-option v-for="item in nameList" :key="item.id" :label="item.name" :value="item.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
@ -125,14 +161,16 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="qs" align="center" label="质量标准" width="150">
|
<el-table-column prop="qs" align="center" label="质量标准" width="150">
|
||||||
|
<template #header> <span class="text-red">*</span> 质量标准 </template>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input v-model="scope.row.qs" placeholder="请输入质量标准" />
|
<el-input v-model="scope.row.qs" placeholder="请输入质量标准" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="arrivalTime" align="center" label="需求到货时间">
|
<el-table-column prop="arrivalTime" align="center" label="需求到货时间">
|
||||||
|
<template #header> <span class="text-red">*</span> 需求到货时间 </template>
|
||||||
|
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-date-picker v-model="scope.row.arrivalTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择"
|
<el-date-picker v-model="scope.row.arrivalTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择" style="width: 140px" />
|
||||||
style="width: 140px" />
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="remark" align="center" label="备注" width="150">
|
<el-table-column prop="remark" align="center" label="备注" width="150">
|
||||||
@ -165,8 +203,10 @@ import {
|
|||||||
listBatch,
|
listBatch,
|
||||||
getBatch,
|
getBatch,
|
||||||
delBatch,
|
delBatch,
|
||||||
listSelectCailiaoshebei, obtainTheVersion,
|
listSelectCailiaoshebei,
|
||||||
getDictList, coryEngineeringList
|
obtainTheVersion,
|
||||||
|
getDictList,
|
||||||
|
coryEngineeringList
|
||||||
} from '@/api/materials/batchPlan';
|
} from '@/api/materials/batchPlan';
|
||||||
import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/batchPlan/types';
|
import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/batchPlan/types';
|
||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
@ -392,11 +432,11 @@ const handleUpdata = () => {
|
|||||||
/** 提交数据 */
|
/** 提交数据 */
|
||||||
const submitTransferForm = async () => {
|
const submitTransferForm = async () => {
|
||||||
const result = validateAndClean(form.value.planList);
|
const result = validateAndClean(form.value.planList);
|
||||||
console.log('🚀 ~ submitTransferForm ~ form.value.planList:', form.value.planList);
|
|
||||||
if (!result.valid) {
|
if (!result.valid) {
|
||||||
proxy?.$modal.msgError('验证失败,主要信息存在部分字段缺失的数据项');
|
proxy?.$modal.msgError(result.message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cailiaoshebeiFormRef.value?.validate(async (valid: boolean) => {
|
cailiaoshebeiFormRef.value?.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
buttonLoading.value = true;
|
buttonLoading.value = true;
|
||||||
@ -408,7 +448,6 @@ const submitTransferForm = async () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 删除批次 */
|
/** 删除批次 */
|
||||||
const handleDeleteBatch = async () => {
|
const handleDeleteBatch = async () => {
|
||||||
const _ids = batchTreeRef.value.getCurrentNode()?.id;
|
const _ids = batchTreeRef.value.getCurrentNode()?.id;
|
||||||
@ -419,29 +458,49 @@ const handleDeleteBatch = async () => {
|
|||||||
await getList();
|
await getList();
|
||||||
};
|
};
|
||||||
|
|
||||||
//检测主要信息填写状况
|
interface ValidateResult {
|
||||||
function validateAndClean(arr) {
|
valid: boolean;
|
||||||
|
data: any[];
|
||||||
|
errors: { index: number; field: string; message: string }[];
|
||||||
|
}
|
||||||
|
|
||||||
|
function validateAndClean(arr: any[]) {
|
||||||
// 过滤掉全空的数据项
|
// 过滤掉全空的数据项
|
||||||
const cleanedArr = arr.filter((item) => !Object.values(item).every((v) => v === '' || v == null));
|
const cleanedArr = arr.filter((item) => !Object.values(item).every((v) => v === '' || v == null));
|
||||||
let hasFullItem = false; // 是否有一条全填数据
|
|
||||||
|
|
||||||
for (const item of cleanedArr) {
|
let hasFullItem = false; // 是否有至少一条全填数据
|
||||||
|
|
||||||
|
for (let idx = 0; idx < cleanedArr.length; idx++) {
|
||||||
|
const item = cleanedArr[idx];
|
||||||
const keys = Object.keys(item).filter((k) => k !== 'remark' && k !== 'id');
|
const keys = Object.keys(item).filter((k) => k !== 'remark' && k !== 'id');
|
||||||
|
|
||||||
const allFilled = keys.every((k) => item[k] !== '' && item[k] != null);
|
const allFilled = keys.every((k) => item[k] !== '' && item[k] != null);
|
||||||
if (allFilled) {
|
|
||||||
hasFullItem = true; // 有一条全填
|
|
||||||
}
|
|
||||||
const allEmpty = Object.values(item).every((v) => v === '' || v == null);
|
const allEmpty = Object.values(item).every((v) => v === '' || v == null);
|
||||||
// 如果不是全填,也不是全空(部分填) → 直接返回失败
|
|
||||||
|
// 单独检查 qs 和 arrivalTime
|
||||||
|
if (!item.qs) {
|
||||||
|
return { valid: false, message: `第${idx + 1}行:质量标准不能为空`, data: cleanedArr };
|
||||||
|
}
|
||||||
|
if (!item.arrivalTime) {
|
||||||
|
return { valid: false, message: `第${idx + 1}行:需求到货时间不能为空`, data: cleanedArr };
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查其他字段是否部分填
|
||||||
if (!allFilled && !allEmpty) {
|
if (!allFilled && !allEmpty) {
|
||||||
return { valid: false, data: cleanedArr };
|
return { valid: false, message: `第${idx + 1}行:主要信息存在部分字段缺失的数据项`, data: cleanedArr };
|
||||||
|
}
|
||||||
|
|
||||||
|
if (allFilled) {
|
||||||
|
hasFullItem = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 如果没有至少一条全填,返回失败
|
|
||||||
|
// 检查是否至少有一条完整的数据
|
||||||
if (!hasFullItem) {
|
if (!hasFullItem) {
|
||||||
return { valid: false, data: cleanedArr };
|
return { valid: false, message: '至少需要一条完整的数据', data: cleanedArr };
|
||||||
}
|
}
|
||||||
return { valid: true, data: cleanedArr };
|
|
||||||
|
return { valid: true, message: '', data: cleanedArr };
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 审核按钮操作 */
|
/** 审核按钮操作 */
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-2">
|
<div class="p-2">
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter"
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
:leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
||||||
<div v-show="showSearch" class="mb-[10px]">
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||||
@ -12,8 +11,7 @@
|
|||||||
<el-input v-model="queryParams.projectName" placeholder="请输入工程名称" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.projectName" placeholder="请输入工程名称" clearable @keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="材料名称" prop="materialName">
|
<el-form-item label="材料名称" prop="materialName">
|
||||||
<el-input v-model="queryParams.materialName" placeholder="请输入设备材料名称" clearable
|
<el-input v-model="queryParams.materialName" placeholder="请输入设备材料名称" clearable @keyup.enter="handleQuery" />
|
||||||
@keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="合同名称" prop="contractName">
|
<el-form-item label="合同名称" prop="contractName">
|
||||||
<el-input v-model="queryParams.contractName" placeholder="请输入合同名称" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.contractName" placeholder="请输入合同名称" clearable @keyup.enter="handleQuery" />
|
||||||
@ -25,11 +23,8 @@
|
|||||||
<el-input v-model="queryParams.supplierUnit" placeholder="请输入供货单位" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.supplierUnit" placeholder="请输入供货单位" clearable @keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" v-hasPermi="['materials:materialReceive:list']" icon="Search"
|
<el-button type="primary" v-hasPermi="['materials:materialReceive:list']" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
@click="handleQuery">搜索</el-button>
|
<el-button icon="Refresh" v-hasPermi="['materials:materialReceive:list']" @click="resetQuery">重置</el-button>
|
||||||
|
|
||||||
<el-button icon="Refresh" v-hasPermi="['materials:materialReceive:list']"
|
|
||||||
@click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
@ -40,12 +35,18 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['materials:materialReceive:add']">新增</el-button>
|
||||||
v-hasPermi="['materials:materialReceive:add']">新增</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
|
<el-button
|
||||||
v-hasPermi="['materials:materialReceive:remove']">删除</el-button>
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="Delete"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete()"
|
||||||
|
v-hasPermi="['materials:materialReceive:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -68,22 +69,23 @@
|
|||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip content="查看" placement="top">
|
<el-tooltip content="查看" placement="top">
|
||||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)"
|
<el-button link type="primary" icon="View" @click="handleView(scope.row)" v-hasPermi="['materials:materialReceive:query']"></el-button>
|
||||||
v-hasPermi="['materials:materialReceive:query']"></el-button>
|
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<!-- <el-tooltip content="修改" placement="top">
|
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['materials:materialReceive:edit']"></el-button>
|
|
||||||
</el-tooltip> -->
|
|
||||||
<el-tooltip content="删除" placement="top">
|
<el-tooltip content="删除" placement="top">
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
<el-button
|
||||||
v-hasPermi="['materials:materialReceive:remove']"></el-button>
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['materials:materialReceive:remove']"
|
||||||
|
></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- 添加或修改物料接收单对话框 -->
|
<!-- 添加或修改物料接收单对话框 -->
|
||||||
<el-dialog draggable :title="dialog.title" v-model="dialog.visible" width="800px" append-to-body>
|
<el-dialog draggable :title="dialog.title" v-model="dialog.visible" width="800px" append-to-body>
|
||||||
<el-form ref="materialReceiveFormRef" :model="form" :rules="rules" label-width="110px">
|
<el-form ref="materialReceiveFormRef" :model="form" :rules="rules" label-width="110px">
|
||||||
@ -92,7 +94,7 @@
|
|||||||
<el-form-item label="材料来源" prop="materialSource">
|
<el-form-item label="材料来源" prop="materialSource">
|
||||||
<el-select v-model="form.materialSource" filterable placeholder="请选择材料来源" style="width: 100%">
|
<el-select v-model="form.materialSource" filterable placeholder="请选择材料来源" style="width: 100%">
|
||||||
<el-option label="甲供材料" value="1"></el-option>
|
<el-option label="甲供材料" value="1"></el-option>
|
||||||
<el-option label="已供材料" value="2"></el-option>
|
<el-option label="乙供材料" value="2"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -101,23 +103,26 @@
|
|||||||
<el-input v-model="form.formCode" placeholder="请输入表单编号" />
|
<el-input v-model="form.formCode" placeholder="请输入表单编号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12"><el-form-item label="采购单编号" prop="docId"><el-select @change="handleSelect"
|
<el-col v-if="form.materialSource == '2'" :span="12">
|
||||||
v-model="form.docId" filterable placeholder="请选择采购单" style="width: 100%">
|
<el-form-item label="采购单编号" prop="docId">
|
||||||
<el-option v-for="item in purchaseDocList" :key="item.id" :label="item.docCode"
|
<el-select @change="handleSelect" v-model="form.docId" filterable placeholder="请选择采购单" style="width: 100%">
|
||||||
:value="item.id"></el-option> </el-select></el-form-item>
|
<el-option v-for="item in purchaseDocList" :key="item.id" :label="item.docCode" :value="item.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col v-if="form.materialSource == '2'" :span="12">
|
||||||
<el-form-item label="供货单位" prop="supplierUnit">
|
<el-form-item label="供货单位" prop="supplierUnit">
|
||||||
<el-input disabled v-model="form.supplierUnit" placeholder="请输入供货单位" />
|
<el-input disabled v-model="form.supplierUnit" placeholder="请输入供货单位" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col v-if="form.materialSource == '2'" :span="12">
|
||||||
<el-form-item label="订货单位" prop="orderingUnit">
|
<el-form-item label="订货单位" prop="orderingUnit">
|
||||||
<el-input v-model="form.orderingUnit" placeholder="请输入订货单位" />
|
<el-input v-model="form.orderingUnit" placeholder="请输入订货单位" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12"><el-form-item label="工程名称" prop="projectName">
|
<el-col :span="12">
|
||||||
<el-input v-model="form.projectName" placeholder="请输入工程名称" />
|
<el-form-item label="工程名称" prop="projectName">
|
||||||
|
<el-input disabled v-model="form.projectName" placeholder="请输入工程名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -130,65 +135,79 @@
|
|||||||
<el-input v-model="form.defectDescription" type="textarea" placeholder="请输入内容" />
|
<el-input v-model="form.defectDescription" type="textarea" placeholder="请输入内容" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 数量验收区域(修复v-for key问题) -->
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<div class="detail">
|
<div class="detail">
|
||||||
<div class="detail-header">
|
<div class="detail-header">
|
||||||
<span>数量验收</span>
|
<span>数量验收</span>
|
||||||
<!-- <el-button type="primary" link @click="addItem" icon="Plus">添加数量验收</el-button> -->
|
<el-button type="primary" v-if="form.materialSource == '1'" link @click="addItem" icon="Plus">添加数量验收</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-for="(item, index) in form.itemList" :key="index" class="detail-item">
|
<!-- 关键修复:v-for key改为item.id(唯一标识),而非index -->
|
||||||
|
<div v-for="(item, index) in form.itemList" :key="item.id" class="detail-item">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item disabled label="名称" :prop="`itemList.${index}.name`"
|
<el-form-item label="名称" :prop="`itemList.${index}.name`" :rules="{ required: true, message: '名称不能为空', trigger: 'blur' }">
|
||||||
:rules="{ required: true, message: '名称不能为空', trigger: 'blur' }">
|
<el-input :disabled="form.materialSource == '2'" v-model="item.name" placeholder="请输入名称" />
|
||||||
<el-input disabled v-model="item.name" placeholder="请输入名称" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="规格" :prop="`itemList.${index}.specification`"
|
<el-form-item
|
||||||
:rules="{ required: true, message: '规格不能为空', trigger: 'blur' }">
|
label="规格"
|
||||||
<el-input disabled v-model="item.specification" placeholder="请输入规格" />
|
:prop="`itemList.${index}.specification`"
|
||||||
|
:rules="{ required: true, message: '规格不能为空', trigger: 'blur' }"
|
||||||
|
>
|
||||||
|
<el-input :disabled="form.materialSource == '2'" v-model="item.specification" placeholder="请输入规格" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="单位" :prop="`itemList.${index}.unit`"
|
<el-form-item label="单位" :prop="`itemList.${index}.unit`" :rules="{ required: true, message: '单位不能为空', trigger: 'blur' }">
|
||||||
:rules="{ required: true, message: '单位不能为空', trigger: 'blur' }">
|
<el-input :disabled="form.materialSource == '2'" v-model="item.unit" placeholder="请输入单位" />
|
||||||
<el-input disabled v-model="item.unit" placeholder="请输入单位" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="数量" :prop="`itemList.${index}.quantity`"
|
<el-form-item
|
||||||
:rules="{ required: true, message: '数量不能为空', trigger: 'blur' }">
|
label="数量"
|
||||||
<el-input disabled type="number" v-model="item.quantity" placeholder="请输入数量" />
|
:prop="`itemList.${index}.quantity`"
|
||||||
|
:rules="{ required: true, message: '数量不能为空', trigger: 'blur' }"
|
||||||
|
>
|
||||||
|
<el-input :disabled="form.materialSource == '2'" type="number" v-model="item.quantity" placeholder="请输入数量" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="验收" :prop="`itemList.${index}.acceptedQuantity`"
|
<el-form-item
|
||||||
:rules="{ required: true, message: '验收数量不能为空', trigger: 'blur' }">
|
label="验收"
|
||||||
|
: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-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="缺件" :prop="`itemList.${index}.shortageQuantity`"
|
<el-form-item
|
||||||
:rules="{ required: true, message: '缺件数量不能为空', trigger: 'blur' }">
|
label="缺件"
|
||||||
|
:prop="`itemList.${index}.shortageQuantity`"
|
||||||
|
:rules="{ required: true, message: '缺件数量不能为空', trigger: 'blur' }"
|
||||||
|
>
|
||||||
<el-input type="number" v-model="item.shortageQuantity" placeholder="自动计算(数量-验收数量)" readonly />
|
<el-input type="number" v-model="item.shortageQuantity" placeholder="自动计算(数量-验收数量)" readonly />
|
||||||
<span class="tips">*自动计算(数量-验收数量)</span>
|
<span class="tips">*自动计算(数量-验收数量)</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" :prop="`itemList.${index}.remark`">
|
||||||
<el-input v-model="item.remark" placeholder="请输入备注" />
|
<el-input v-model="item.remark" placeholder="请输入备注" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="12" v-if="form.itemList.length > 1">
|
<el-col :span="12" v-if="form.itemList.length > 1 && form.materialSource == '1'">
|
||||||
<div class="item-actions">
|
<div class="item-actions">
|
||||||
<el-button type="danger" link @click="removeItem(index)" icon="Delete">删除</el-button>
|
<el-button type="danger" link @click="removeItem(index)" icon="Delete">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-col> -->
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="合格证文件" prop="certCountFileId">
|
<el-form-item label="合格证文件" prop="certCountFileId">
|
||||||
<file-upload :isShowTip="false" v-model="form.certCountFileId" />
|
<file-upload :isShowTip="false" v-model="form.certCountFileId" />
|
||||||
@ -210,22 +229,10 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<span
|
<span style="color: #ff0000ab; margin-bottom: 10px; display: block">注意:请上传doc/xls/ppt/txt/pdf/png/jpg/jpeg/zip格式文件</span>
|
||||||
style="color: #ff0000ab; margin-bottom: 10px; display: block">注意:请上传doc/xls/ppt/txt/pdf/png/jpg/jpeg/zip格式文件</span>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="设备材料入库/移交" prop="storageType">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-radio-group v-model="form.storageType">
|
|
||||||
<el-radio v-for="dict in storage_type.slice(0, 1)" :key="dict.value" :label="dict.value">
|
|
||||||
{{ dict.label }}
|
|
||||||
</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
<!-- <el-checkbox-group v-model="form.storageType">
|
|
||||||
<el-checkbox v-for="dict in storage_type" :key="dict.value" :label="dict.value">
|
|
||||||
{{ dict.label }}
|
|
||||||
</el-checkbox>
|
|
||||||
</el-checkbox-group> -->
|
|
||||||
</el-form-item> </el-col><el-col :span="24"><el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -254,15 +261,19 @@ import { MaterialReceiveVO, MaterialReceiveQuery, MaterialReceiveForm } from '@/
|
|||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
import wordllReceive from './word/index.vue';
|
import wordllReceive from './word/index.vue';
|
||||||
import { listPurchaseDoc, purchaseDocPlanList } from '@/api/materials/purchaseDoc';
|
import { listPurchaseDoc, purchaseDocPlanList } from '@/api/materials/purchaseDoc';
|
||||||
import { watch } from 'vue';
|
import { watch, onMounted, onUnmounted, ref, reactive, computed, toRefs, getCurrentInstance } from 'vue';
|
||||||
|
import type { ComponentInternalInstance, ElFormInstance, DialogOption } from 'element-plus';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
const { storage_type } = toRefs<any>(proxy?.useDict('storage_type'));
|
const { storage_type } = toRefs<any>(proxy?.useDict('storage_type'));
|
||||||
// 获取用户 store
|
|
||||||
const userStore = useUserStoreHook();
|
const userStore = useUserStoreHook();
|
||||||
// 从 store 中获取项目列表和当前选中的项目
|
|
||||||
const currentProject = computed(() => userStore.selectedProject);
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
const wordllReceiveRef = ref<InstanceType<typeof wordllReceive>>();
|
const wordllReceiveRef = ref<InstanceType<typeof wordllReceive>>();
|
||||||
|
|
||||||
|
// 核心修复1:存储每个验收条目的watch停止函数,避免内存泄漏
|
||||||
|
const itemWatchStopFns = ref<Array<() => void>>([]);
|
||||||
|
|
||||||
|
// 列表数据
|
||||||
const materialReceiveList = ref<MaterialReceiveVO[]>([]);
|
const materialReceiveList = ref<MaterialReceiveVO[]>([]);
|
||||||
const buttonLoading = ref(false);
|
const buttonLoading = ref(false);
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
@ -272,15 +283,25 @@ const single = ref(true);
|
|||||||
const multiple = ref(true);
|
const multiple = ref(true);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
|
|
||||||
|
// 表单引用
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
const materialReceiveFormRef = ref<ElFormInstance>();
|
const materialReceiveFormRef = ref<ElFormInstance>();
|
||||||
const purchaseDocList = ref([]); //物资采购单
|
const purchaseDocList = ref([]); // 物资采购单列表
|
||||||
const purchaseMap = new Map();
|
const purchaseMap = new Map(); // 采购单映射(id -> 采购单对象)
|
||||||
|
|
||||||
|
// 对话框配置
|
||||||
const dialog = reactive<DialogOption>({
|
const dialog = reactive<DialogOption>({
|
||||||
visible: false,
|
visible: false,
|
||||||
title: ''
|
title: ''
|
||||||
});
|
});
|
||||||
const getInitFormData = () => {
|
|
||||||
|
// 生成验收条目唯一ID(用于v-for key)
|
||||||
|
const generateItemId = () => {
|
||||||
|
return Date.now() + Math.random().toString(36).substr(2, 9);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 初始化表单数据(修复:给验收条目添加唯一ID)
|
||||||
|
const getInitFormData = (): MaterialReceiveForm => {
|
||||||
return {
|
return {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
projectId: currentProject.value?.id,
|
projectId: currentProject.value?.id,
|
||||||
@ -300,12 +321,13 @@ const getInitFormData = () => {
|
|||||||
techDocCountFileId: undefined,
|
techDocCountFileId: undefined,
|
||||||
licenseCount: undefined,
|
licenseCount: undefined,
|
||||||
licenseCountFileId: undefined,
|
licenseCountFileId: undefined,
|
||||||
storageType: '',
|
storageType: '1',
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
docId: undefined,
|
docId: undefined,
|
||||||
docCode: undefined,
|
docCode: undefined,
|
||||||
itemList: [
|
itemList: [
|
||||||
{
|
{
|
||||||
|
id: generateItemId(), // 新增:唯一ID,解决v-for渲染问题
|
||||||
name: undefined,
|
name: undefined,
|
||||||
specification: undefined,
|
specification: undefined,
|
||||||
unit: undefined,
|
unit: undefined,
|
||||||
@ -317,7 +339,8 @@ const getInitFormData = () => {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
const initFormData: MaterialReceiveForm = {};
|
|
||||||
|
// 响应式数据
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: getInitFormData(),
|
form: getInitFormData(),
|
||||||
queryParams: {
|
queryParams: {
|
||||||
@ -334,17 +357,10 @@ const data = reactive({
|
|||||||
params: {}
|
params: {}
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
// 物资采购单
|
|
||||||
docId: [{ required: true, message: '请选择物资采购单', trigger: 'change' }],
|
|
||||||
// 材料来源
|
|
||||||
materialSource: [{ required: true, message: '请选择材料来源', trigger: 'change' }],
|
materialSource: [{ required: true, message: '请选择材料来源', trigger: 'change' }],
|
||||||
// 表单编号
|
|
||||||
formCode: [{ required: true, message: '请输入表单编号', trigger: 'blur' }],
|
formCode: [{ required: true, message: '请输入表单编号', trigger: 'blur' }],
|
||||||
// 采购单编号
|
docId: [{ required: true, message: '请选择物资采购单', trigger: 'change' }],
|
||||||
docCode: [{ required: true, message: '请输入采购单编号', trigger: 'blur' }],
|
|
||||||
// 供货单位
|
|
||||||
supplierUnit: [{ required: true, message: '请输入供货单位', trigger: 'blur' }],
|
supplierUnit: [{ required: true, message: '请输入供货单位', trigger: 'blur' }],
|
||||||
// 订货单位
|
|
||||||
orderingUnit: [{ required: true, message: '请输入订货单位', trigger: 'blur' }]
|
orderingUnit: [{ required: true, message: '请输入订货单位', trigger: 'blur' }]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -354,10 +370,13 @@ const { queryParams, form, rules } = toRefs(data);
|
|||||||
/** 查询物料接收单列表 */
|
/** 查询物料接收单列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const res = await listMaterialReceive(queryParams.value);
|
try {
|
||||||
materialReceiveList.value = res.rows;
|
const res = await listMaterialReceive(queryParams.value);
|
||||||
total.value = res.total;
|
materialReceiveList.value = res.rows;
|
||||||
loading.value = false;
|
total.value = res.total;
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 取消按钮 */
|
/** 取消按钮 */
|
||||||
@ -366,10 +385,19 @@ const cancel = () => {
|
|||||||
dialog.visible = false;
|
dialog.visible = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 表单重置 */
|
/** 表单重置(修复:清理验收条目监听) */
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
|
// 停止所有验收条目的watch监听
|
||||||
|
itemWatchStopFns.value.forEach((stopFn) => stopFn());
|
||||||
|
itemWatchStopFns.value = [];
|
||||||
|
|
||||||
form.value = getInitFormData();
|
form.value = getInitFormData();
|
||||||
materialReceiveFormRef.value?.resetFields();
|
materialReceiveFormRef.value?.resetFields();
|
||||||
|
|
||||||
|
// 重新监听初始条目
|
||||||
|
if (form.value.itemList.length > 0) {
|
||||||
|
watchItemChanges(0);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
@ -387,7 +415,7 @@ const resetQuery = () => {
|
|||||||
/** 多选框选中数据 */
|
/** 多选框选中数据 */
|
||||||
const handleSelectionChange = (selection: MaterialReceiveVO[]) => {
|
const handleSelectionChange = (selection: MaterialReceiveVO[]) => {
|
||||||
ids.value = selection.map((item) => item.id);
|
ids.value = selection.map((item) => item.id);
|
||||||
single.value = selection.length != 1;
|
single.value = selection.length !== 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -396,25 +424,34 @@ const handleAdd = () => {
|
|||||||
reset();
|
reset();
|
||||||
dialog.visible = true;
|
dialog.visible = true;
|
||||||
dialog.title = '添加物料接收单';
|
dialog.title = '添加物料接收单';
|
||||||
// 为初始条目添加监听
|
form.value.projectName = currentProject.value?.name;
|
||||||
if (form.value.itemList.length > 0) {
|
|
||||||
watchItemChanges(0);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作(修复:清理旧监听+添加唯一ID) */
|
||||||
const handleUpdate = async (row?: MaterialReceiveVO) => {
|
const handleUpdate = async (row?: MaterialReceiveVO) => {
|
||||||
reset();
|
reset();
|
||||||
const _id = row?.id || ids.value[0];
|
const _id = row?.id || ids.value[0];
|
||||||
const res = await getMaterialReceive(_id);
|
|
||||||
Object.assign(form.value, res.data);
|
|
||||||
// 为每个条目添加监听
|
|
||||||
form.value.itemList.forEach((_, index) => {
|
|
||||||
watchItemChanges(index);
|
|
||||||
});
|
|
||||||
|
|
||||||
dialog.visible = true;
|
try {
|
||||||
dialog.title = '修改物料接收单';
|
const res = await getMaterialReceive(_id);
|
||||||
|
// 给验收条目补充唯一ID(避免后端返回无ID)
|
||||||
|
const formData = res.data;
|
||||||
|
formData.itemList = formData.itemList.map((item) => ({
|
||||||
|
...item,
|
||||||
|
id: item.id || generateItemId()
|
||||||
|
}));
|
||||||
|
Object.assign(form.value, formData);
|
||||||
|
|
||||||
|
// 重新监听所有条目
|
||||||
|
form.value.itemList.forEach((_, index) => {
|
||||||
|
watchItemChanges(index);
|
||||||
|
});
|
||||||
|
|
||||||
|
dialog.visible = true;
|
||||||
|
dialog.title = '修改物料接收单';
|
||||||
|
} catch (err) {
|
||||||
|
proxy?.$modal.msgError('获取详情失败');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
@ -422,14 +459,20 @@ const submitForm = () => {
|
|||||||
materialReceiveFormRef.value?.validate(async (valid: boolean) => {
|
materialReceiveFormRef.value?.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
buttonLoading.value = true;
|
buttonLoading.value = true;
|
||||||
if (form.value.id) {
|
try {
|
||||||
await updateMaterialReceive({ ...form.value }).finally(() => (buttonLoading.value = false));
|
if (form.value.id) {
|
||||||
} else {
|
await updateMaterialReceive({ ...form.value });
|
||||||
await addMaterialReceive({ ...form.value }).finally(() => (buttonLoading.value = false));
|
} else {
|
||||||
|
await addMaterialReceive({ ...form.value });
|
||||||
|
}
|
||||||
|
proxy?.$modal.msgSuccess('操作成功');
|
||||||
|
dialog.visible = false;
|
||||||
|
await getList();
|
||||||
|
} catch (err) {
|
||||||
|
proxy?.$modal.msgError('操作失败');
|
||||||
|
} finally {
|
||||||
|
buttonLoading.value = false;
|
||||||
}
|
}
|
||||||
proxy?.$modal.msgSuccess('操作成功');
|
|
||||||
dialog.visible = false;
|
|
||||||
await getList();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -437,15 +480,24 @@ const submitForm = () => {
|
|||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
const handleDelete = async (row?: MaterialReceiveVO) => {
|
const handleDelete = async (row?: MaterialReceiveVO) => {
|
||||||
const _ids = row?.id || ids.value;
|
const _ids = row?.id || ids.value;
|
||||||
await proxy?.$modal.confirm('是否确认删除物料接收单编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
if (!_ids.length) return;
|
||||||
await delMaterialReceive(_ids);
|
|
||||||
proxy?.$modal.msgSuccess('删除成功');
|
try {
|
||||||
await getList();
|
await proxy?.$modal.confirm(`是否确认删除物料接收单编号为"${_ids}"的数据项?`);
|
||||||
|
await delMaterialReceive(_ids);
|
||||||
|
proxy?.$modal.msgSuccess('删除成功');
|
||||||
|
await getList();
|
||||||
|
} catch (err) {
|
||||||
|
// 取消删除时不提示
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 添加数量验收条目
|
/** 添加数量验收条目(修复:添加唯一ID+监听) */
|
||||||
const addItem = () => {
|
const addItem = () => {
|
||||||
const newItem = {
|
const newItem = {
|
||||||
|
id: generateItemId(), // 唯一ID
|
||||||
name: undefined,
|
name: undefined,
|
||||||
specification: undefined,
|
specification: undefined,
|
||||||
unit: undefined,
|
unit: undefined,
|
||||||
@ -455,110 +507,190 @@ const addItem = () => {
|
|||||||
remark: undefined
|
remark: undefined
|
||||||
};
|
};
|
||||||
form.value.itemList.push(newItem);
|
form.value.itemList.push(newItem);
|
||||||
// 监听新条目数据变化
|
// 监听新条目变化
|
||||||
watchItemChanges(form.value.itemList.length - 1);
|
watchItemChanges(form.value.itemList.length - 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 监听条目数据变化,自动计算缺件数量
|
/** 监听验收条目变化,自动计算缺件数量(修复:存储停止函数) */
|
||||||
const watchItemChanges = (index: number) => {
|
const watchItemChanges = (index: number) => {
|
||||||
watch(
|
// 停止该索引已有的监听(避免重复监听)
|
||||||
|
if (itemWatchStopFns.value[index]) {
|
||||||
|
itemWatchStopFns.value[index]();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 监听数量和验收数量变化
|
||||||
|
const stopFn = watch(
|
||||||
() => [form.value.itemList[index].quantity, form.value.itemList[index].acceptedQuantity],
|
() => [form.value.itemList[index].quantity, form.value.itemList[index].acceptedQuantity],
|
||||||
([quantity, acceptedQuantity]) => {
|
([quantity, acceptedQuantity]) => {
|
||||||
// 确保数量和验收数量都是数字
|
|
||||||
const qty = Number(quantity) || 0;
|
const qty = Number(quantity) || 0;
|
||||||
const acceptedQty = Number(acceptedQuantity) || 0;
|
const acceptedQty = Number(acceptedQuantity) || 0;
|
||||||
// 计算缺件数量(数量 - 验收数量)
|
|
||||||
form.value.itemList[index].shortageQuantity = qty - acceptedQty;
|
form.value.itemList[index].shortageQuantity = qty - acceptedQty;
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true } // 初始时立即计算
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 存储停止函数,用于后续删除时清理
|
||||||
|
itemWatchStopFns.value[index] = stopFn;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 删除数量验收条目
|
/** 删除数量验收条目(修复:清理监听+删除条目) */
|
||||||
const removeItem = (index: number) => {
|
const removeItem = (index: number) => {
|
||||||
if (form.value.itemList.length > 1) {
|
if (form.value.itemList.length <= 1) {
|
||||||
form.value.itemList.splice(index, 1);
|
|
||||||
} else {
|
|
||||||
proxy?.$modal.msgWarning('至少需要保留一条数量验收记录');
|
proxy?.$modal.msgWarning('至少需要保留一条数量验收记录');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 停止该条目的监听
|
||||||
|
if (itemWatchStopFns.value[index]) {
|
||||||
|
itemWatchStopFns.value[index]();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除条目和对应的停止函数
|
||||||
|
form.value.itemList.splice(index, 1);
|
||||||
|
itemWatchStopFns.value.splice(index, 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleView = (row) => {
|
/** 查看详情 */
|
||||||
// 查看详情
|
const handleView = (row: MaterialReceiveVO) => {
|
||||||
wordllReceiveRef.value?.openDialog(row);
|
wordllReceiveRef.value?.openDialog(row);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 查询物资-采购联系单列表 */
|
/** 查询物资-采购联系单列表 */
|
||||||
const getlistPurchase = async () => {
|
const getlistPurchase = async () => {
|
||||||
const res = await listPurchaseDoc({
|
try {
|
||||||
projectId: currentProject.value?.id,
|
const res = await listPurchaseDoc({
|
||||||
status: 'finish'
|
projectId: currentProject.value?.id,
|
||||||
});
|
status: 'finish'
|
||||||
|
});
|
||||||
purchaseDocList.value = res.rows;
|
purchaseDocList.value = res.rows;
|
||||||
if (purchaseDocList.value && purchaseDocList.value.length > 0) {
|
// 构建采购单映射
|
||||||
purchaseDocList.value.forEach((item) => {
|
purchaseDocList.value.forEach((item) => {
|
||||||
purchaseMap.set(item.id, item);
|
purchaseMap.set(item.id, item);
|
||||||
});
|
});
|
||||||
|
} catch (err) {
|
||||||
|
proxy?.$modal.msgError('获取采购单列表失败');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 通过采购单获取需求信息
|
/** 通过采购单获取需求信息(修复:清理旧监听+添加新监听) */
|
||||||
const getdemandInfo = async (docId: string) => {
|
const getdemandInfo = async (docId: string) => {
|
||||||
let res = await purchaseDocPlanList(docId);
|
if (!docId) return;
|
||||||
if (res.code == 200) {
|
|
||||||
// 需求表单赋值
|
try {
|
||||||
form.value.itemList = [];
|
const res = await purchaseDocPlanList(docId);
|
||||||
// form.value.itemList 清空
|
if (res.code === 200) {
|
||||||
console.log(form.value.itemList);
|
// 清空旧监听和条目
|
||||||
res.data.forEach((item, index) => {
|
itemWatchStopFns.value.forEach((stopFn) => stopFn());
|
||||||
let obj = {
|
itemWatchStopFns.value = [];
|
||||||
quantity: item.demandQuantity,
|
form.value.itemList = [];
|
||||||
acceptedQuantity: 0,
|
|
||||||
shortageQuantity: item.demandQuantity, // 初始化缺件数量为总数量
|
// 赋值需求数据并添加监听
|
||||||
planId: item.id,
|
res.data.forEach((item, index) => {
|
||||||
...item
|
const qty = Number(item.demandQuantity) || 0;
|
||||||
};
|
const newItem = {
|
||||||
obj.id = null;
|
id: generateItemId(), // 唯一ID
|
||||||
form.value.itemList.push(obj);
|
name: item.name,
|
||||||
// 监听每个条目的变化
|
specification: item.specification,
|
||||||
watchItemChanges(form.value.itemList.length - 1);
|
unit: item.unit,
|
||||||
});
|
quantity: qty,
|
||||||
|
acceptedQuantity: 0,
|
||||||
|
shortageQuantity: qty, // 初始缺件=总数量
|
||||||
|
remark: item.remark,
|
||||||
|
planId: item.id,
|
||||||
|
id: null // 保留后端需要的空id字段
|
||||||
|
};
|
||||||
|
form.value.itemList.push(newItem);
|
||||||
|
// 监听当前条目
|
||||||
|
watchItemChanges(index);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
proxy?.$modal.msgError('获取采购单需求信息失败');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSelect = (val) => {
|
/** 选择采购单触发 */
|
||||||
// 选择设备
|
const handleSelect = (val: string) => {
|
||||||
let obj = purchaseMap.get(val);
|
if (!val) return;
|
||||||
|
|
||||||
|
const obj = purchaseMap.get(val);
|
||||||
|
if (obj) {
|
||||||
|
form.value.docCode = obj.docCode || '';
|
||||||
|
form.value.supplierUnit = obj.supplier || '';
|
||||||
|
form.value.materialName = obj.name || '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取采购单对应的需求信息
|
||||||
getdemandInfo(val);
|
getdemandInfo(val);
|
||||||
form.value.docCode = obj?.docCode || '';
|
|
||||||
form.value.supplierUnit = obj?.supplier || '';
|
|
||||||
form.value.materialName = obj?.name || '';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** 核心修复2:监听材料来源变化,重置数量验收列表 */
|
||||||
|
watch(
|
||||||
|
() => form.value.materialSource,
|
||||||
|
(newSource, oldSource) => {
|
||||||
|
if (newSource === oldSource) return;
|
||||||
|
|
||||||
|
// 1. 停止所有验收条目的监听
|
||||||
|
itemWatchStopFns.value.forEach((stopFn) => stopFn());
|
||||||
|
itemWatchStopFns.value = [];
|
||||||
|
|
||||||
|
// 2. 重置数量验收列表为初始状态(1条空记录)
|
||||||
|
form.value.itemList = [
|
||||||
|
{
|
||||||
|
id: generateItemId(),
|
||||||
|
name: undefined,
|
||||||
|
specification: undefined,
|
||||||
|
unit: undefined,
|
||||||
|
quantity: undefined,
|
||||||
|
acceptedQuantity: undefined,
|
||||||
|
shortageQuantity: undefined,
|
||||||
|
remark: undefined
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
// 3. 重新监听初始条目
|
||||||
|
watchItemChanges(0);
|
||||||
|
|
||||||
|
// 4. 切换到乙供时,清空采购单相关数据
|
||||||
|
if (newSource === '2') {
|
||||||
|
form.value.docId = undefined;
|
||||||
|
form.value.supplierUnit = undefined;
|
||||||
|
form.value.materialName = undefined;
|
||||||
|
form.value.docCode = undefined;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
|
||||||
|
/** 页面挂载时初始化 */
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
getList();
|
||||||
getlistPurchase();
|
getlistPurchase();
|
||||||
// 为初始条目添加监听
|
// 监听初始验收条目
|
||||||
if (form.value.itemList.length > 0) {
|
if (form.value.itemList.length > 0) {
|
||||||
watchItemChanges(0);
|
watchItemChanges(0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 监听项目id刷新数据
|
/** 监听项目变化,刷新数据 */
|
||||||
const listeningProject = watch(
|
const listeningProject = watch(
|
||||||
() => currentProject.value?.id,
|
() => currentProject.value?.id,
|
||||||
(nid, oid) => {
|
(nid) => {
|
||||||
queryParams.value.projectId = nid;
|
queryParams.value.projectId = nid;
|
||||||
form.value.projectId = nid;
|
form.value.projectId = nid;
|
||||||
getList();
|
getList();
|
||||||
|
getlistPurchase();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** 页面卸载时清理监听 */
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
listeningProject();
|
listeningProject();
|
||||||
|
// 清理验收条目监听
|
||||||
|
itemWatchStopFns.value.forEach((stopFn) => stopFn());
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.detail {
|
.detail {
|
||||||
border-bottom: 1px solid #ececec;
|
border-bottom: 1px solid #ececec;
|
||||||
@ -599,4 +731,8 @@ onUnmounted(() => {
|
|||||||
color: #666;
|
color: #666;
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mb8 {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -268,6 +268,7 @@ import { listContractor } from '@/api/project/contractor';
|
|||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import logisticsDetail from './comm/logisticsDetail.vue';
|
import logisticsDetail from './comm/logisticsDetail.vue';
|
||||||
|
import { FormRules } from 'element-plus';
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -349,7 +350,7 @@ const data = reactive({
|
|||||||
status: undefined,
|
status: undefined,
|
||||||
params: {}
|
params: {}
|
||||||
},
|
},
|
||||||
rules: {
|
rules: <FormRules>{
|
||||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||||
docCode: [{ required: true, message: '采购单编号不能为空', trigger: 'blur' }],
|
docCode: [{ required: true, message: '采购单编号不能为空', trigger: 'blur' }],
|
||||||
planId: [{ required: true, message: '需求计划不能为空', trigger: 'blur' }],
|
planId: [{ required: true, message: '需求计划不能为空', trigger: 'blur' }],
|
||||||
|
@ -123,27 +123,27 @@
|
|||||||
check-strictly
|
check-strictly
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="计量方式" prop="unitType" v-if="!form.id">
|
<el-form-item label="计量方式" prop="unitType" v-if="!form.workType">
|
||||||
<el-select v-model="form.unitType" placeholder="请选择关联数据">
|
<el-select v-model="form.unitType" placeholder="请选择关联数据">
|
||||||
<el-option v-for="dict in progress_unit_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
<el-option v-for="dict in progress_unit_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="类别名称" prop="name">
|
<el-form-item label="类别名称" prop="name">
|
||||||
<el-input v-model="form.name" placeholder="请输入类别名称" :disabled="form.id != null" />
|
<el-input v-model="form.name" placeholder="请输入类别名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="计量单位" prop="unit">
|
<el-form-item label="计量单位" prop="unit" v-if="form.unitType != '0'">
|
||||||
<el-input v-model="form.unit" placeholder="请输入计量单位" />
|
<el-input v-model="form.unit" placeholder="请输入计量单位" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="综合单价(业主)" prop="ownerPrice">
|
<el-form-item label="综合单价(业主)" prop="ownerPrice" v-if="form.unitType != '0'">
|
||||||
<el-input v-model="form.ownerPrice" placeholder="请输入综合单价(业主)" />
|
<el-input v-model="form.ownerPrice" placeholder="请输入综合单价(业主)" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="综合单价(分包)" prop="constructionPrice">
|
<el-form-item label="综合单价(分包)" prop="constructionPrice" v-if="form.unitType != '0'">
|
||||||
<el-input v-model="form.constructionPrice" placeholder="请输入综合单价(分包)" />
|
<el-input v-model="form.constructionPrice" placeholder="请输入综合单价(分包)" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="数量" prop="total" v-if="isDisabled">
|
<el-form-item label="数量" prop="total" v-if="!form.workType && form.unitType != '0'">
|
||||||
<el-input v-model="form.total" placeholder="请输入数量" />
|
<el-input v-model="form.total" placeholder="请输入数量" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="关联数据" prop="workType" v-if="!form.id">
|
<el-form-item label="关联数据" prop="workType" v-if="!form.id && form.unitType != '0'">
|
||||||
<el-select v-model="form.workType" placeholder="请选择关联数据">
|
<el-select v-model="form.workType" placeholder="请选择关联数据">
|
||||||
<el-option v-for="dict in progress_work_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
<el-option v-for="dict in progress_work_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
@ -328,10 +328,7 @@ const cancel = () => {
|
|||||||
const reset = () => {
|
const reset = () => {
|
||||||
const projectId = form.value.projectId;
|
const projectId = form.value.projectId;
|
||||||
const matrixId = form.value.matrixId;
|
const matrixId = form.value.matrixId;
|
||||||
|
|
||||||
form.value = { ...initFormData, projectId, matrixId };
|
form.value = { ...initFormData, projectId, matrixId };
|
||||||
|
|
||||||
isDisabled.value = false;
|
|
||||||
progressCategoryFormRef.value?.resetFields();
|
progressCategoryFormRef.value?.resetFields();
|
||||||
};
|
};
|
||||||
/** 级联选择器改变事件 */
|
/** 级联选择器改变事件 */
|
||||||
@ -381,12 +378,8 @@ const toggleExpandAll = (data: ProgressCategoryVO[], status: boolean) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
const isDisabled = ref<boolean>(false);
|
|
||||||
const handleUpdate = async (row: ProgressCategoryVO) => {
|
const handleUpdate = async (row: ProgressCategoryVO) => {
|
||||||
reset();
|
reset();
|
||||||
if (!row.unitType) {
|
|
||||||
isDisabled.value = true;
|
|
||||||
}
|
|
||||||
await getTreeselect();
|
await getTreeselect();
|
||||||
if (row != null) {
|
if (row != null) {
|
||||||
form.value.parentId = row.parentId;
|
form.value.parentId = row.parentId;
|
||||||
|
@ -20,60 +20,65 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
<el-tabs type="border-card">
|
||||||
|
<el-tab-pane label="User"></el-tab-pane>
|
||||||
|
<el-tab-pane label="Config"></el-tab-pane>
|
||||||
|
<el-card shadow="never">
|
||||||
|
<template #header>
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain icon="Plus" @click="handleAdd()" v-hasPermi="['progress:progressCategoryTemplate:add']">新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
ref="progressCategoryTemplateTableRef"
|
||||||
|
v-loading="loading"
|
||||||
|
:data="progressCategoryTemplateList"
|
||||||
|
row-key="id"
|
||||||
|
:default-expand-all="isExpandAll"
|
||||||
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||||
|
>
|
||||||
|
<el-table-column label="类别名称" prop="name" />
|
||||||
|
<el-table-column label="计量方式" align="center" prop="unitType" width="100">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<dict-tag :options="progress_unit_type" :value="row.unitType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="关联数据" align="center" prop="workType">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<dict-tag :options="progress_work_type" :value="row.workType" />
|
||||||
|
</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">
|
||||||
|
<el-tooltip content="修改" placement="top">
|
||||||
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['progress:progressCategoryTemplate:edit']" />
|
||||||
|
</el-tooltip>
|
||||||
|
<el-tooltip content="新增" placement="top">
|
||||||
|
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['progress:progressCategoryTemplate:add']" />
|
||||||
|
</el-tooltip>
|
||||||
|
<el-tooltip content="删除" placement="top">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['progress:progressCategoryTemplate:remove']"
|
||||||
|
/>
|
||||||
|
</el-tooltip>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
</el-tabs>
|
||||||
|
|
||||||
<el-card shadow="never">
|
|
||||||
<template #header>
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd()" v-hasPermi="['progress:progressCategoryTemplate:add']">新增</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
<el-table
|
|
||||||
ref="progressCategoryTemplateTableRef"
|
|
||||||
v-loading="loading"
|
|
||||||
:data="progressCategoryTemplateList"
|
|
||||||
row-key="id"
|
|
||||||
:default-expand-all="isExpandAll"
|
|
||||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
||||||
>
|
|
||||||
<el-table-column label="类别名称" prop="name" />
|
|
||||||
<el-table-column label="计量方式" align="center" prop="unitType" width="100">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<dict-tag :options="progress_unit_type" :value="row.unitType" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="关联数据" align="center" prop="workType">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<dict-tag :options="progress_work_type" :value="row.workType" />
|
|
||||||
</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">
|
|
||||||
<el-tooltip content="修改" placement="top">
|
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['progress:progressCategoryTemplate:edit']" />
|
|
||||||
</el-tooltip>
|
|
||||||
<el-tooltip content="新增" placement="top">
|
|
||||||
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['progress:progressCategoryTemplate:add']" />
|
|
||||||
</el-tooltip>
|
|
||||||
<el-tooltip content="删除" placement="top">
|
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
icon="Delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['progress:progressCategoryTemplate:remove']"
|
|
||||||
/>
|
|
||||||
</el-tooltip>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</el-card>
|
|
||||||
<!-- 添加或修改进度类别模版对话框 -->
|
<!-- 添加或修改进度类别模版对话框 -->
|
||||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||||
<el-form ref="progressCategoryTemplateFormRef" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="progressCategoryTemplateFormRef" :model="form" :rules="rules" label-width="80px">
|
||||||
@ -124,6 +129,7 @@ import {
|
|||||||
addProgressCategoryTemplate,
|
addProgressCategoryTemplate,
|
||||||
delProgressCategoryTemplate,
|
delProgressCategoryTemplate,
|
||||||
getProgressCategoryTemplate,
|
getProgressCategoryTemplate,
|
||||||
|
getTabList,
|
||||||
listProgressCategoryTemplate,
|
listProgressCategoryTemplate,
|
||||||
updateProgressCategoryTemplate
|
updateProgressCategoryTemplate
|
||||||
} from '@/api/progress/progressCategoryTemplate';
|
} from '@/api/progress/progressCategoryTemplate';
|
||||||
@ -306,5 +312,8 @@ const handleDelete = async (row: ProgressCategoryTemplateVO) => {
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
getList();
|
||||||
|
getTabList().then((res) => {
|
||||||
|
console.log('tabList', res.data);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -27,6 +27,16 @@
|
|||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['land:enterRoad:add']">新增</el-button>
|
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['land:enterRoad:add']">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" plain icon="Plus" @click="downloadTemplate" v-hasPermi="['land:enterRoad:import']">模板下载</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-upload ref="uploadRef" class="upload-demo" :http-request="handleImport" :show-file-list="false">
|
||||||
|
<template #trigger>
|
||||||
|
<el-button plain type="primary">导入excel</el-button>
|
||||||
|
</template>
|
||||||
|
</el-upload>
|
||||||
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['land:enterRoad:remove']"
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['land:enterRoad:remove']"
|
||||||
>删除</el-button
|
>删除</el-button
|
||||||
@ -92,7 +102,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="EnterRoad" lang="ts">
|
<script setup name="EnterRoad" lang="ts">
|
||||||
import { listEnterRoad, getEnterRoad, delEnterRoad, addEnterRoad, updateEnterRoad } from '@/api/system/landTransfer/enterRoad';
|
import { listEnterRoad, getEnterRoad, delEnterRoad, addEnterRoad, updateEnterRoad ,importEnterRoad} from '@/api/system/landTransfer/enterRoad';
|
||||||
import { EnterRoadVO, EnterRoadQuery, EnterRoadForm } from '@/api/system/landTransfer/enterRoad/types';
|
import { EnterRoadVO, EnterRoadQuery, EnterRoadForm } from '@/api/system/landTransfer/enterRoad/types';
|
||||||
import { listLandBlock } from '@/api/system/landTransfer/landBlock';
|
import { listLandBlock } from '@/api/system/landTransfer/landBlock';
|
||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
@ -255,6 +265,43 @@ const listeningProject = watch(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 导入文件
|
||||||
|
const handleImport = (options: any) => {
|
||||||
|
loading.value = true;
|
||||||
|
let formData = new FormData();
|
||||||
|
formData.append('file', options.file);
|
||||||
|
importEnterRoad(currentProject.value?.id,formData).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
proxy.$modal.msgSuccess(res.msg || '导入成功');
|
||||||
|
getListLand();
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
}).catch((err) => {
|
||||||
|
proxy.$modal.msgError(err.msg || '导入失败');
|
||||||
|
}).finally(() => {
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 下载模板
|
||||||
|
const downloadTemplate = () => {
|
||||||
|
// 导出模版文件
|
||||||
|
try {
|
||||||
|
// 创建a标签
|
||||||
|
const link = document.createElement('a');
|
||||||
|
// 设置PDF文件路径 - 相对于public目录
|
||||||
|
link.href = '/enterRoad.xlsx';
|
||||||
|
// 设置下载后的文件名
|
||||||
|
link.download = '道路信息导入模板.xlsx';
|
||||||
|
// 触发点击
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
// 清理
|
||||||
|
document.body.removeChild(link);
|
||||||
|
} catch (error) {
|
||||||
|
alert('下载失败,请重试');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
listeningProject();
|
listeningProject();
|
||||||
});
|
});
|
||||||
|
@ -36,6 +36,16 @@
|
|||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['land:landBlock:add']">新增</el-button>
|
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['land:landBlock:add']">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" plain icon="Plus" @click="downloadTemplate" v-hasPermi="['land:enterRoad:import']">模板下载</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-upload ref="uploadRef" class="upload-demo" :http-request="handleImport" :show-file-list="false">
|
||||||
|
<template #trigger>
|
||||||
|
<el-button plain type="primary">导入excel</el-button>
|
||||||
|
</template>
|
||||||
|
</el-upload>
|
||||||
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['land:landBlock:remove']"
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['land:landBlock:remove']"
|
||||||
>删除</el-button
|
>删除</el-button
|
||||||
@ -143,7 +153,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="LandBlock" lang="ts">
|
<script setup name="LandBlock" lang="ts">
|
||||||
import { listLandBlock, getLandBlock, delLandBlock, LandUnit, addLandBlock, updateLandBlock, subMatrix } from '@/api/system/landTransfer/landBlock';
|
import { listLandBlock, getLandBlock, delLandBlock, LandUnit, addLandBlock, updateLandBlock, subMatrix,importLandBlock } from '@/api/system/landTransfer/landBlock';
|
||||||
import { LandBlockVO, LandBlockQuery, LandBlockForm } from '@/api/system/landTransfer/landBlock/types';
|
import { LandBlockVO, LandBlockQuery, LandBlockForm } from '@/api/system/landTransfer/landBlock/types';
|
||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
@ -388,6 +398,44 @@ const listeningProject = watch(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 导入文件
|
||||||
|
const handleImport = (options:any) => {
|
||||||
|
loading.value = true;
|
||||||
|
let formData = new FormData();
|
||||||
|
formData.append('file', options.file);
|
||||||
|
importLandBlock(currentProject.value?.id,formData).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
proxy.$modal.msgSuccess(res.msg || '导入成功');
|
||||||
|
getList();
|
||||||
|
getfangzhenList();
|
||||||
|
}
|
||||||
|
}).catch((err) => {
|
||||||
|
proxy.$modal.msgError(err.msg || '导入失败');
|
||||||
|
}).finally(() => {
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 下载模板
|
||||||
|
const downloadTemplate = () => {
|
||||||
|
// 导出模版文件
|
||||||
|
try {
|
||||||
|
// 创建a标签
|
||||||
|
const link = document.createElement('a');
|
||||||
|
// 设置PDF文件路径 - 相对于public目录
|
||||||
|
link.href = '/landBlock.xlsx';
|
||||||
|
// 设置下载后的文件名
|
||||||
|
link.download = '地块信息导入模板.xlsx';
|
||||||
|
// 触发点击
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
// 清理
|
||||||
|
document.body.removeChild(link);
|
||||||
|
} catch (error) {
|
||||||
|
alert('下载失败,请重试');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
listeningProject();
|
listeningProject();
|
||||||
});
|
});
|
||||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user