This commit is contained in:
2025-07-07 19:59:12 +08:00
parent 3259cc6b23
commit 2935f2b18e
14 changed files with 718 additions and 336 deletions

View File

@ -7,11 +7,11 @@
<el-form-item label="文件名称" prop="fileName">
<el-input v-model="queryParams.fileName" placeholder="请输入文件名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="文件类型" prop="fileType">
<!-- <el-form-item label="文件类型" prop="fileType">
<el-select v-model="queryParams.fileType" placeholder="请选择文件类型" clearable>
<el-option v-for="dict in drawing_file_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item label="原文件名" prop="originalName">
<el-input v-model="queryParams.originalName" placeholder="请输入原文件名" clearable @keyup.enter="handleQuery" />
</el-form-item>
@ -33,65 +33,55 @@
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['design:drawing:add']">新增</el-button>
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['design:drawing:add']">上传图纸</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="drawingList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="版本号" align="center" prop="versionNumber" width="100" />
<el-table-column label="文件名称" align="center" prop="fileName">
<template #default="scope">
<span style="color: #409eff" @click="handleView(scope.row)">{{ scope.row.fileName }}</span>
</template>
</el-table-column>
<el-table-column label="图纸类型" align="center" prop="fileType" width="100">
<template #default="scope">
<dict-tag :options="drawing_file_type" :value="scope.row.fileType" />
</template>
</el-table-column>
<el-table-column label="原文件名" align="center" prop="originalName" />
<el-table-column label="是否最新" align="center" prop="newest">
<template #default="scope">
<div>
<el-tag type="primary" v-if="scope.row.newest == '1'"></el-tag>
<el-tag type="success" v-else></el-tag>
</div>
</template>
</el-table-column>
<el-table-column align="center" label="流程状态" min-width="70">
<template #default="scope">
<dict-tag :options="wf_business_status" :value="scope.row.status"></dict-tag>
</template>
</el-table-column>
<el-table-column label="上传时间" align="center" prop="createTime" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding " width="240">
<template #default="scope">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
<el-button v-hasPermi="['design:drawing:edit']" size="small" type="primary" icon="Edit" @click="handleUpdate(scope.row)"
>修改</el-button
>
</el-col>
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
<el-button v-hasPermi="['design:drawing:remove']" size="small" type="primary" icon="Delete" @click="handleDelete(scope.row)"
>删除</el-button
>
</el-col>
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" size="small" icon="View" v-if="scope.row.status != 'draft'" @click="handleViewInfo(scope.row)">查看</el-button>
</el-col>
<el-col :span="1.5" v-if="scope.row.status === 'waiting'">
<el-button size="small" type="primary" icon="Notification" @click="handleCancelProcessApply(scope.row.id)">撤销</el-button>
</el-col>
</el-row>
</template>
</el-table-column>
</el-table>
<el-tabs type="border-card" v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="过程图纸" name="1">
<DrawingTable
:drawingList="drawingList"
:loading="loading"
:drawing_file_type="drawing_file_type"
:wf_business_status="wf_business_status"
@selection-change="handleSelectionChange"
@view="handleView"
@update="handleUpdate"
@delete="handleDelete"
@view-info="handleViewInfo"
@cancel-process-apply="handleCancelProcessApply"
/>
</el-tab-pane>
<el-tab-pane label="蓝图" name="2">
<DrawingTable
:drawingList="drawingList"
:loading="loading"
:drawing_file_type="drawing_file_type"
:wf_business_status="wf_business_status"
@selection-change="handleSelectionChange"
@view="handleView"
@update="handleUpdate"
@delete="handleDelete"
@view-info="handleViewInfo"
@cancel-process-apply="handleCancelProcessApply"
/>
</el-tab-pane>
<el-tab-pane label="变更图纸" name="3">
<DrawingTable
:drawingList="drawingList"
:loading="loading"
:drawing_file_type="drawing_file_type"
:wf_business_status="wf_business_status"
@selection-change="handleSelectionChange"
@view="handleView"
@update="handleUpdate"
@delete="handleDelete"
@view-info="handleViewInfo"
@cancel-process-apply="handleCancelProcessApply"
/>
</el-tab-pane>
</el-tabs>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
</div>
@ -101,8 +91,9 @@
import { listDrawing, getDrawing, delDrawing, addDrawing, updateDrawing } from '@/api/design/drawing';
import { DrawingVO, DrawingQuery, DrawingForm } from '@/api/design/drawing/types';
import { useUserStoreHook } from '@/store/modules/user';
import { LeaveVO } from '@/api/workflow/leave/types';
import { LeaveVO } from '@/api/workflow/leave/types';
import { cancelProcessApply } from '@/api/workflow/instance';
import DrawingTable from './DrawingTable.vue';
// 获取用户 store
const userStore = useUserStoreHook();
@ -110,6 +101,8 @@ const userStore = useUserStoreHook();
const currentProject = computed(() => userStore.selectedProject);
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { drawing_file_type, wf_business_status } = toRefs<any>(proxy?.useDict('drawing_file_type', 'wf_business_status'));
console.log(drawing_file_type);
const drawingList = ref<DrawingVO[]>([]);
const loading = ref(true);
const showSearch = ref(true);
@ -121,6 +114,7 @@ const fileList = ref([]); // 存储上传的文件列表
const selectedFile = ref(null); // 当前选中的文件
const queryFormRef = ref<ElFormInstance>();
const drawingFormRef = ref<ElFormInstance>();
const activeName = ref('1');
const dialog = reactive({
visible: false,
title: '',
@ -235,7 +229,7 @@ const handleUpdate = async (row?: DrawingVO) => {
proxy.$router.push({
path: `/workflow/drawing/indexEdit`,
query: {
id: row.id,
id: row.id,
type: 'update'
}
});
@ -249,10 +243,12 @@ const handleDelete = async (row?: DrawingVO) => {
proxy?.$modal.msgSuccess('删除成功');
await getList();
};
const handleView = (row) => {
var url= row.file.url
var url = row.file.url;
window.open(url, '_blank');
};
/** 查看按钮操作 */
const handleViewInfo = (row?: LeaveVO) => {
proxy.$tab.closePage(proxy.$route);
@ -264,6 +260,7 @@ const handleViewInfo = (row?: LeaveVO) => {
}
});
};
/** 撤销按钮操作 */
const handleCancelProcessApply = async (id: string) => {
await proxy?.$modal.confirm('是否确认撤销当前单据?');
@ -276,7 +273,14 @@ const handleCancelProcessApply = async (id: string) => {
await getList();
proxy?.$modal.msgSuccess('撤销成功');
};
const handleClick = (val) => {
queryParams.value.pageNum = 1;
queryParams.value.fileType = val.props.name;
getList();
};
onMounted(() => {
getList();
});
</script>
</script>