From b6740c65ba8485fc281f0cf38028497b92fbdc94 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: Fri, 08 May 2026 17:30:37 +0800
Subject: [PATCH] 修改

---
 src/views/safetyReview/projectManage/index.vue |   72 +++++++++++++++++++++++++++--------
 1 files changed, 55 insertions(+), 17 deletions(-)

diff --git a/src/views/safetyReview/projectManage/index.vue b/src/views/safetyReview/projectManage/index.vue
index e494238..3036900 100644
--- a/src/views/safetyReview/projectManage/index.vue
+++ b/src/views/safetyReview/projectManage/index.vue
@@ -78,8 +78,9 @@
             }}</span>
         </template>
       </el-table-column>
-      <el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="180">
+      <el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="200">
         <template #default="scope">
+          <el-button link type="danger" v-if="isAdmin && scope.row.state === 4 && scope.row.evaluationState" @click="toBack(scope.row)">退回</el-button>
           <el-button link type="primary" @click="toProcess('view',scope.row)">查看</el-button>
           <el-button link type="primary" v-if="scope.row.step !== 4" @click="toProcess('edit',scope.row)">编辑
           </el-button>
@@ -124,11 +125,11 @@
               <el-cascader
                   style="width: 100%"
                   clearable
-                  v-model.trim="search.queryParams.deptId"
+                  v-model.trim="search.queryParams.deptIds"
                   :show-all-levels="false"
                   placeholder="请选择部门"
                   :options="deptList"
-                  :props="{ value: 'deptId',label: 'deptName',emitPath: false,checkStrictly: true}"></el-cascader>
+                  :props="{ value: 'deptId',label: 'deptName',emitPath: false,checkStrictly: true,multiple:true}"></el-cascader>
             </el-form-item>
             <el-form-item label="项目编码">
               <el-input v-model.trim="search.queryParams.projectCode" placeholder="请输入项目编码"></el-input>
@@ -163,7 +164,7 @@
 // import {delProject, getProjectList, getProjectStatistics} from "@/api/projectManage/project";
 import {ElMessage, ElMessageBox} from "element-plus";
 import Cookies from "js-cookie"
-import {delProject, exportData, exportExpertData, getProjectList, getProjectNum} from "@/api/projectManage";
+import {backInfo, delProject, exportData, exportExpertData, getProjectList, getProjectNum} from "@/api/projectManage";
 // import * as XLSX from 'xlsx';
 import XLSX from 'xlsx-js-style';
 import {listDept} from "@/api/system/dept";
@@ -205,9 +206,14 @@
 const fields = ref({
   '姓名':'expertName',
   '处室':'deptName',
-  '专家费': 'expertFee',
+  '发票金额': 'expertFee',
+  '交通费': 'travelExpenses',
+  '住宿费':'accommodationFee',
   '申请时间': 'createTime',
   '事由': 'projectName',
+  '发现重大隐患':'majorDangers',
+  '发现一般隐患': 'generalHazards'
+
 });
 
 const searchTime = ref([]);
@@ -235,6 +241,8 @@
 const dataList = ref([]);
 const deptList = ref([])
 const total = ref(0);
+const isAdmin = ref(false);
+const userInfo = ref()
 const isAgency = ref(false);
 onMounted(() => {
   Cookies.remove('projectId')
@@ -254,6 +262,8 @@
   };
   // const userInfo = JSON.parse(Cookies.get('userInfo'))
   // isAgency.value = userInfo.identity === 1;
+  userInfo.value = JSON.parse(Cookies.get('userInfo'))
+  isAdmin.value = userInfo.value.admin
 
 });
 const chooseType = ref('');
@@ -346,6 +356,28 @@
         }
       })
 }
