Newer
Older
KaiFengPC / src / views / document / dataArchive / archAudit / audit.vue
@zhangdeliang zhangdeliang on 23 May 1 KB 初始化项目
<template>
  <div class="audit">
    <el-table :data="tableData" v-loading="loading" stripe :max-height="600">
      <el-table-column type="index" width="55" label="序号" />
      <el-table-column label="文件名称" prop="fileName" show-overflow-tooltip />
      <el-table-column label="归档部门" prop="deptName" show-overflow-tooltip />
      <el-table-column label="归档项目" prop="projectName" show-overflow-tooltip />
      <el-table-column label="归档时间" prop="createTime" show-overflow-tooltip />
    </el-table>
  </div>
</template>

<script setup>
import { ref, reactive, onMounted, watch } from 'vue';
import { getDocumentArchiveList, projectArchiveApprove } from '@/api/document/dataArchive/archAudit';
const emit = defineEmits(['close']);
const { proxy } = getCurrentInstance();
const props = defineProps({
  curRow: {
    type: Object,
    default: () => ({}),
  },
});
const { curRow } = props;
const tableData = ref([]);
const loading = ref(false);

const submit = async () => {
  const { id, refBusinessId } = curRow;
  const res = await projectArchiveApprove({ id, refBusinessId });
  if (res?.code !== 200) return;
  proxy.$modal.msgSuccess('操作成功');
  emit('close', { isRefresh: true });
};

const getDetail = async () => {
  loading.value = true;
  try {
    const res = await getDocumentArchiveList({ archiveId: curRow.id });
    if (res?.code !== 200) return;
    loading.value = false;
    tableData.value = res.data || [];
  } catch (error) {
    loading.value = false;
  }
};

onMounted(() => {
  getDetail();
});

defineExpose({
  submit,
});
</script>

<style lang="scss" scoped></style>