소스 검색

数据档案管理

hmm 7 달 전
부모
커밋
dedaae4eb6
3개의 변경된 파일44개의 추가작업 그리고 20개의 파일을 삭제
  1. 7 0
      src/api/dataFilling/fileManagement.ts
  2. 20 17
      src/views/dataFilling/dossierDetail.vue
  3. 17 3
      src/views/dataFilling/fileManagement.vue

+ 7 - 0
src/api/dataFilling/fileManagement.ts

@@ -15,3 +15,10 @@ export function fillDetail(params) {
     params: params
   });
 }
+export function collectList(params) {
+  return request({
+    url: '/api/dataFilling/update_collection_status',
+    method: 'put',
+    params: params
+  });
+}

+ 20 - 17
src/views/dataFilling/dossierDetail.vue

@@ -8,7 +8,7 @@
             <p class="report-period">【填报周期】:{{ detailData.start }} 至 {{ detailData.end }}</p>
           </el-col>
           <el-col :span="1.5">
-            <el-button type="primary" @click="exportToExcel()"> 收取 </el-button>
+            <el-button type="primary" @click="handleWrite()"> 收取 </el-button>
           </el-col>
           <el-col :span="1.5">
             <el-button type="danger" @click="handleReturn()"> 返回 </el-button>
@@ -35,7 +35,7 @@
 import { ref, onMounted } from 'vue';
 import { ElTable, ElButton, ElCol, ElRow, ElTableColumn } from 'element-plus';
 import * as XLSX from 'xlsx';
-import {fillDetail} from "@/api/dataFilling/fileManagement";
+import { fillDetail,collectList } from "@/api/dataFilling/fileManagement";
 
 const emits = defineEmits(['close']);
 const props = defineProps({
@@ -52,8 +52,6 @@ const detailData = ref({
 });
 
 onMounted(() => {
-  console.log('table_name:', props.table_name);
-  console.log('eventId:', props.eventId);
   fetchFillDetail();
 });
 
@@ -61,7 +59,6 @@ const fetchFillDetail = async () => {
   try {
 
     const res = await fillDetail({ report_id: props.eventId });
-    // console.log(res);
     // 动态设置表头
     editableHeaders.value = res.columns;
     // 转换表格数据格式以匹配表头
@@ -79,18 +76,24 @@ const fetchFillDetail = async () => {
   }
 };
 
-const exportToExcel = () => {
-  const worksheet = XLSX.utils.json_to_sheet(tableData.value);
-  const workbook = { Sheets: { data: worksheet }, SheetNames: ['data'] };
-  const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
-
-  const blob = new Blob([excelBuffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
-  const link = document.createElement('a');
-  const url = window.URL.createObjectURL(blob);
-  link.href = url;
-  link.download = 'SheetJS.xlsx';
-  link.click();
-  window.URL.revokeObjectURL(url); // 清理
+//收取
+const handleWrite = () => {
+  if (props.eventId && props.eventId !== '') {
+    const data = {
+      report_id:  props.eventId,
+      creator_id: 3,
+      new_status: 2
+    };
+    collectList(data).then(response => {
+      if (response.code === 200) {
+        console.log(response.msg);
+      } else {
+        console.error('更新失败', response.msg);
+      }
+    }).catch(error => {
+      console.error('请求失败', error);
+    });
+  }
 };
 const handleReturn = () => {
   emits('close');

+ 17 - 3
src/views/dataFilling/fileManagement.vue

@@ -49,7 +49,7 @@
 <script setup lang="ts">
 import dossierDetail from "@/views/dataFilling/dossierDetail.vue";
 import {onMounted, reactive, ref} from "vue";
-import {fillList} from "@/api/dataFilling/fileManagement";
+import {collectList, fillList} from "@/api/dataFilling/fileManagement";
 
 const loading = ref(true);
 const showSearch = ref(true);
@@ -106,8 +106,22 @@ const handleSelectionChange = (selection) => {
 //收取
 const handleWrite = (row) => {
   if (row) {
-    // writeFormState.eventId = row.report_id;
-    writeFormState.show = true;
+    // debugger
+    const data = {
+      report_id: row.report_id,
+      creator_id: 3,
+      new_status: 2
+    };
+    collectList(data).then(response => {
+      if (response.code === 200) {
+        console.log(response.msg);
+      } else {
+        console.error('更新失败', response.msg);
+      }
+    }).catch(error => {
+      console.error('请求失败', error);
+    });
+    fetchFillList();
   }
 };
 // 详情