+
+const toBack = (val) => {
+  ElMessageBox.confirm(
+      '确定退回此条数据?',
+      '提示',
+      {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+      .then(async () => {
+        const res = await backInfo({id:val.id})
+        if (res.code == 200) {
+          ElMessage.success('数据退回成功')
+          await getList()
+          await getStatistics()
+
+        } else {
+          ElMessage.warning(res.msg)
+        }
+      })
+}
 const confirmClick = () => {
   reset()
   showDrawer.value = false;
@@ -364,17 +396,17 @@
     const title = [[`自治区应急管理厅外聘专家劳务费发放表(项目编码${row.projectCode})`]]
     // 固定一行:填报处室和单位
     const fixedHeader = [
-      ["填报处室:" + row.deptName, "", "", "", "", "单位:元", "", "", "", "",""]
+      ["填报处室:" + row.deptName, "", "", "", "", "单位:元", "", "", "","", "制表日期:"+row.updateTime,"", "","",""]
     ]
     if(res.data && res.data[0] && Array.isArray(res.data[0].projectExpertExportResps) && res.data[0].projectExpertExportResps.length>0){
       let mainData = res.data[0].projectExpertExportResps
       const data = mainData.map((item,index)=>{
-        return [index+1,item.name,item.companyName,item.title,item.idCard,item.freightBasis,item.billingDuration,item.taxExpertFee,item.incomeTaxPayable,item.openBank,item.bankCard]
+        return [index+1,item.name,item.companyName,item.title,item.idCard,item.freightBasis,item.billingDuration,item.taxExpertFee,item.incomeTaxPayable,(item.taxExpertFee-item.incomeTaxPayable).toFixed(2),item.travelExpenses,item.accommodationFee,item.openBank,item.bankCard]
       })
       console.log(data,'data')
       // 定义表头
       const headers = [
-        ["序号", "姓名", "工作单位", "职称", "身份证号", "计费标准", "计费时长", "专家费", "应缴税费", "开户银行", "卡号"]
+        ["序号", "姓名", "工作单位", "职称", "身份证号", "计费标准", "计费时长", "发票金额", "应缴税费","发放金额", "交通费", "住宿费","开户银行", "卡号", "疆内/疆外"]
       ]
       // 固定一行:经办人和负责人
       const footer = [
@@ -382,7 +414,9 @@
           return accumulator + currentValue[7]
         }, 0).toFixed(2)}`,`合计:${data.reduce((accumulator, currentValue) => {
           return accumulator + currentValue[8]
-        }, 0).toFixed(2)}`,"",""]
+        }, 0).toFixed(2)}`,`合计:${data.reduce((accumulator, currentValue) => {
+          return accumulator + Number(currentValue[9])
+        }, 0).toFixed(2)}`,"",""],
       ]
       // 创建工作表
       const ws = XLSX.utils.aoa_to_sheet([
@@ -396,9 +430,10 @@
       const dataRowCount = data.length;
       // 合并单元格的范围
       ws['!merges'] = [
-        { s: { r: 0, c: 0 }, e: { r: 0, c: 10 } },  // 合并标题:第1行 0列到12列
+        { s: { r: 0, c: 0 }, e: { r: 0, c: 12 } },  // 合并标题:第1行 0列到12列
         { s: { r: 1, c: 0 }, e: { r: 1, c: 4 } },  // 合并填报处室:第2行 第0列到4列
-        { s: { r: 1, c: 5 }, e: { r: 1, c: 10 } },  // 合并单位:第2行 第5列到12列
+        { s: { r: 1, c: 5 }, e: { r: 1, c: 9 } },  // 合并单位:第2行 第5列到8列
+        { s: { r: 1, c: 10 }, e: { r: 1, c: 13 } },  // 合并单位:第2行 第5列到8列
         { s: { r: 3 + dataRowCount, c: 0 }, e: { r: 3 + dataRowCount, c: 4 } },  // 合并经办人:最后一行的第0列到4列
         { s: { r: 3 + dataRowCount, c: 5 }, e: { r: 3 + dataRowCount, c: 6} },  // 合并负责人:最后一行的第5列到+6列
       ]
@@ -411,13 +446,14 @@
       // 设置填报处室和单位左对齐
       if (!ws['A2']) ws['A2'] = {}  // 填报处室第一列
       if (!ws['F2']) ws['F2'] = {}  // 单位第一列
-      ws['A2'].s = ws['F2'].s = {
+      if (!ws['J2']) ws['J2'] = {}  // 单位第一列
+      ws['A2'].s = ws['F2'].s  = ws['J2'].s ={
         alignment: { horizontal: 'left', vertical: 'center' }
       };
       // 设置数据区(包括填报处室、单位、数据行和最后一行)为左对齐
       const totalRows = 3 + dataRowCount + 1; // 标题、固定行和数据行的总数
       for (let r = 3; r <= totalRows; r++) {  // 遍历每一行
-        for (let c = 0; c < 11; c++) {  // 遍历每一列
+        for (let c = 0; c < 14; c++) {  // 遍历每一列
           const cellRef = `${String.fromCharCode(65 + c)}${r}`;
           if (!ws[cellRef]) ws[cellRef] = {};  // 确保单元格存在
           ws[cellRef].s = {
@@ -437,11 +473,11 @@
       }
       // 设置最后一行(经办人、负责人)左对齐
       const lastRowStart = 3 + dataRowCount;
-      for (let c = 0; c < 11; c++) {
+      for (let c = 0; c < 14; c++) {
         const cellRef = `${String.fromCharCode(65 + c)}${lastRowStart + 1}`;
         console.log(cellRef,'ref')
         if (!ws[cellRef]) ws[cellRef] = {};  // 确保单元格存在
-        if(cellRef == 'H'+ (4 + dataRowCount) || cellRef == 'I'+ (4 + dataRowCount)){
+        if(cellRef == 'H'+ (4 + dataRowCount) || cellRef == 'I'+ (4 + dataRowCount) || cellRef == 'J'+ (4 + dataRowCount)){
           ws[cellRef].s = {
             alignment: { horizontal: 'center', vertical: 'center' } // 设置居中对齐
           }
@@ -454,7 +490,7 @@
       // 设置列宽,计算每列的最大宽度
       const MIN_COL_WIDTH = 60;
       const colWidths = [];
-      for (let c = 0; c < 13; c++) {
+      for (let c = 0; c < 14; c++) {
         let maxLength = 0;
         // 计算每列最大单元格内容长度
         for (let r = 0; r < totalRows; r++) {
@@ -463,7 +499,9 @@
           if (cell && cell.v) {
             if(cell.v == '序号'){
               maxLength = 1
-            }else {
+            }else if(cell.v == '交通费'){
+              maxLength = 3
+            } else {
               maxLength = Math.max(maxLength, cell.v.toString().length);
             }
 

--
Gitblit v1.9.2