Newer
Older
KaiFengPC / src / views / document / dataArchive / archAudit / audit.vue
@zhangdeliang zhangdeliang on 23 May 1 KB 初始化项目
  1. <template>
  2. <div class="audit">
  3. <el-table :data="tableData" v-loading="loading" stripe :max-height="600">
  4. <el-table-column type="index" width="55" label="序号" />
  5. <el-table-column label="文件名称" prop="fileName" show-overflow-tooltip />
  6. <el-table-column label="归档部门" prop="deptName" show-overflow-tooltip />
  7. <el-table-column label="归档项目" prop="projectName" show-overflow-tooltip />
  8. <el-table-column label="归档时间" prop="createTime" show-overflow-tooltip />
  9. </el-table>
  10. </div>
  11. </template>
  12.  
  13. <script setup>
  14. import { ref, reactive, onMounted, watch } from 'vue';
  15. import { getDocumentArchiveList, projectArchiveApprove } from '@/api/document/dataArchive/archAudit';
  16. const emit = defineEmits(['close']);
  17. const { proxy } = getCurrentInstance();
  18. const props = defineProps({
  19. curRow: {
  20. type: Object,
  21. default: () => ({}),
  22. },
  23. });
  24. const { curRow } = props;
  25. const tableData = ref([]);
  26. const loading = ref(false);
  27.  
  28. const submit = async () => {
  29. const { id, refBusinessId } = curRow;
  30. const res = await projectArchiveApprove({ id, refBusinessId });
  31. if (res?.code !== 200) return;
  32. proxy.$modal.msgSuccess('操作成功');
  33. emit('close', { isRefresh: true });
  34. };
  35.  
  36. const getDetail = async () => {
  37. loading.value = true;
  38. try {
  39. const res = await getDocumentArchiveList({ archiveId: curRow.id });
  40. if (res?.code !== 200) return;
  41. loading.value = false;
  42. tableData.value = res.data || [];
  43. } catch (error) {
  44. loading.value = false;
  45. }
  46. };
  47.  
  48. onMounted(() => {
  49. getDetail();
  50. });
  51.  
  52. defineExpose({
  53. submit,
  54. });
  55. </script>
  56.  
  57. <style lang="scss" scoped></style>