From f7cd57455346e4fd7085eae8bcf7b01a75c94d25 Mon Sep 17 00:00:00 2001
From: 周宾 <2802492122@qq.com>
Date: 星期一, 22 十二月 2025 16:35:11 +0800
Subject: [PATCH] 海川开心-协同办公-报销管理金额显示

---
 src/views/collaborativeApproval/approvalProcess/index.vue |   90 +++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 79 insertions(+), 11 deletions(-)

diff --git a/src/views/collaborativeApproval/approvalProcess/index.vue b/src/views/collaborativeApproval/approvalProcess/index.vue
index 79f358b..a55c82c 100644
--- a/src/views/collaborativeApproval/approvalProcess/index.vue
+++ b/src/views/collaborativeApproval/approvalProcess/index.vue
@@ -25,14 +25,14 @@
       </div>
       <div>
         <el-button type="primary" @click="openForm('add')">鏂板</el-button>
-<!--        <el-button @click="handleOut">瀵煎嚭</el-button>-->
+        <el-button @click="handleOut">瀵煎嚭</el-button>
         <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
       </div>
     </div>
     <div class="table_list">
       <PIMTable
           rowKey="id"
-          :column="tableColumn"
+          :column="tableColumnCopy"
           :tableData="tableData"
           :page="page"
           :isSelection="true"
@@ -42,19 +42,30 @@
           :total="page.total"
       ></PIMTable>
     </div>
-    <info-form-dia ref="infoFormDia" @close="handleQuery"></info-form-dia>
+    <info-form-dia ref="infoFormDia" @close="handleQuery" :approveType="approveType"></info-form-dia>
     <approval-dia ref="approvalDia" @close="handleQuery"></approval-dia>
+    <FileList ref="fileListRef" />
   </div>
 </template>
 
 <script setup>
+import FileList from "./fileList.vue";
 import { Search } from "@element-plus/icons-vue";
-import {onMounted, ref} from "vue";
+import {onMounted, ref, computed} from "vue";
 import {ElMessageBox} from "element-plus";
 import InfoFormDia from "@/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue";
 import ApprovalDia from "@/views/collaborativeApproval/approvalProcess/components/approvalDia.vue";
 import {approveProcessDelete, approveProcessListPage} from "@/api/collaborativeApproval/approvalProcess.js";
 import useUserStore from "@/store/modules/user";
+
+// 瀹氫箟缁勪欢鎺ユ敹鐨刾rops
+const props = defineProps({
+  approveType: {
+    type: [Number, String],
+    default: 0
+  }
+});
+
 const userStore = useUserStore();
 
 
@@ -65,6 +76,23 @@
   },
 });
 const { searchForm } = toRefs(data);
+const tableColumnCopy = computed(()=>{
+  if(!tableColumn.value||!tableColumn.value.length){
+    return []
+  }
+  let tabIndex = -1;
+  tableColumn.value.map((item,_index) => {
+    if(props.approveType != 4&&item.prop == 'price'){
+      tabIndex = _index
+    }
+  })
+  if(tabIndex != -1){
+    tableColumn.value.splice(tabIndex, 1)
+    return tableColumn.value
+  }else{
+    return tableColumn.value
+  }
+})
 const tableColumn = ref([
   {
     label: "瀹℃壒鐘舵��",
@@ -116,15 +144,21 @@
   {
     label: "鐢宠浜�",
     prop: "approveUserName",
+    width: 120
   },
   {
-    label: "鐢宠鏃ユ湡",
-    prop: "approveTime",
-		width: 120
+    label: "閲戦锛堝厓锛�",
+    prop: "price",
+    width: 120
+  },
+  {
+    label: props.approveType === 2 ? "寮�濮嬫棩鏈�" : "鐢宠鏃ユ湡",
+    prop: props.approveType === 2 ? "startDate" : "approveTime",
+		width: 200
   },
   {
     label: "缁撴潫鏃ユ湡",
-    prop: "approveOverTime",
+    prop: props.approveType === 2 ? "endDate" : "approveOverTime",
     width: 120
   },
   {
@@ -137,7 +171,7 @@
     label: "鎿嶄綔",
     align: "center",
     fixed: "right",
-    width: 150,
+    width: 230,
     operation: [
       {
         name: "缂栬緫",
@@ -145,7 +179,6 @@
         clickFun: (row) => {
           openForm("edit", row);
         },
-				disabled: (row) => row.approveStatus == 2 || row.approveStatus == 1 || row.approveStatus == 4
       },
       {
         name: "瀹℃牳",
@@ -160,6 +193,13 @@
         type: "text",
         clickFun: (row) => {
           openApprovalDia('view', row);
+        },
+      },
+      {
+        name: "闄勪欢",
+        type: "text",
+        clickFun: (row) => {
+          downLoadFile(row);
         },
       },
     ],
@@ -183,6 +223,11 @@
   page.current = 1;
   getList();
 };
+const fileListRef = ref(null)
+const downLoadFile = (row) => {
+  fileListRef.value.open(row.commonFileList)
+
+}
 const pagination = (obj) => {
   page.current = obj.page;
   page.size = obj.limit;
@@ -190,7 +235,7 @@
 };
 const getList = () => {
   tableLoading.value = true;
-  approveProcessListPage({...page, ...searchForm.value,}).then(res => {
+  approveProcessListPage({...page, ...searchForm.value,approveType:props.approveType}).then(res => {
     tableLoading.value = false;
     tableData.value = res.data.records
     page.total = res.data.total;
@@ -198,6 +243,29 @@
     tableLoading.value = false;
   })
 };
+// 瀵煎嚭
+const handleOut = () => {
+  const type = Number(props.approveType || 0)
+  const urlMap = {
+    0: "/approveProcess/exportZero",
+    1: "/approveProcess/exportOne",
+    2: "/approveProcess/exportTwo",
+    3: "/approveProcess/exportThree",
+    4: "/approveProcess/exportFour",
+    5: "/approveProcess/exportFive",
+  }
+  const url = urlMap[type] || urlMap[0]
+  const nameMap = {
+    0: "鍗忓悓瀹℃壒绠$悊琛�",
+    1: "鍏嚭绠$悊瀹℃壒琛�",
+    2: "璇峰亣绠$悊瀹℃壒琛�",
+    3: "鍑哄樊绠$悊瀹℃壒琛�",
+    4: "鎶ラ攢绠$悊瀹℃壒琛�",
+    5: "閲囪喘鐢宠瀹℃壒琛�",
+  }
+  const fileName = nameMap[type] || nameMap[0]
+  proxy.download(url, {}, `${fileName}.xlsx`)
+}
 // 琛ㄦ牸閫夋嫨鏁版嵁
 const handleSelectionChange = (selection) => {
   selectedRows.value = selection;

--
Gitblit v1.9.3