Merge branch 'main' of http://xny.yj-3d.com:3000/taoge/mk_system into tcy
This commit is contained in:
@ -65,7 +65,7 @@
|
||||
>
|
||||
<el-row :gutter="8" class="items-top">
|
||||
<!-- 1. 专业选择(核心:统一所有角色的专业来源) -->
|
||||
<el-col :span="3" class="mb-4 sm:mb-0 pl-4" style="margin-top:8px;">
|
||||
<el-col :span="3" class="mb-4 sm:mb-0 pl-4" style="margin-top: 8px">
|
||||
<el-form-item
|
||||
:prop="`designers.${configIndex}.userMajor`"
|
||||
:rules="[
|
||||
@ -76,7 +76,8 @@
|
||||
label-width="60px"
|
||||
label="专业"
|
||||
>
|
||||
<el-select filterable
|
||||
<el-select
|
||||
filterable
|
||||
v-model="form.designers[configIndex].userMajor"
|
||||
placeholder="请选择专业"
|
||||
class="w-full transition-all duration-300 border-gray-300"
|
||||
@ -109,7 +110,8 @@
|
||||
label="设计"
|
||||
label-width="50px"
|
||||
>
|
||||
<el-select filterable
|
||||
<el-select
|
||||
filterable
|
||||
v-model="person.userId"
|
||||
placeholder="选择人员"
|
||||
class="w-full transition-all duration-300 border-gray-300"
|
||||
@ -165,7 +167,8 @@
|
||||
label="校审"
|
||||
label-width="50px"
|
||||
>
|
||||
<el-select filterable
|
||||
<el-select
|
||||
filterable
|
||||
v-model="person.userId"
|
||||
placeholder="选择人员"
|
||||
class="w-full transition-all duration-300 border-gray-300"
|
||||
@ -221,7 +224,8 @@
|
||||
label="审定"
|
||||
label-width="50px"
|
||||
>
|
||||
<el-select filterable
|
||||
<el-select
|
||||
filterable
|
||||
v-model="person.userId"
|
||||
placeholder="选择人员"
|
||||
class="w-full transition-all duration-300 border-gray-300"
|
||||
@ -277,7 +281,8 @@
|
||||
label="审核"
|
||||
label-width="50px"
|
||||
>
|
||||
<el-select filterable
|
||||
<el-select
|
||||
filterable
|
||||
v-model="person.userId"
|
||||
placeholder="选择人员"
|
||||
class="w-full transition-all duration-300 border-gray-300"
|
||||
@ -318,7 +323,7 @@
|
||||
</el-col>
|
||||
|
||||
<!-- 操作列 -->
|
||||
<el-col :span="2" class="text-right pr-4">
|
||||
<el-col :span="2" class="pr-4 mt-2 text-right">
|
||||
<el-button
|
||||
type="text"
|
||||
class="text-red-500 hover:text-red-700 transition-colors"
|
||||
|
@ -6,7 +6,7 @@
|
||||
<el-card v-if="index < 3" shadow="always">
|
||||
<el-form :model="state.queryForm" :inline="true">
|
||||
<el-form-item label="版本号" prop="versions">
|
||||
<el-select v-model="state.queryForm.versions" placeholder="选择版本号">
|
||||
<el-select v-model="state.queryForm.versions" placeholder="选择版本号" @change="handleChangeVersion">
|
||||
<el-option v-for="item in state.options" :key="item.versions" :label="item.versions" :value="item.versions" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -16,7 +16,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="openTable(index)">{{ isExpandAll ? '一键收起' : '一键展开' }}</el-button>
|
||||
<el-button type="primary" @click="openTable(index)">{{ isExpandAll ? '一键收起' : '一键展开' }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="success" @click="downloadTemplate(1)">下载模板</el-button>
|
||||
@ -62,15 +62,10 @@
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="state.versionsData.status == 'draft'">
|
||||
<el-button type="primary" con="edit" @click="clickApprovalSheet()">审核</el-button>
|
||||
<el-button type="primary" con="edit" @click="clickApprovalSheet()">审核</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="state.versionsData.status == 'waiting' || state.versionsData.status == 'finish'">
|
||||
<el-button
|
||||
icon="view"
|
||||
@click="lookApprovalFlow()"
|
||||
type="warning"
|
||||
>查看流程</el-button
|
||||
>
|
||||
<el-button icon="view" @click="lookApprovalFlow()" type="warning">查看流程</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@ -171,6 +166,7 @@ const handleTabChange = (tab) => {
|
||||
onMounted(async () => {
|
||||
await getVersionNums();
|
||||
});
|
||||
|
||||
// 获取版本号
|
||||
async function getVersionNums(isSheet = true) {
|
||||
try {
|
||||
@ -247,10 +243,10 @@ async function handleSheetName() {
|
||||
|
||||
// 获取列表
|
||||
async function handleQueryList(isSheet = true) {
|
||||
if (isSheet && !state.queryForm.sheet) {
|
||||
console.warn('表名不存在,无法获取列表数据');
|
||||
return;
|
||||
}
|
||||
// if (isSheet && !state.queryForm) {
|
||||
// console.warn('表名不存在,无法获取列表数据');
|
||||
// return;
|
||||
// }
|
||||
|
||||
try {
|
||||
state.loading.list = true;
|
||||
@ -308,12 +304,12 @@ function handleChange(sheet) {
|
||||
function handleChangeVersion(versions) {
|
||||
state.queryForm.versions = versions;
|
||||
state.versionsData = state.options.find((e) => e.versions == versions);
|
||||
console.log('state.versionsData', state.versionsData);
|
||||
// console.log('state.versionsData', state.versionsData);
|
||||
state.sheets = [];
|
||||
handleQueryList();
|
||||
}
|
||||
// 在 openTable 方法中通过索引获取对应的表格实例
|
||||
function openTable( index) {
|
||||
function openTable(index) {
|
||||
isExpandAll.value = !isExpandAll.value;
|
||||
nextTick(() => {
|
||||
// 通过索引获取当前标签页的表格实例
|
||||
@ -358,12 +354,12 @@ function lookApprovalFlow(row) {
|
||||
const downloadTemplate = (type) => {
|
||||
// 导出模版文件
|
||||
try {
|
||||
let linkurl = '';
|
||||
let linkurl = '';
|
||||
let name = '';
|
||||
if (type==1) {
|
||||
if (type == 1) {
|
||||
linkurl = '/billOfQuantities.xlsx';
|
||||
name = '工程量清单模板.xlsx';
|
||||
}else{
|
||||
} else {
|
||||
linkurl = '/materialsEquipment.xlsx';
|
||||
name = '物资设备清单模板.xlsx';
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
<!-- 表单区域 -->
|
||||
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
||||
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
|
||||
<h3 class="text-lg font-semibold text-gray-800">投标工程清单</h3>
|
||||
<h3 class="text-lg font-semibold text-gray-800">投标工程量清单</h3>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<el-form
|
||||
|
@ -113,7 +113,7 @@ const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||
//按钮组件
|
||||
const flowCodeOptions = [
|
||||
{
|
||||
value: currentProject.value?.id + '_materialsPlans',
|
||||
value: currentProject.value?.id + '_equipmentList',
|
||||
label: '物资设备清单审核'
|
||||
}
|
||||
];
|
||||
|
@ -50,7 +50,7 @@
|
||||
<div class="p-4">
|
||||
<p class="text-gray-600 mb-4">请选择要启动的流程:</p>
|
||||
<el-select v-model="flowCode" placeholder="请选择流程" style="width: 100%">
|
||||
<el-option v-for="item in flowCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-option v-for="item in [flowCodeOptions[optionIndex]]" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
<template #footer>
|
||||
@ -98,6 +98,7 @@ const flowCodeOptions = ref([
|
||||
label: '资金设计变更审批'
|
||||
}
|
||||
]);
|
||||
const optionIndex = ref<number>(0);
|
||||
|
||||
const flowCode = ref<string>('');
|
||||
const status = ref<string>('');
|
||||
@ -272,12 +273,12 @@ const submit = async (status, data) => {
|
||||
} else {
|
||||
if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||
if (form.value.costEstimation == '0') {
|
||||
flowCodeOptions.value = [flowCodeOptions.value[0]];
|
||||
optionIndex.value = 0;
|
||||
} else {
|
||||
console.log('🚀 ~ submit ~ flowCodeOptions.value:', flowCodeOptions.value[1]);
|
||||
flowCodeOptions.value = [flowCodeOptions.value[1]];
|
||||
optionIndex.value = 1;
|
||||
}
|
||||
flowCode.value = flowCodeOptions.value[0].value;
|
||||
flowCode.value = flowCodeOptions.value[optionIndex.value].value;
|
||||
dialogVisible.visible = true;
|
||||
return;
|
||||
}
|
||||
|
@ -49,7 +49,32 @@
|
||||
<!-- 资料文件区域 -->
|
||||
<div class="mb-8">
|
||||
<div class="flex items-center justify-between mb-5">
|
||||
<h3 class="text-lg font-semibold text-blue-700">资料文件清单</h3>
|
||||
<div style="display: flex; align-items: center">
|
||||
<h3 class="text-lg font-semibold text-blue-700" style="margin-right: 20px">资料文件清单</h3>
|
||||
<el-upload
|
||||
class="upload-excel"
|
||||
action="#"
|
||||
v-if="!form.id || form.status == 'draft'"
|
||||
ref="uploadRef"
|
||||
:auto-upload="false"
|
||||
:on-change="importTemplate"
|
||||
:show-file-list="false"
|
||||
:accept="'.xlsx,.xls'"
|
||||
:limit="1"
|
||||
>
|
||||
<el-button type="primary" icon="Upload">导入文件</el-button>
|
||||
</el-upload>
|
||||
<el-button
|
||||
v-if="!form.id || form.status == 'draft'"
|
||||
type="primary"
|
||||
style="margin-left: 20px"
|
||||
icon="Download"
|
||||
@click="exportTemplate"
|
||||
class="transition-all hover:bg-blue-600"
|
||||
>
|
||||
导出模版
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button type="primary" size="small" @click="addDocumentItem" v-if="!disabledAll" icon="Plus" class="transition-all hover:bg-blue-600">
|
||||
添加资料
|
||||
</el-button>
|
||||
@ -180,11 +205,11 @@ import { ref, reactive, computed, onMounted, onUnmounted, watch, getCurrentInsta
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { ElMessage, ElLoading, FormRules } from 'element-plus';
|
||||
import { systemUserList } from '@/api/design/appointment';
|
||||
import { collectBatch, byProjectId, exportWord } from '@/api/design/received';
|
||||
import { collectBatch, byProjectId, exportWord, exportExcel } from '@/api/design/received';
|
||||
import { getUser } from '@/api/system/user';
|
||||
import type { ComponentInternalInstance, ElFormInstance } from 'element-plus';
|
||||
import { getInfo } from '@/api/login';
|
||||
|
||||
import * as XLSX from 'xlsx';
|
||||
// 全局实例与状态管理
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const userStore = useUserStoreHook();
|
||||
@ -200,7 +225,7 @@ const documentsFormRef = ref<ElFormInstance>();
|
||||
const userList = ref<any[]>([]);
|
||||
const userMap = new Map<string, string>(); // 存储用户ID与昵称映射
|
||||
const disabledAll = ref(false); // 表单是否全部禁用
|
||||
|
||||
const uploadRef = ref<any>();
|
||||
// 表单核心数据
|
||||
const form = reactive({
|
||||
projectId: currentProject.value?.id,
|
||||
@ -445,7 +470,66 @@ const onLoad = async () => {
|
||||
console.error('文件导出错误:', error);
|
||||
}
|
||||
};
|
||||
const exportTemplate = async () => {
|
||||
// 导出模版
|
||||
proxy?.download(
|
||||
'design/collect/exportExcel',
|
||||
{
|
||||
deptId: userStore.deptId
|
||||
},
|
||||
`收资清单表格.xlsx`
|
||||
);
|
||||
};
|
||||
const importTemplate = async (files, fileList) => {
|
||||
// 导入表格数据
|
||||
const file = fileList[0].raw; // 获取原始文件对象
|
||||
const reader = new FileReader();
|
||||
let obj = {
|
||||
id: '编码',
|
||||
name: '人员',
|
||||
fliename: '目录名',
|
||||
remark: '备注'
|
||||
};
|
||||
reader.onload = (e) => {
|
||||
try {
|
||||
// 读取文件内容
|
||||
const data = new Uint8Array(e.target.result);
|
||||
// 解析Excel
|
||||
const workbook = XLSX.read(data, { type: 'array' });
|
||||
|
||||
// 获取第一个工作表名称
|
||||
const firstSheetName = workbook.SheetNames[0];
|
||||
// 获取第一个工作表内容
|
||||
const worksheet = workbook.Sheets[firstSheetName];
|
||||
|
||||
// 转换为JSON格式
|
||||
const jsonData = XLSX.utils.sheet_to_json(worksheet);
|
||||
|
||||
if (jsonData.length === 0) {
|
||||
ElMessage.info('Excel文件中没有数据');
|
||||
return;
|
||||
}
|
||||
let arr = [];
|
||||
// 判断form.documents 是否对象
|
||||
jsonData.forEach((item, index) => {
|
||||
if (item[obj.id]) {
|
||||
arr.push({
|
||||
id: Date.now() + index,
|
||||
catalogueName: item[obj.fliename],
|
||||
remark: item[obj.remark],
|
||||
userId: item[obj.id]
|
||||
});
|
||||
}
|
||||
});
|
||||
form.documents = arr;
|
||||
uploadRef.value.clearFiles();
|
||||
console.log(arr);
|
||||
} catch (err) {}
|
||||
};
|
||||
|
||||
// 以ArrayBuffer方式读取文件
|
||||
reader.readAsArrayBuffer(file);
|
||||
};
|
||||
/** 页面挂载初始化 */
|
||||
onMounted(() => {
|
||||
// 先获取当前用户信息,再获取部门用户列表,最后回显表单数据
|
||||
|
@ -143,6 +143,11 @@
|
||||
<file-upload :fileType="['pdf']" :isShowTip="false" :fileSize="100"
|
||||
v-model="uploadForm.fileIds"></file-upload>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="uploadForm.type == '3'" label="抄送人">
|
||||
<el-select multiple filterable clearable v-model="form.userIds" placeholder="请选择抄送人">
|
||||
<el-option :value="item.userId" v-for="item in userCoryList" :key="item.userId" :label="item.nickName + '-' + item.phonenumber" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="uploadForm.type == '1'" label="过程图纸" prop="cancellationIds">
|
||||
<file-upload :fileType="['pdf']" :isShowTip="false" :fileSize="100"
|
||||
v-model="uploadForm.cancellationIds"></file-upload>
|
||||
@ -228,7 +233,8 @@ import {
|
||||
uploadVolumeFile,
|
||||
majorList,
|
||||
getVolumeCatafileList,
|
||||
volumeFileList
|
||||
volumeFileList,
|
||||
copyUserList
|
||||
} from '@/api/design/volumeCatalog';
|
||||
import { VolumeCatalogVO } from '@/api/design/volumeCatalog/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
@ -254,6 +260,7 @@ const uploadOpinionVisible = ref(false);
|
||||
const design = ref('');
|
||||
const total = ref(0);
|
||||
const dialogHistory = ref(false);
|
||||
const userCoryList = ref([]);
|
||||
const opinion = ref('');
|
||||
const updateRow = ref({
|
||||
opinion: []
|
||||
@ -389,7 +396,13 @@ const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
// 获取人员列表
|
||||
const getDesignUserList = async () => {
|
||||
const res = await copyUserList({ projectId: currentProject.value?.id, userType: 2 });
|
||||
if (res.code === 200) {
|
||||
userCoryList.value = res.data;
|
||||
}
|
||||
};
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
@ -519,7 +532,7 @@ const onSubmit = async () => {
|
||||
type: uploadForm.type
|
||||
};
|
||||
try {
|
||||
await uploadVolumeFile(obj);
|
||||
await uploadVolumeFile({ ...obj, userIds: form.value.userIds });
|
||||
proxy?.$modal.msgSuccess('文件上传成功');
|
||||
uploadVisible.value = false;
|
||||
await getList();
|
||||
@ -629,6 +642,7 @@ const handleAuditInfo = (row) => {
|
||||
// 审核图纸
|
||||
};
|
||||
onMounted(() => {
|
||||
getDesignUserList();
|
||||
getSpecialtyList();
|
||||
getList();
|
||||
});
|
||||
@ -639,6 +653,7 @@ const listeningProject = watch(
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getDesignUserList();
|
||||
getSpecialtyList();
|
||||
getList();
|
||||
}
|
||||
|
Reference in New Issue
Block a user