设计方案
This commit is contained in:
@ -44,10 +44,20 @@
|
||||
|
||||
<el-table v-loading="loading" :data="volumeCatalogList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- <el-table-column label="子项ID" align="center" prop="designSubitemId" /> -->
|
||||
<el-table-column label="子项ID" align="center" prop="designSubitemId" />
|
||||
<el-table-column label="子项名称" align="center" prop="designSubitemName" />
|
||||
<el-table-column label="设计状态" align="center" prop="designState">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="design_state" :value="scope.row.designState" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="专业" align="center" prop="specialty" />
|
||||
<el-table-column label="负责人" align="center" prop="principal" />
|
||||
<el-table-column label="卷册号" align="center" prop="volumeNumber" />
|
||||
<el-table-column label="资料名称" align="center" prop="documentName" />
|
||||
<el-table-column label="文件" align="center" prop="fileVoList">
|
||||
<el-table-column label="计划完成时间" align="center" prop="planCompleteTime" />
|
||||
|
||||
<el-table-column label="文件" align="center" prop="fileVoList" width="180">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
v-for="item in scope.row.fileVoList"
|
||||
@ -56,7 +66,7 @@
|
||||
target="_blank"
|
||||
:type="item.status == '1' ? 'primary' : 'info'"
|
||||
:underline="false"
|
||||
@click="lookFile(scope.row.id)"
|
||||
@click="lookFile(scope.row.design)"
|
||||
>
|
||||
{{ item.fileName }}
|
||||
</el-link>
|
||||
@ -68,7 +78,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="操作" align="center" width="220">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['design:volumeCatalog:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Upload" @click="handleUpload(scope.row)">上传</el-button>
|
||||
@ -83,10 +93,27 @@
|
||||
</el-card>
|
||||
<!-- 添加或修改卷册目录对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="volumeCatalogFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<!-- <el-form-item label="子项ID" prop="designSubitemId">
|
||||
<el-form ref="volumeCatalogFormRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="子项ID" prop="designSubitemId">
|
||||
<el-input v-model="form.designSubitemId" placeholder="请输入设计子项ID" />
|
||||
</el-form-item> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="子项" prop="designSubitem">
|
||||
<el-input v-model="form.designSubitem" placeholder="请输入设计子项" />
|
||||
</el-form-item>
|
||||
<el-form-item label="专业" prop="specialty">
|
||||
<el-input v-model="form.specialty" placeholder="请输入专业" />
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人" prop="principal">
|
||||
<el-input v-model="form.principal" placeholder="请输入负责人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划完成时间" prop="plannedCompletion">
|
||||
<el-date-picker v-model="form.plannedCompletion" type="date" value-format="YYYY-MM-DD" placeholder="请选择计划完成时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设计状态" prop="designState">
|
||||
<el-select v-model="form.designState" placeholder="请选择设计状态">
|
||||
<el-option :value="item.value" v-for="item in design_state" :key="item.value" :label="item.label" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="卷册号" prop="volumeNumber">
|
||||
<el-input v-model="form.volumeNumber" placeholder="请输入卷册号" />
|
||||
</el-form-item>
|
||||
@ -147,6 +174,7 @@ import { VolumeCatalogVO, VolumeCatalogQuery, VolumeCatalogForm } from '@/api/de
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { design_state } = toRefs(proxy?.useDict('design_state'));
|
||||
|
||||
const volumeCatalogList = ref<VolumeCatalogVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
@ -181,11 +209,12 @@ const uploadForm = reactive({
|
||||
const userList = ref([]);
|
||||
|
||||
const initFormData: VolumeCatalogForm = {
|
||||
id: undefined,
|
||||
design: undefined,
|
||||
projectId: currentProject.value?.id || '',
|
||||
designSubitemId: undefined,
|
||||
volumeNumber: undefined,
|
||||
documentName: undefined,
|
||||
|
||||
remark: undefined
|
||||
};
|
||||
const data = reactive<PageData<VolumeCatalogForm, VolumeCatalogQuery>>({
|
||||
@ -200,7 +229,7 @@ const data = reactive<PageData<VolumeCatalogForm, VolumeCatalogQuery>>({
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
design: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
|
||||
volumeNumber: [{ required: true, message: '卷册号不能为空', trigger: 'blur' }],
|
||||
documentName: [{ required: true, message: '资料名称不能为空', trigger: 'blur' }]
|
||||
@ -247,7 +276,7 @@ const resetQuery = () => {
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: VolumeCatalogVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
ids.value = selection.map((item) => item.design);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
@ -262,7 +291,7 @@ const handleAdd = () => {
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: VolumeCatalogVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const _id = row?.design || ids.value[0];
|
||||
const res = await getVolumeCatalog(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
@ -273,9 +302,9 @@ const handleUpdate = async (row?: VolumeCatalogVO) => {
|
||||
const uploadVisible = ref(false);
|
||||
const handleUpload = async (row?: any) => {
|
||||
resetUploadForm();
|
||||
uploadForm.volumeCatalogId = row.id;
|
||||
uploadForm.volumeCatalogId = row.design;
|
||||
userList.value = row.noViewerList;
|
||||
const res = await getVolumeCatafileList(row.id);
|
||||
const res = await getVolumeCatafileList(row.design);
|
||||
uploadForm.fileList = res.data.filter((item) => item.status == '1') || [];
|
||||
uploadVisible.value = true;
|
||||
};
|
||||
@ -300,7 +329,7 @@ const submitForm = () => {
|
||||
volumeCatalogFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
if (form.value.design) {
|
||||
await updateVolumeCatalog(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addVolumeCatalog(form.value).finally(() => (buttonLoading.value = false));
|
||||
@ -329,7 +358,7 @@ const onSubmit = async () => {
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: VolumeCatalogVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
const _ids = row?.design || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除卷册目录编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delVolumeCatalog(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
|
Reference in New Issue
Block a user