This commit is contained in:
2025-08-16 01:26:38 +08:00
parent 12173054e9
commit 896ea07fad
4 changed files with 12 additions and 242 deletions

View File

@ -83,33 +83,17 @@
</template>
<script setup name="VolumeCatalog" lang="ts">
import {
listVolumeCatalog,
getVolumeCatalog,
delVolumeCatalog,
addVolumeCatalog,
updateVolumeCatalog,
uploadVolumeFile,
getVolumeCatafileList,
lookViewerFile
} from '@/api/design/volumeCatalog';
import { listVolumeCatalog, addVolumeCatalog, updateVolumeCatalog } from '@/api/design/volumeCatalog';
import { VolumeCatalogVO } from '@/api/design/volumeCatalog/types';
import { useUserStoreHook } from '@/store/modules/user';
import { volumeFileViewer, volumeFileViewerList } from '@/api/design/drawing';
const fileList = ref([]);
import { designUserList } from '@/api/design/appointment';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { design_state, wf_business_status, des_user_major } = toRefs(proxy?.useDict('design_state', 'wf_business_status', 'des_user_major'));
import { drawingreviewReceiptsDetail, drawingreviewReceiptsList } from '@/api/design/drawingreview';
const volumeCatalogList = ref<VolumeCatalogVO[]>([]);
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 dialogHistory = ref(false);
// 获取用户 store
const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目
@ -130,32 +114,6 @@ const uploadForm = reactive({
fileList: [],
cancellationIds: [] // 用于存储已作废的文件ID
});
const examineForm = ref({
audit: '',
auditDate: '',
auditId: '',
designer: '',
executionOpinion: '',
executor: '',
executorDate: '',
executorId: '',
id: '1',
num: '',
professional: '',
projectId: '',
projectName: '',
proofreading: '',
proofreadingDate: '',
proofreadingId: '',
stage: '',
subprojectId: '',
subprojectName: '',
verificationContent: '',
verificationOpinion: '',
volume: ''
});
const userList = ref([]);
const userAppList = ref([]); //人事任命的用户
const initFormData: any = {
design: undefined,
projectId: currentProject.value?.id || '',
@ -198,35 +156,6 @@ const getList = async () => {
loading.value = false;
}
};
const getUserAppList = async () => {
const res = await designUserList({ projectId: currentProject.value?.id });
if (res.code === 200) {
console.log(res.rows);
res.rows.forEach((item: any) => {
if (item.userType == 2) {
//设计人员
userAppList.value.push(item);
}
});
}
};
const getDetails = async (id) => {
let res = await drawingreviewReceiptsDetail(id);
examineForm.value = res.data;
};
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
};
/** 表单重置 */
const reset = () => {
form.value = { ...initFormData };
volumeCatalogFormRef.value?.resetFields();
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
@ -239,38 +168,14 @@ const resetQuery = () => {
handleQuery();
};
/** 多选框选中数据 */
const handleSelectionChange = (selection: VolumeCatalogVO[]) => {
ids.value = selection.map((item) => item.design);
single.value = selection.length != 1;
multiple.value = !selection.length;
};
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = '添加设计出图计划';
};
const handleView = (row?: any) => {
fileList.value = row.fileVoList;
viewVisible.value = true;
};
/** 上传文件按钮操作 */
const uploadVisible = ref(false);
const viewVisible = ref(false);
const viewVisible1 = ref(false);
const handleUpload = async (row?: any) => {
resetUploadForm();
uploadForm.volumeCatalogId = row.design;
userList.value = row.noViewerList;
const res = await getVolumeCatafileList(row.design);
uploadForm.fileList = res.data.filter((item) => item.status == '1') || [];
uploadVisible.value = true;
};
/** 重置上传表单 */
const resetUploadForm = () => {
uploadForm.userIds = [];
@ -313,74 +218,7 @@ const handleViewHis = async (row) => {
histroyList.value = res.rows;
}
};
/** 上传文件提交 */
const onSubmit = async () => {
buttonLoading.value = true;
let obj = {
volumeCatalogId: uploadForm.volumeCatalogId,
fileIds: uploadForm.fileId.split(','),
explainText: ''
};
try {
await uploadVolumeFile(obj);
proxy?.$modal.msgSuccess('文件上传成功');
uploadVisible.value = false;
await getList();
} catch (error) {
console.error('上传文件失败:', error);
} finally {
buttonLoading.value = false;
}
};
/** 删除按钮操作 */
const handleDelete = async (row?: VolumeCatalogVO) => {
const _ids = row?.design || ids.value;
await proxy?.$modal.confirm('是否确认删除卷册目录编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
await delVolumeCatalog(_ids);
proxy?.$modal.msgSuccess('删除成功');
await getList();
};
const handleUploadSuccess = async (flieList: any, res: any) => {
proxy?.$modal.msgSuccess('文件上传成功');
getList();
};
/** 审核按钮操作 */
const handleAudit = async (row) => {
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `/design-management/drawingreview/indexEdit`,
query: {
id: row.design,
type: 'update'
}
});
};
/** 查看按钮操作 */
const handleAuditView = async (row) => {
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `/design-management/drawingreview/indexEdit`,
query: {
id: row.design,
type: 'view'
}
});
};
/** 修改按钮操作 */
const handleUpdate = async (row?: VolumeCatalogVO) => {
reset();
const _id = row?.design || ids.value[0];
const res = await getVolumeCatalog(_id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改设计出图计划';
};
onMounted(() => {
getUserAppList();
getList();
});
@ -390,7 +228,6 @@ const listeningProject = watch(
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;
getUserAppList();
getList();
}
);
@ -399,53 +236,3 @@ onUnmounted(() => {
listeningProject();
});
</script>
<style lang="scss">
.volumeCatalog_box {
/* .upload-demo {
width: 100% !important;
} */
table {
border-collapse: collapse; //合并为一个单一的边框
border-color: rgba(199, 199, 199, 1); //边框颜色按实际自定义即可
}
thead {
tr {
th {
background-color: rgba(247, 247, 247, 1); //设置表格标题背景色
height: 35px; //设置单元格最小高度
text-align: center;
letter-spacing: 5px;
padding: 15px;
}
td {
text-align: left;
height: 35px; //设置单元格最小高度
padding: 15px;
}
.th-bg {
background-color: rgba(247, 247, 247, 1);
}
}
}
tbody {
tr {
td {
text-align: left;
height: 40px; //设置单元格最小高度
padding: 15px;
}
th {
height: 35px; //设置单元格最小高度
text-align: center;
letter-spacing: 5px;
padding: 15px;
}
}
}
.table-content {
box-shadow: 0px 0px 10px #ddd;
padding: 20px;
position: relative;
}
}
</style>