合并
This commit is contained in:
@ -5,7 +5,7 @@ VITE_APP_TITLE = 煤科建管平台
|
|||||||
VITE_APP_ENV = 'development'
|
VITE_APP_ENV = 'development'
|
||||||
|
|
||||||
# 开发环境
|
# 开发环境
|
||||||
VITE_APP_BASE_API = 'http://192.168.110.209:8899'
|
VITE_APP_BASE_API = 'http://192.168.110.210:8899'
|
||||||
|
|
||||||
# 无人机接口地址
|
# 无人机接口地址
|
||||||
|
|
||||||
|
@ -1,27 +1,581 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-2">
|
<div class="p-2">
|
||||||
<el-tabs v-model="activeName" type="border-card" class="demo-tabs" @tab-click="handleClick">
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
<el-tab-pane label="招采工程量" name="first">
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
<planPage type="1" ref="planPageRef" />
|
<el-card shadow="hover">
|
||||||
</el-tab-pane>
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="110px">
|
||||||
<el-tab-pane type="2" label="物资设备清单" name="second"> <planPage /> </el-tab-pane>
|
<el-form-item label="分包类型名称" prop="dictName">
|
||||||
</el-tabs>
|
<el-input v-model="queryParams.dictName" placeholder="请输入分包类型名称" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="名称" prop="name">
|
||||||
|
<el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="计划招标时间" prop="plannedBiddingTime">
|
||||||
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
v-model="queryParams.plannedBiddingTime"
|
||||||
|
type="date"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
placeholder="请选择计划招标时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="招标方式" prop="plannedBiddingMethod">
|
||||||
|
<el-select v-model="queryParams.plannedBiddingMethod" placeholder="请选择招标方式" clearable @change="handleQuery">
|
||||||
|
<el-option label="公招" value="公招"></el-option>
|
||||||
|
<el-option label="邀标" value="邀标"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="总价" prop="price">
|
||||||
|
<el-input v-model="queryParams.price" placeholder="请输入总价" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="限价" prop="limitPrice">
|
||||||
|
<el-input v-model="queryParams.limitPrice" placeholder="请输入限价" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同额" prop="contractPrice">
|
||||||
|
<el-input v-model="queryParams.contractPrice" placeholder="请输入合同额" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
|
||||||
|
<el-card shadow="never">
|
||||||
|
<template #header>
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['plan:plan:edit']">修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<!-- 多文件上传按钮 -->
|
||||||
|
<el-col :span="2">
|
||||||
|
<el-button type="primary" plain icon="Upload" @click="openFileUploadDialog()" v-hasPermi="['plan:plan:upload']"> 上传文件 </el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['plan:plan:export']">导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="主键ID" align="center" prop="id" v-if="false" />
|
||||||
|
<el-table-column label="项目Id" align="center" prop="projectId" v-if="false" />
|
||||||
|
<el-table-column label="分包类型名称" align="center" prop="dictName" />
|
||||||
|
<el-table-column label="名称" align="center" prop="name" />
|
||||||
|
<el-table-column label="计划招标时间" align="center" prop="plannedBiddingTime" width="180" v-if="false">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.plannedBiddingTime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="招标方式" align="center" prop="plannedBiddingMethod">
|
||||||
|
<template #default="scope">
|
||||||
|
{{
|
||||||
|
['1', 1].includes(scope.row.plannedBiddingMethod)
|
||||||
|
? '公招'
|
||||||
|
: ['2', 2].includes(scope.row.plannedBiddingMethod)
|
||||||
|
? '邀标'
|
||||||
|
: scope.row.plannedBiddingMethod || '-'
|
||||||
|
}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="总价" align="center" prop="price" v-if="false" />
|
||||||
|
<el-table-column label="限价" align="center" prop="limitPrice" />
|
||||||
|
<el-table-column label="合同额" align="center" prop="contractPrice" />
|
||||||
|
<el-table-column label="分包内容" align="center" prop="content" />
|
||||||
|
<el-table-column label="中标通知书" align="center" prop="bidFile">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link @click="handleView(scope.row, 'bidFile')" type="primary" v-if="scope.row.bidFile">查看</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="招标通知书" align="center" prop="tenderFile">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link @click="handleView(scope.row, 'tenderFile')" type="primary" v-if="scope.row.tenderFile">查看</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tooltip content="修改" placement="top">
|
||||||
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['plan:plan:edit']"></el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 多文件上传对话框 -->
|
||||||
|
<el-dialog :title="fileUploadDialog.title" v-model="fileUploadDialog.visible" width="600px" append-to-body>
|
||||||
|
<div class="upload-container">
|
||||||
|
<el-upload
|
||||||
|
class="upload-demo"
|
||||||
|
drag
|
||||||
|
action=""
|
||||||
|
:http-request="handleFileUpload"
|
||||||
|
:multiple="true"
|
||||||
|
:on-preview="handleFilePreview"
|
||||||
|
:on-remove="handleFileRemove"
|
||||||
|
:file-list="fileList"
|
||||||
|
:auto-upload="false"
|
||||||
|
>
|
||||||
|
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||||
|
<div class="el-upload__text">点击或拖拽文件到此处上传</div>
|
||||||
|
<template #tip>
|
||||||
|
<div class="el-upload__tip text-sm text-gray-500">支持上传多个文件,格式不限,单个文件大小不超过10MB</div>
|
||||||
|
</template>
|
||||||
|
</el-upload>
|
||||||
|
|
||||||
|
<div class="mt-4 flex justify-end">
|
||||||
|
<el-button @click="cancelFileUpload">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitFileUpload" class="ml-2"> 确认上传 </el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 添加或修改招标计划对话框 -->
|
||||||
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||||
|
<el-form ref="planFormRef" :model="form" :rules="rules" label-width="120px">
|
||||||
|
<!-- 调整项目ID表单项:与目标代码一致,自动关联当前项目并显示提示 -->
|
||||||
|
<el-input v-model="form.projectId" placeholder="请输入项目ID" :readonly="!!currentProjectId" :disabled="!!currentProjectId" v-if="false" />
|
||||||
|
<template #help>
|
||||||
|
<span v-if="currentProjectId" class="text-success">已自动关联当前选中项目</span>
|
||||||
|
</template>
|
||||||
|
<el-input v-model="form.id" placeholder="ID" readonly v-if="false" />
|
||||||
|
<el-form-item label="分包类型名称" prop="dictName" v-if="false">
|
||||||
|
<el-input v-model="form.dictName" placeholder="请输入分包类型名称" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="名称" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入名称" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="计划招标时间" prop="plannedBiddingTime" v-if="false">
|
||||||
|
<el-date-picker clearable v-model="form.plannedBiddingTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择计划招标时间" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- 核心修改:招标方式改为下拉框,根据限价自动赋值 -->
|
||||||
|
<el-form-item label="招标方式" prop="plannedBiddingMethod">
|
||||||
|
<el-select v-model="form.plannedBiddingMethod" placeholder="自动生成/选择" :disabled="!!form.limitPrice">
|
||||||
|
<el-option label="公招" value="公招"></el-option>
|
||||||
|
<el-option label="邀标" value="邀标"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="总价" prop="price" v-if="false">
|
||||||
|
<el-input v-model="form.price" placeholder="请输入总价" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- 限价输入:添加@input事件,实时触发招标方式判断 -->
|
||||||
|
<el-form-item label="限价(单位万元)" prop="limitPrice">
|
||||||
|
<el-input v-model.number="form.limitPrice" placeholder="请输入限价(单位万元)" type="number" @input="autoSetBiddingMethod" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="合同额" prop="contractPrice">
|
||||||
|
<el-input v-model="form.contractPrice" placeholder="请输入合同额" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="分包内容" prop="content">
|
||||||
|
<el-input v-model="form.content" type="textarea" placeholder="请输入分包内容" rows="3" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="中标通知书" prop="bidFile">
|
||||||
|
<file-upload v-model="form.bidFile" :limit="1" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="招标通知书" prop="files">
|
||||||
|
<file-upload v-model="form.tenderFile" :limit="100" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
<el-dialog title="文件列表" v-model="viewVisible" width="45%">
|
||||||
|
<el-table :data="viewFileList" style="width: 100%" border>
|
||||||
|
<el-table-column prop="fileName" label="文件" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link :key="scope.row.ossId" :href="scope.row.url" target="_blank" type="primary" :underline="false">
|
||||||
|
{{ scope.row.originalName || '查看文件' }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<template #footer>
|
||||||
|
<span>
|
||||||
|
<el-button type="primary" @click="viewVisible = false">关闭</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup name="Plan" lang="ts">
|
||||||
|
import { listPlan, getPlan, addPlan, updatePlan, getSegmentedIndicatorPlanning } from '@/api/plan/plan/index';
|
||||||
|
import { PlanVO, PlanQuery, PlanForm } from '@/api/plan/plan/types';
|
||||||
|
import { getCurrentInstance, onMounted, ref, reactive, toRefs, computed, watch } from 'vue';
|
||||||
|
import type { ElFormInstance } from 'element-plus';
|
||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
import { obtainAllVersionNumbers } from '@/api/contract/index';
|
import { UploadFilled } from '@element-plus/icons-vue';
|
||||||
import { BiddingImportExcelFile, getTreeLimit, biddingLimitListUpdate, sheetList } from '@/api/bidding/biddingLimit';
|
import type { UploadFile, UploadRawFile } from 'element-plus';
|
||||||
|
import { listByIds } from '@/api/system/oss';
|
||||||
|
|
||||||
|
// 从用户Store获取当前选中项目及ID
|
||||||
|
const userStore = useUserStoreHook();
|
||||||
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
|
const currentProjectId = computed(() => currentProject.value?.id);
|
||||||
|
const viewVisible = ref(false);
|
||||||
|
// 类型定义
|
||||||
|
interface DialogOption {
|
||||||
|
visible: boolean;
|
||||||
|
title: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface PageData<F, Q> {
|
||||||
|
form: F;
|
||||||
|
queryParams: Q;
|
||||||
|
rules: Record<string, any[]>;
|
||||||
|
}
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
import planPage from './comm/planPage.vue';
|
|
||||||
|
|
||||||
import type { TabsPaneContext } from 'element-plus';
|
const planList = ref<PlanVO[]>([]);
|
||||||
const activeName = ref('first');
|
const buttonLoading = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref<Array<string | number>>([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
|
||||||
const handleClick = (tab: TabsPaneContext, event: Event) => {
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
console.log(tab, event);
|
const planFormRef = ref<ElFormInstance>();
|
||||||
|
|
||||||
|
const dialog = reactive<DialogOption>({
|
||||||
|
visible: false,
|
||||||
|
title: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
// 文件上传相关状态
|
||||||
|
const fileUploadDialog = reactive({
|
||||||
|
visible: false,
|
||||||
|
title: '上传文件'
|
||||||
|
});
|
||||||
|
const fileList = ref<UploadFile[]>([]);
|
||||||
|
const viewFileList = ref([]);
|
||||||
|
const uploadLoading = ref(false);
|
||||||
|
const selectedPlanId = ref<string | number>('');
|
||||||
|
|
||||||
|
// 初始化表单数据
|
||||||
|
const initFormData: PlanForm & { dictName?: string; content?: string } = {
|
||||||
|
id: '1958116259107012609',
|
||||||
|
projectId: currentProjectId.value,
|
||||||
|
file: [],
|
||||||
|
plannedBiddingMethod: undefined,
|
||||||
|
files: undefined,
|
||||||
|
price: undefined,
|
||||||
|
limitPrice: undefined,
|
||||||
|
contractPrice: undefined,
|
||||||
|
bidFile: undefined,
|
||||||
|
dictName: '1',
|
||||||
|
name: 'test1',
|
||||||
|
content: 'trhbhbt'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 页面数据
|
||||||
|
const data = reactive<PageData<typeof initFormData, PlanQuery & { dictName?: string; content?: string }>>({
|
||||||
|
form: { ...initFormData },
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
projectId: currentProjectId.value,
|
||||||
|
dictName: undefined,
|
||||||
|
name: undefined,
|
||||||
|
plannedBiddingTime: undefined,
|
||||||
|
plannedBiddingMethod: undefined,
|
||||||
|
price: undefined,
|
||||||
|
limitPrice: undefined,
|
||||||
|
contractPrice: undefined,
|
||||||
|
content: undefined,
|
||||||
|
bidFile: undefined,
|
||||||
|
params: {}
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
projectId: [{ required: true, message: '请输入项目ID', trigger: 'blur' }],
|
||||||
|
name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
||||||
|
plannedBiddingMethod: [{ required: true, message: '请选择或输入限价生成招标方式', trigger: 'blur' }],
|
||||||
|
limitPrice: [{ required: true, message: '请输入限价', trigger: 'blur' }],
|
||||||
|
contractPrice: [{ required: true, message: '请输入合同额', trigger: 'blur' }],
|
||||||
|
content: [{ required: true, message: '请输入分包内容', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
// 监听当前项目ID变化
|
||||||
|
watch(currentProjectId, (newVal) => {
|
||||||
|
queryParams.value.projectId = newVal;
|
||||||
|
if (!form.value.id) {
|
||||||
|
form.value.projectId = newVal;
|
||||||
|
}
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
|
||||||
|
/** 查询招标计划列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true;
|
||||||
|
try {
|
||||||
|
const res = await listPlan(queryParams.value);
|
||||||
|
planList.value = res.rows || [];
|
||||||
|
total.value = res.total || 0;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取招标计划列表失败', error);
|
||||||
|
proxy?.$modal.msgError('获取招标计划列表失败');
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// const handleSuccess = (list, res, fileType) => {
|
||||||
|
// console.log(list);
|
||||||
|
// const arr = list.map((item) => {
|
||||||
|
// return { fileId: item.ossId, fileUrl: item.url, fileType };
|
||||||
|
// });
|
||||||
|
// console.log(arr);
|
||||||
|
// if (!form.value.file) form.value.file = [];
|
||||||
|
// form.value.file = [...form.value.file, ...arr];
|
||||||
|
// console.log(form.value.file);
|
||||||
|
// };
|
||||||
|
|
||||||
|
const handleView = async (row, type) => {
|
||||||
|
const res = await listByIds(row[type]);
|
||||||
|
if (type == 'tenderFile') {
|
||||||
|
viewVisible.value = true;
|
||||||
|
viewFileList.value = res.data;
|
||||||
|
} else {
|
||||||
|
window.open(res.data[0].url);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 取消按钮 */
|
||||||
|
const cancel = () => {
|
||||||
|
reset();
|
||||||
|
dialog.visible = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
const reset = () => {
|
||||||
|
form.value = { ...initFormData, projectId: currentProjectId.value };
|
||||||
|
planFormRef.value?.resetFields();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value?.resetFields();
|
||||||
|
queryParams.value.projectId = currentProjectId.value;
|
||||||
|
handleQuery();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 多选框选中数据 */
|
||||||
|
const handleSelectionChange = (selection: PlanVO[]) => {
|
||||||
|
ids.value = selection.map((item) => item.id);
|
||||||
|
single.value = selection.length !== 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
const handleUpdate = async (row?: PlanVO) => {
|
||||||
|
reset();
|
||||||
|
const _id = row?.id || ids.value[0];
|
||||||
|
if (!_id) {
|
||||||
|
proxy?.$modal.msgWarning('请选择需要修改的招标计划');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
// const res = await getPlan(_id);
|
||||||
|
const res = await getSegmentedIndicatorPlanning(_id);
|
||||||
|
|
||||||
|
Object.assign(form.value, res.data, {
|
||||||
|
id: res.data.id || initFormData.id,
|
||||||
|
dictName: res.data.dictName || initFormData.dictName,
|
||||||
|
content: res.data.content || initFormData.content,
|
||||||
|
projectId: res.data.projectId || currentProjectId.value
|
||||||
|
});
|
||||||
|
console.log(form.value);
|
||||||
|
|
||||||
|
// 回显时根据限价同步招标方式(避免数据不一致)
|
||||||
|
autoSetBiddingMethod();
|
||||||
|
dialog.visible = true;
|
||||||
|
dialog.title = '修改招标计划';
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取招标计划详情失败', error);
|
||||||
|
proxy?.$modal.msgError('获取招标计划详情失败');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 核心:根据限价自动设置招标方式 */
|
||||||
|
const autoSetBiddingMethod = () => {
|
||||||
|
const limit = form.value.limitPrice;
|
||||||
|
// 逻辑:限价>1000万→公招,否则→邀标,为空则清空
|
||||||
|
form.value.plannedBiddingMethod = limit ? (limit > 1000 ? '公招' : '邀标') : '';
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
const submitForm = () => {
|
||||||
|
planFormRef.value?.validate(async (valid: boolean) => {
|
||||||
|
if (valid) {
|
||||||
|
buttonLoading.value = true;
|
||||||
|
try {
|
||||||
|
if (!form.value.id && currentProjectId.value) {
|
||||||
|
form.value.projectId = currentProjectId.value;
|
||||||
|
}
|
||||||
|
if (form.value.id) {
|
||||||
|
await updatePlan(form.value);
|
||||||
|
} else {
|
||||||
|
await addPlan(form.value);
|
||||||
|
}
|
||||||
|
proxy?.$modal.msgSuccess('操作成功');
|
||||||
|
dialog.visible = false;
|
||||||
|
await getList();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('操作失败', error);
|
||||||
|
proxy?.$modal.msgError('操作失败,请重试');
|
||||||
|
} finally {
|
||||||
|
buttonLoading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 删除按钮操作(原代码存在但模板未引用,保留逻辑) */
|
||||||
|
const handleDelete = async (row?: PlanVO) => {
|
||||||
|
const _ids = row?.id || ids.value;
|
||||||
|
if (!_ids || (_ids instanceof Array && _ids.length === 0)) {
|
||||||
|
proxy?.$modal.msgWarning('请选择需要删除的招标计划');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await proxy?.$modal.confirm('是否确认删除选中的招标计划?');
|
||||||
|
await delPlan(_ids);
|
||||||
|
proxy?.$modal.msgSuccess('删除成功');
|
||||||
|
await getList();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('删除失败', error);
|
||||||
|
if (error !== 'cancel') {
|
||||||
|
proxy?.$modal.msgError('删除失败,请重试');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = () => {
|
||||||
|
proxy?.download(
|
||||||
|
'plan/plan/export',
|
||||||
|
{
|
||||||
|
...queryParams.value
|
||||||
|
},
|
||||||
|
`plan_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 打开文件上传对话框 */
|
||||||
|
const openFileUploadDialog = () => {
|
||||||
|
if (ids.value.length !== 1) {
|
||||||
|
proxy?.$modal.msgWarning('请选择单个招标计划进行文件上传');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
selectedPlanId.value = ids.value[0];
|
||||||
|
fileList.value = [];
|
||||||
|
fileUploadDialog.visible = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 处理文件上传 */
|
||||||
|
const handleFileUpload = async (params: { file: UploadRawFile }) => {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', params.file);
|
||||||
|
formData.append('planId', selectedPlanId.value as string);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await uploadFile(formData);
|
||||||
|
return response;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('文件上传失败', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 提交文件上传 */
|
||||||
|
const submitFileUpload = async () => {
|
||||||
|
if (fileList.value.length === 0) {
|
||||||
|
proxy?.$modal.msgWarning('请选择需要上传的文件');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
uploadLoading.value = true;
|
||||||
|
try {
|
||||||
|
for (const file of fileList.value) {
|
||||||
|
if (file.raw) {
|
||||||
|
await handleFileUpload({ file: file.raw });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
proxy?.$modal.msgSuccess('文件上传成功');
|
||||||
|
fileUploadDialog.visible = false;
|
||||||
|
} catch (error) {
|
||||||
|
proxy?.$modal.msgError('文件上传失败');
|
||||||
|
} finally {
|
||||||
|
uploadLoading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 取消文件上传 */
|
||||||
|
const cancelFileUpload = () => {
|
||||||
|
fileList.value = [];
|
||||||
|
fileUploadDialog.visible = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 文件预览 */
|
||||||
|
const handleFilePreview = (file: UploadFile) => {
|
||||||
|
console.log('预览文件:', file);
|
||||||
|
// 可扩展:通过文件URL打开预览
|
||||||
|
// if (file.url) window.open(file.url);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 移除文件 */
|
||||||
|
const handleFileRemove = (file: UploadFile) => {
|
||||||
|
console.log('移除文件:', file);
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped lang="scss">
|
||||||
|
.mb-4 {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
.el-table .small-padding .cell {
|
||||||
|
padding: 0 5px;
|
||||||
|
}
|
||||||
|
.el-table .fixed-width {
|
||||||
|
width: 120px !important;
|
||||||
|
}
|
||||||
|
.el-table-column .el-button--text + .el-button--text {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
.upload-container {
|
||||||
|
padding: 10px 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<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">
|
||||||
<el-form-item label="企业登记注册类型" prop="supplierType">
|
<el-form-item label="企业登记注册类型" prop="supplierType" label-width="140px">
|
||||||
<el-select v-model="queryParams.supplierType" placeholder="请选择类型" clearable>
|
<el-select v-model="queryParams.supplierType" placeholder="请选择类型" clearable>
|
||||||
<el-option label="劳务" value="劳务"></el-option>
|
<el-option label="劳务" value="劳务"></el-option>
|
||||||
<el-option label="技术服务" value="技术服务"></el-option>
|
<el-option label="技术服务" value="技术服务"></el-option>
|
||||||
@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
<!-- 数据表格 -->
|
<!-- 数据表格 -->
|
||||||
<el-table v-loading="loading" :data="supplierInputList" @selection-change="handleSelectionChange" border>
|
<el-table v-loading="loading" :data="supplierInputList" @selection-change="handleSelectionChange" border>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="100%" align="center" />
|
||||||
<el-table-column label="ID" align="center" prop="id" width="80" />
|
<el-table-column label="ID" align="center" prop="id" width="80" />
|
||||||
<el-table-column label="企业登记注册类型" align="center" prop="supplierType" width="140" />
|
<el-table-column label="企业登记注册类型" align="center" prop="supplierType" width="140" />
|
||||||
<el-table-column label="企业名称" align="center" prop="supplierName" width="180" />
|
<el-table-column label="企业名称" align="center" prop="supplierName" width="180" />
|
||||||
@ -82,7 +82,9 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="入库资料" align="center" prop="inputFile" width="120">
|
<el-table-column label="入库资料" align="center" prop="inputFile" width="120">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-link v-if="scope.row.inputFile" :href="scope.row.inputFile" target="_blank" underline>查看文件</el-link>
|
<el-link v-if="scope.row.inputFile" :href="scope.row.inputFile" target="_blank" :style="{ textDecoration: 'none', color: '#409eff' }">
|
||||||
|
查看文件
|
||||||
|
</el-link>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
|
||||||
@ -216,7 +218,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="发证日期" prop="issueDate">
|
<el-form-item label="发证日期" prop="issueDate">
|
||||||
<el-date-picker v-model="form.issueDate" type="date" placeholder="请选择发证日期" />
|
<el-date-picker v-model="form.issueDate" type="date" placeholder="请选择发证日期" value-format="YYYY-MM-DD" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -225,7 +227,7 @@
|
|||||||
<el-row :gutter="20" class="mb-4">
|
<el-row :gutter="20" class="mb-4">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="证书有效期" prop="certificateValidity">
|
<el-form-item label="证书有效期" prop="certificateValidity">
|
||||||
<el-date-picker v-model="form.certificateValidity" type="date" placeholder="请选择证书有效期" />
|
<el-date-picker v-model="form.certificateValidity" type="date" placeholder="请选择证书有效期" value-format="YYYY-MM-DD" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -252,8 +254,8 @@
|
|||||||
<!-- 第十行:安全生产许可证有效期(仅劳务类型显示) -->
|
<!-- 第十行:安全生产许可证有效期(仅劳务类型显示) -->
|
||||||
<el-row :gutter="20" class="mb-4" v-if="form.supplierType === '劳务'">
|
<el-row :gutter="20" class="mb-4" v-if="form.supplierType === '劳务'">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="安全生产许可证有效期" prop="safeCertificateValidity">
|
<el-form-item label="安全生产许可证发证日期" prop="safeCertificateValidity">
|
||||||
<el-input v-model="form.safeCertificateValidity" placeholder="请输入有效期" clearable />
|
<el-date-picker v-model="form.safeCertificateValidity" type="date" placeholder="请选择发证日期" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -285,17 +287,17 @@
|
|||||||
<!-- 第十二行:职称人员数量(仅劳务类型显示) -->
|
<!-- 第十二行:职称人员数量(仅劳务类型显示) -->
|
||||||
<el-row :gutter="20" class="mb-4" v-if="form.supplierType === '劳务'">
|
<el-row :gutter="20" class="mb-4" v-if="form.supplierType === '劳务'">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="职称人员数量" prop="personnelNumber1">
|
<el-form-item label="高级工程师人数" prop="personnelNumber1">
|
||||||
<el-input v-model="form.personnelNumber1" placeholder="请输入职称人员数量" clearable />
|
<el-input v-model="form.personnelNumber1" placeholder="请输高级工程师数量" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="职称人员数量" prop="personnelNumber2">
|
<el-form-item label="工程师数量" prop="personnelNumber2">
|
||||||
<el-input v-model="form.personnelNumber2" placeholder="请输入职称人员数量" clearable />
|
<el-input v-model="form.personnelNumber2" placeholder="请输入工程师数量" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="职称人员数量" prop="personnelNumber3">
|
<el-form-item label="助理工程师数量" prop="personnelNumber3">
|
||||||
<el-input v-model="form.personnelNumber3" placeholder="请输入职称人员数量" clearable />
|
<el-input v-model="form.personnelNumber3" placeholder="请输入助理工程师数量" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="职称人员数量" prop="personnelNumber4">
|
<el-form-item label="其他人员数量" prop="personnelNumber4">
|
||||||
<el-input v-model="form.personnelNumber4" placeholder="请输入职称人员数量" clearable />
|
<el-input v-model="form.personnelNumber4" placeholder="请输入其他人员数量" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -303,22 +305,6 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<!-- 第十三行:审核状态 -->
|
|
||||||
<el-row :gutter="20" class="mb-4">
|
|
||||||
<el-col :span="12">
|
|
||||||
<!-- 空列占位,保持布局对称 -->
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="审核状态" prop="state" v-if="dialog.title === '修改供应商入库'">
|
|
||||||
<el-select v-model="form.state" disabled>
|
|
||||||
<el-option label="待审核" value="0"></el-option>
|
|
||||||
<el-option label="已通过" value="1"></el-option>
|
|
||||||
<el-option label="未通过" value="2"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<!-- 第十四行:入库资料上传 -->
|
<!-- 第十四行:入库资料上传 -->
|
||||||
<el-row class="mb-4">
|
<el-row class="mb-4">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
@ -347,7 +333,7 @@
|
|||||||
>
|
>
|
||||||
<li style="margin-top: 10px" class="el-upload-list__item ele-upload-list__item-content">
|
<li style="margin-top: 10px" class="el-upload-list__item ele-upload-list__item-content">
|
||||||
<el-link :href="`${fileUrl}`" :underline="false" target="_blank">
|
<el-link :href="`${fileUrl}`" :underline="false" target="_blank">
|
||||||
<el-button class="el-icon-document"> 下载文件 </el-button>
|
<el-button class="el-icon-document"> 查看文件 </el-button>
|
||||||
</el-link>
|
</el-link>
|
||||||
</li>
|
</li>
|
||||||
</transition-group>
|
</transition-group>
|
||||||
@ -372,7 +358,7 @@
|
|||||||
<script setup name="SupplierInput" lang="ts">
|
<script setup name="SupplierInput" lang="ts">
|
||||||
import { ComponentInternalInstance, getCurrentInstance, onMounted, ref, reactive, toRefs, computed } from 'vue';
|
import { ComponentInternalInstance, getCurrentInstance, onMounted, ref, reactive, toRefs, computed } from 'vue';
|
||||||
import { ElFormInstance } from 'element-plus';
|
import { ElFormInstance } from 'element-plus';
|
||||||
import { listSupplierInput, getSupplierInput, delSupplierInput, addSupplierInput, updateSupplierInput } from '@/api/supplierInput/supplierInput';
|
import { listSupplierInput, getSupplierInput, delSupplierInput } from '@/api/supplierInput/supplierInput';
|
||||||
import { SupplierInputVO, SupplierInputQuery, SupplierInputForm, PageData, DialogOption } from '@/api/supplierInput/supplierInput/types';
|
import { SupplierInputVO, SupplierInputQuery, SupplierInputForm, PageData, DialogOption } from '@/api/supplierInput/supplierInput/types';
|
||||||
import Pagination from '@/components/Pagination/index.vue';
|
import Pagination from '@/components/Pagination/index.vue';
|
||||||
import RightToolbar from '@/components/RightToolbar/index.vue';
|
import RightToolbar from '@/components/RightToolbar/index.vue';
|
||||||
@ -403,7 +389,7 @@ const dialog = reactive<DialogOption>({
|
|||||||
title: ''
|
title: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
// 初始化表单数据
|
// 初始化表单数据:新增build1-build4、personnelNumber1-personnelNumber4字段(用于拆分拼接字符串)
|
||||||
const initFormData: any = {
|
const initFormData: any = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
supplierType: undefined,
|
supplierType: undefined,
|
||||||
@ -425,13 +411,21 @@ const initFormData: any = {
|
|||||||
safeCode: undefined,
|
safeCode: undefined,
|
||||||
safeCodeData: undefined,
|
safeCodeData: undefined,
|
||||||
safeCertificateValidity: undefined,
|
safeCertificateValidity: undefined,
|
||||||
registeredNumber: undefined,
|
registeredNumber: undefined, // 后端返回的拼接字符串(如“1,2,3,4”)
|
||||||
personnelNumber: undefined,
|
personnelNumber: undefined, // 后端返回的拼接字符串(如“5,6,7,8”)
|
||||||
fileId: undefined,
|
fileId: undefined,
|
||||||
inputFile: undefined,
|
inputFile: undefined,
|
||||||
state: '0' // 新增默认待审核
|
state: '0', // 新增默认待审核
|
||||||
|
// 新增:用于表单输入的单独字段
|
||||||
|
build1: undefined, // 一建建造师
|
||||||
|
build2: undefined, // 二建建造师
|
||||||
|
build3: undefined, // 注册造价工程师
|
||||||
|
build4: undefined, // 其他注册人员
|
||||||
|
personnelNumber1: undefined, // 高级工程师
|
||||||
|
personnelNumber2: undefined, // 工程师
|
||||||
|
personnelNumber3: undefined, // 助理工程师
|
||||||
|
personnelNumber4: undefined // 其他职称人员
|
||||||
};
|
};
|
||||||
|
|
||||||
// 核心数据(表单+查询参数)
|
// 核心数据(表单+查询参数)
|
||||||
const data = reactive<PageData<SupplierInputForm, SupplierInputQuery>>({
|
const data = reactive<PageData<SupplierInputForm, SupplierInputQuery>>({
|
||||||
form: { ...initFormData },
|
form: { ...initFormData },
|
||||||
@ -442,6 +436,8 @@ const data = reactive<PageData<SupplierInputForm, SupplierInputQuery>>({
|
|||||||
supplierName: undefined,
|
supplierName: undefined,
|
||||||
state: undefined,
|
state: undefined,
|
||||||
inputFile: undefined,
|
inputFile: undefined,
|
||||||
|
registeredNumber: undefined,
|
||||||
|
personnelNumber: undefined,
|
||||||
params: {}
|
params: {}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -462,7 +458,14 @@ const rules = computed(() => {
|
|||||||
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号格式', trigger: 'blur' }
|
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号格式', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
id: [{ required: true, message: 'ID不能为空', trigger: 'blur' }],
|
id: [{ required: true, message: 'ID不能为空', trigger: 'blur' }],
|
||||||
build1: [{ required: true, message: '请输入一建建造师数量', trigger: 'change' }]
|
build1: [{ required: true, message: '请输入一建建造师数量', trigger: 'change' }],
|
||||||
|
build2: [{ required: true, message: '请输入二建建造师数量', trigger: 'change' }],
|
||||||
|
build3: [{ required: true, message: '请输入注册造价工程师数量', trigger: 'change' }],
|
||||||
|
build4: [{ required: true, message: '请输入其他数量', trigger: 'change' }],
|
||||||
|
personnelNumber1: [{ required: true, message: '请输入高级工程师数量', trigger: 'change' }],
|
||||||
|
personnelNumber2: [{ required: true, message: '请输入工程师数量', trigger: 'change' }],
|
||||||
|
personnelNumber3: [{ required: true, message: '请输入助理工程师数量', trigger: 'change' }],
|
||||||
|
personnelNumber4: [{ required: true, message: '请输入其他数量', trigger: 'change' }]
|
||||||
};
|
};
|
||||||
|
|
||||||
// 仅当类型为"劳务"时,添加安全生产许可证+人员数量校验
|
// 仅当类型为"劳务"时,添加安全生产许可证+人员数量校验
|
||||||
@ -472,10 +475,17 @@ const rules = computed(() => {
|
|||||||
// 安全生产许可证相关校验
|
// 安全生产许可证相关校验
|
||||||
safeCode: [{ required: true, message: '请输入安全生产许可证编号', trigger: 'blur' }],
|
safeCode: [{ required: true, message: '请输入安全生产许可证编号', trigger: 'blur' }],
|
||||||
safeCodeData: [{ required: true, message: '请选择安全生产许可证发证日期', trigger: 'change' }],
|
safeCodeData: [{ required: true, message: '请选择安全生产许可证发证日期', trigger: 'change' }],
|
||||||
safeCertificateValidity: [{ required: true, message: '请输入安全生产许可证有效期', trigger: 'blur' }],
|
safeCertificateValidity: [{ required: true, message: '请选择安全生产许可证有效期', trigger: 'change' }],
|
||||||
// 人员数量相关校验
|
// 注册人员数量校验
|
||||||
registeredNumber: [{ required: true, message: '请输入注册人员数量', trigger: 'blur' }]
|
build1: [{ required: true, message: '请输入一建建造师数量', trigger: 'blur' }],
|
||||||
// personnelNumber: [{ required: true, message: '请输入职称人员数量', trigger: 'blur' }]
|
build2: [{ required: true, message: '请输入二建建造师数量', trigger: 'blur' }],
|
||||||
|
build3: [{ required: true, message: '请输入注册造价工程师数量', trigger: 'blur' }],
|
||||||
|
build4: [{ required: true, message: '请输入其他注册人员数量', trigger: 'blur' }],
|
||||||
|
// 职称人员数量校验
|
||||||
|
personnelNumber1: [{ required: true, message: '请输入高级工程师数量', trigger: 'blur' }],
|
||||||
|
personnelNumber2: [{ required: true, message: '请输入工程师数量', trigger: 'blur' }],
|
||||||
|
personnelNumber3: [{ required: true, message: '请输入助理工程师数量', trigger: 'blur' }],
|
||||||
|
personnelNumber4: [{ required: true, message: '请输入其他职称人员数量', trigger: 'blur' }]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -491,9 +501,24 @@ const handleTypeChange = () => {
|
|||||||
form.value.safeCertificateValidity = undefined;
|
form.value.safeCertificateValidity = undefined;
|
||||||
form.value.registeredNumber = undefined;
|
form.value.registeredNumber = undefined;
|
||||||
form.value.personnelNumber = undefined;
|
form.value.personnelNumber = undefined;
|
||||||
|
// 清空表单单独字段
|
||||||
|
form.value.build1 = form.value.build2 = form.value.build3 = form.value.build4 = undefined;
|
||||||
|
form.value.personnelNumber1 = form.value.personnelNumber2 = form.value.personnelNumber3 = form.value.personnelNumber4 = undefined;
|
||||||
}
|
}
|
||||||
// 重置隐藏字段的校验状态,避免错误提示残留
|
// 重置隐藏字段的校验状态,避免错误提示残留
|
||||||
supplierInputFormRef.value?.clearValidate(['safeCode', 'safeCodeData', 'safeCertificateValidity', 'registeredNumber', 'personnelNumber']);
|
supplierInputFormRef.value?.clearValidate([
|
||||||
|
'safeCode',
|
||||||
|
'safeCodeData',
|
||||||
|
'safeCertificateValidity',
|
||||||
|
'build1',
|
||||||
|
'build2',
|
||||||
|
'build3',
|
||||||
|
'build4',
|
||||||
|
'personnelNumber1',
|
||||||
|
'personnelNumber2',
|
||||||
|
'personnelNumber3',
|
||||||
|
'personnelNumber4'
|
||||||
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 查询供应商入库列表 */
|
/** 查询供应商入库列表 */
|
||||||
@ -536,14 +561,23 @@ const resetQuery = () => {
|
|||||||
handleQuery();
|
handleQuery();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 文件上传成功回调 */
|
const splitBackEndStrToForm = (resData: any) => {
|
||||||
// const handleUploadSuccess = () => {
|
if (resData.registeredNumber) {
|
||||||
// proxy?.$modal.msgSuccess('操作成功');
|
const registeredArr = resData.registeredNumber.split(',');
|
||||||
// dialog.visible = false;
|
form.value.build1 = registeredArr[0] || undefined; // 一建建造师
|
||||||
// buttonLoading.value = false;
|
form.value.build2 = registeredArr[1] || undefined; // 二建建造师
|
||||||
// getList();
|
form.value.build3 = registeredArr[2] || undefined; // 注册造价工程师
|
||||||
// };
|
form.value.build4 = registeredArr[3] || undefined; // 其他注册人员
|
||||||
|
}
|
||||||
|
|
||||||
|
if (resData.personnelNumber) {
|
||||||
|
const personnelArr = resData.personnelNumber.split(',');
|
||||||
|
form.value.personnelNumber1 = personnelArr[0] || undefined; // 高级工程师
|
||||||
|
form.value.personnelNumber2 = personnelArr[1] || undefined; // 工程师
|
||||||
|
form.value.personnelNumber3 = personnelArr[2] || undefined; // 助理工程师
|
||||||
|
form.value.personnelNumber4 = personnelArr[3] || undefined; // 其他职称人员
|
||||||
|
}
|
||||||
|
};
|
||||||
/** 文件选择变更 */
|
/** 文件选择变更 */
|
||||||
const change = () => {
|
const change = () => {
|
||||||
fileUrl.value = '';
|
fileUrl.value = '';
|
||||||
@ -563,7 +597,6 @@ const handleAdd = () => {
|
|||||||
dialog.title = '添加供应商入库';
|
dialog.title = '添加供应商入库';
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 修改操作 */
|
|
||||||
const handleUpdate = async (row?: SupplierInputVO) => {
|
const handleUpdate = async (row?: SupplierInputVO) => {
|
||||||
reset();
|
reset();
|
||||||
const _id = row?.id || ids.value[0];
|
const _id = row?.id || ids.value[0];
|
||||||
@ -571,8 +604,14 @@ const handleUpdate = async (row?: SupplierInputVO) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await getSupplierInput(_id);
|
const res = await getSupplierInput(_id);
|
||||||
form.value = { ...form.value, ...res.data, inputFile: '' };
|
const resData = res.data || {};
|
||||||
fileUrl.value = res.data.inputFile;
|
// 1. 基础字段回显
|
||||||
|
form.value = { ...form.value, ...resData, inputFile: '' };
|
||||||
|
// 2. 核心修复:拆分后端拼接字符串到表单单独字段
|
||||||
|
splitBackEndStrToForm(resData);
|
||||||
|
// 3. 文件地址回显
|
||||||
|
fileUrl.value = resData.inputFile || '';
|
||||||
|
// 4. 打开对话框
|
||||||
dialog.visible = true;
|
dialog.visible = true;
|
||||||
dialog.title = '修改供应商入库';
|
dialog.title = '修改供应商入库';
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -586,8 +625,15 @@ const submitForm = () => {
|
|||||||
|
|
||||||
supplierInputFormRef.value?.validate(async (valid: boolean) => {
|
supplierInputFormRef.value?.validate(async (valid: boolean) => {
|
||||||
if (!valid) return;
|
if (!valid) return;
|
||||||
form.value.registeredNumber = `${form.value.build1},${form.value.build2},${form.value.build3},${form.value.build4}`;
|
if (form.value.supplierType === '劳务') {
|
||||||
form.value.personnelNumber = `${form.value.personnelNumber1},${form.value.personnelNumber2},${form.value.personnelNumber3},${form.value.personnelNumber4}`;
|
form.value.registeredNumber = [form.value.build1, form.value.build2, form.value.build3, form.value.build4].join(',');
|
||||||
|
form.value.personnelNumber = [
|
||||||
|
form.value.personnelNumber1,
|
||||||
|
form.value.personnelNumber2,
|
||||||
|
form.value.personnelNumber3,
|
||||||
|
form.value.personnelNumber4
|
||||||
|
].join(',');
|
||||||
|
}
|
||||||
buttonLoading.value = true;
|
buttonLoading.value = true;
|
||||||
try {
|
try {
|
||||||
if (fileUploadRef.value) {
|
if (fileUploadRef.value) {
|
||||||
|
Reference in New Issue
Block a user