From 4afb944c92aed7287cc4691fc9019f3b9faea1c0 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期二, 03 十一月 2026 16:04:37 +0800
Subject: [PATCH] 增加对pdf预览支持,统计分析对时间范围的限定要求

---
 src/views/project/travelexpenseapply/travelexpensedetail/index.vue |  675 ++++++++++++++++++++++++-------------------------------
 1 files changed, 299 insertions(+), 376 deletions(-)

diff --git a/src/views/project/travelexpenseapply/travelexpensedetail/index.vue b/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
index e499411..cef13e4 100644
--- a/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
+++ b/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
@@ -5,34 +5,17 @@
       <el-form ref="form" :model="form" :rules="rules" label-width="120px">
         <el-row><el-col :span="5">
             <el-form-item label="鐢宠鏃ユ湡" prop="applyTime">
-              <el-date-picker style="width: 100%" v-model="form.applyTime" type="date"
+              <el-date-picker style="width: 100%" v-model="form.applyTime" type="date" format="yyyy-MM-dd"
                 value-format="yyyy-MM-dd HH:mm:ss" placeholder="鐢宠鏃ユ湡" :disabled="true">
               </el-date-picker>
             </el-form-item>
           </el-col>
           <el-col :span="5">
             <el-form-item label="缁忓姙浜�" prop="username">
-<<<<<<< HEAD
               <el-select v-model="form.username" clearable filterable allow-create ref="getReportname"
                 default-first-option placeholder="璇烽�夋嫨">
-                <el-option v-for="item in personsList" :key="item.reportNo" :label="item.reportName"
-                  :value="item.reportName">
-=======
-              <el-select
-                v-model="form.username"
-                clearable
-                filterable
-                allow-create
-                ref="getReportname"
-                default-first-option
-                placeholder="璇烽�夋嫨"
-              >
-                <el-option
-                  v-for="item in personsList"
-                  :label="item.reportName"
-                  :value="item.reportName"
-                >
->>>>>>> 5b26f73b191ca95f12df24ec3e3d7930b4590be7
+                <el-option v-for="(item, index) in personsList" :key="item.reportNo + '-' + index"
+                  :label="item.reportName" :value="item.reportName">
                 </el-option>
               </el-select>
             </el-form-item>
@@ -57,61 +40,24 @@
           </el-col>
           <el-col :span="5">
             <el-form-item label="鎶ラ攢绫诲埆" prop="costtype">
-<<<<<<< HEAD
               <el-select v-model="form.costtype" value-key="value" placeholder="璇烽�夋嫨鎶ラ攢浜哄憳绫诲埆">
                 <el-option v-for="dict in dict.type.sys_travelexpensebelong" :key="dict.value" :label="dict.label"
                   :value="dict.value"></el-option>
-=======
-              <el-select
-                v-model="form.costtype"
-                value-key="value"
-                placeholder="璇烽�夋嫨鎶ラ攢浜哄憳绫诲埆"
-              >
-                <el-option
-                  v-for="dict in dict.type.sys_travelexpensebelong"
-                  :label="dict.label"
-                  :value="dict.value"
-                ></el-option>
->>>>>>> 5b26f73b191ca95f12df24ec3e3d7930b4590be7
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="5">
-<<<<<<< HEAD
-            <el-form-item label="鎹愮尞鑰�" prop="infoid" v-show="form.costtype == 3||form.costtype == 4">
+            <el-form-item label="鎹愮尞鑰�" prop="infoid" v-show="form.costtype == 3 || form.costtype == 4">
               <el-select v-model="form.infoid" @change="selectbaseinfo" clearable filterable placeholder="璇烽�夋嫨鎹愮尞鑰�">
-                <el-option v-for="item in baselist" :key="item.index" :label="item.name" :value="item.infoid">
-=======
-            <el-form-item
-              label="鎹愮尞鑰�"
-              prop="infoid"
-              v-show="form.costtype == 4"
-            >
-              <el-select
-                v-model="form.infoid"
-                @change="selectbaseinfo"
-                @clear="clearDonatorInfo"
-                clearable
-                filterable
-                placeholder="璇烽�夋嫨鎹愮尞鑰�"
-              >
-                <el-option
-                  v-for="item in baselist"
-                  :key="item.index"
-                  :label="item.name"
-                  :value="item.infoid"
-                >
->>>>>>> 5b26f73b191ca95f12df24ec3e3d7930b4590be7
+                <el-option v-for="(item, index) in baselist" :key="item.index + '-' + index" :label="item.name"
+                  :value="item.infoid">
                 </el-option>
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="4">
             <div style="margin-left: 10px;">
-              <dict-tag
-                :options="dict.type.sys_DonationStatus"
-                :value="form.invoicecount"
-              />
+              <dict-tag :options="dict.type.sys_DonationStatus" :value="form.invoicecount" />
             </div>
           </el-col>
         </el-row>
@@ -264,28 +210,10 @@
             </el-table-column>
             <el-table-column prop="personname" slot="" label="璐圭敤浜哄憳" align="center" fixed width="110">
               <template slot-scope="scope">
-<<<<<<< HEAD
                 <el-select v-model="scope.row.personname" clearable filterable allow-create default-first-option
                   placeholder="璇烽�夋嫨">
                   <el-option v-for="item in personsSel" :key="item.id" :label="item.reportNameDesc"
                     :value="item.reportName">
-=======
-                <el-select
-                  v-model="scope.row.personname"
-                  clearable
-                  filterable
-                  allow-create
-                  default-first-option
-                  placeholder="璇烽�夋嫨"
-                  @focus1="getPersons(scope.row)"
-                >
-                  <el-option
-                    v-for="(item, index) in personsSel"
-                    :key="`${item.reportNo}_${index}`"
-                    :label="item.reportName"
-                    :value="item.reportName"
-                  >
->>>>>>> 5b26f73b191ca95f12df24ec3e3d7930b4590be7
                   </el-option>
                 </el-select>
               </template>
@@ -302,7 +230,7 @@
                     }
                   }
                 }" clearable size="small" style="width: 100%" v-model="scope.row.starttime" type="date"
-                  value-format="yyyy-MM-dd HH:mm:ss" placeholder="寮�濮嬫棩鏈�" @blur="getdays(scope.row)">
+                  format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss" placeholder="寮�濮嬫棩鏈�" @blur="getdays(scope.row)">
                 </el-date-picker>
               </template>
             </el-table-column>
@@ -318,7 +246,7 @@
                     }
                   }
                 }" clearable size="small" style="width: 100%" v-model="scope.row.endtime" type="date"
-                  value-format="yyyy-MM-dd HH:mm:ss" placeholder="缁撴潫鏃ユ湡" @blur="getdays(scope.row)">
+                  format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss" placeholder="缁撴潫鏃ユ湡" @blur="getdays(scope.row)">
                 </el-date-picker>
               </template>
             </el-table-column>
@@ -493,28 +421,9 @@
             </el-table-column>
             <el-table-column prop="personname" slot="" label="鏀舵浜�" align="center" fixed width="200">
               <template slot-scope="scope">
-<<<<<<< HEAD
                 <el-select v-model="scope.row.personname" clearable filterable allow-create ref="getReportname"
                   default-first-option placeholder="璇烽�夋嫨" @change="getAccountinfo2(scope.row, scope.row.persontype)">
                   <el-option v-for="item in personsSel" :key="item.id" :label="item.reportNameDesc" :value="item.id">
-=======
-                <el-select
-                  v-model="scope.row.personname"
-                  clearable
-                  filterable
-                  allow-create
-                  ref="getReportname"
-                  default-first-option
-                  placeholder="璇烽�夋嫨"
-                  @change="getAccountinfo2(scope.row, scope.row.persontype)"
-                >
-                  <el-option
-                    v-for="(item, index) in personsSel"
-                    :key="`${item.reportNo}_${index}`"
-                    :label="item.reportName"
-                    :value="item.reportName"
-                  >
->>>>>>> 5b26f73b191ca95f12df24ec3e3d7930b4590be7
                   </el-option>
                 </el-select>
               </template>
@@ -542,7 +451,7 @@
             <!--
             <el-table-column prop="paiddate" slot="" label="鎵撴鏃ユ湡" fixed align="center" width="150">
               <template slot-scope="scope">
-                <el-date-picker clearable size="small" style="width: 100%" v-model="scope.row.paiddate" type="date"
+                <el-date-picker clearable size="small" style="width: 100%" v-model="scope.row.paiddate" type="date" format="yyyy-MM-dd"
                   value-format="yyyy-MM-dd HH:mm:ss" placeholder="鎵撴鏃ユ湡" :disabled="true">
                 </el-date-picker>
               </template>
@@ -624,19 +533,42 @@
     </div>
 
     <el-dialog v-dialogDrags :modal="false" :close-on-click-modal="false" :title="pdftitle" :visible.sync="pdfVisible"
-      width="60%">
+      :fullscreen="pdfFullscreen" width="60%" custom-class="pdf-resize-dialog" @closed="pdfFullscreen = false">
+      <template slot="title">
+        <span>{{ pdftitle }}</span>
+        <el-button class="pdf-fullscreen-btn" size="mini"
+          :icon="pdfFullscreen ? 'el-icon-close' : 'el-icon-full-screen'" @click="pdfFullscreen = !pdfFullscreen">{{
+            pdfFullscreen ? "杩樺師" : "鍏ㄥ睆" }}</el-button>
+      </template>
+      <el-alert
+        :title="
+          activeName == 2
+            ? '褰撳墠姝e湪鎿嶄綔锛氬彂绁ㄦ枃浠讹紙璇风‘璁ょエ鎹睘浜庡彂绁級'
+            : '褰撳墠姝e湪鎿嶄綔锛氭櫘閫氶檮浠讹紙璇峰嬁鍦ㄦ涓婁紶鍙戠エ锛�'
+        "
+        :type="activeName == 2 ? 'success' : 'warning'"
+        :closable="false"
+        show-icon
+        style="margin-bottom: 10px;"
+      />
       <div style="margin-bottom: 10px;">
         <el-table :data="tableDatatop" style="width: 100%">
           <el-table-column prop="orderno" label="搴忓彿"> </el-table-column>
           <el-table-column prop="personname" label="璐圭敤浜哄憳">
           </el-table-column>
-          <el-table-column prop="starttime" label="寮�濮嬫棩鏈�"> </el-table-column>
-          <el-table-column prop="endtime" label="缁撴潫鏃ユ湡"> </el-table-column>
+          <el-table-column prop="starttime" label="寮�濮嬫棩鏈�">
+            <template slot-scope="scope">
+              {{ scope.row.starttime ? parseTime(scope.row.starttime, "{y}-{m}-{d}") : "" }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="endtime" label="缁撴潫鏃ユ湡">
+            <template slot-scope="scope">
+              {{ scope.row.endtime ? parseTime(scope.row.endtime, "{y}-{m}-{d}") : "" }}
+            </template>
+          </el-table-column>
           <el-table-column prop="departure" label="鍑哄彂鍦�"> </el-table-column>
           <el-table-column prop="destination" label="鍒拌揪鍦�"> </el-table-column>
           <el-table-column prop="days" label="澶╂暟"> </el-table-column>
-        </el-table>
-        <el-table :data="tableDatatop" style="width: 100%">
           <el-table-column prop="traffictype" label="鍑哄彂浜ら�氬伐鍏�">
           </el-table-column>
           <el-table-column prop="traffictype2" label="杩斿洖浜ら�氬伐鍏�">
@@ -663,7 +595,7 @@
               <div>
                 <el-upload size="mini" class="upload-demo" :action="uploadFileUrl" :file-list="fileListto"
                   :show-file-list="false" multiple drag :headers="headers" :on-success="(response, file, fileList) =>
-                    uploadSccess(response, file, fileList)
+                      uploadSccess(response, file, fileList)
                     " :on-preview="downFile" :disabled="operationType == 'detail'" :on-error="handleUploadError"
                   :on-remove="remove" accept="image/*,.pdf">
                   <i class="el-icon-upload"></i>
@@ -694,35 +626,7 @@
               </div>
             </div>
 
-            <div v-if="this.previewpdf && pdfimgsrcList.length" class="pdfimgmin">
-              <!-- <img :src="pdfimg" /> -->
-              <!-- <el-image
-                style="width: 95%; height: 90%"
-                :src="pdfimg"
-<<<<<<< HEAD
-                :preview-src-list="pdfimgsrcList" -->
-              >
-              <el-image ref="imagePreview" style="width: 95%; height: 90%" :src="pdfimg"
-                @click="handleImageClick(initialIndex)">
-=======
-                :preview-src-list="pdfimgsrcList"
-              > -->
-              <el-image
-                ref="imagePreview"
-                style="width: 95%; height: 90%"
-                :src="pdfimg"
-                @click="handleImageClick(initialIndex)"
-              >
->>>>>>> 5b26f73b191ca95f12df24ec3e3d7930b4590be7
-              </el-image>
-              <custom-image-viewer :url-list="pdfimgsrcList" :initial-index="currentIndex" :visible="viewerVisible"
-                @update:visible="viewerVisible = $event" @close="handleViewerClose" />
-              <!-- <div slot="error" class="image-slot">
-              <i class="el-icon-picture-outline"></i>
-            </div> -->
-              <!-- </el-image> -->
-            </div>
-            <div v-else class="pdfimgmins">{{ hintitle }}</div>
+            <attachment-preview-pane :file="embeddedFile" style="flex: 1; min-width: 0;" />
           </div>
         </el-tab-pane>
         <el-tab-pane label="鍙戠エ鏂囦欢" :name="2">
@@ -731,7 +635,7 @@
               <div>
                 <el-upload size="mini" class="upload-demo" :action="uploadFileUrl" :file-list="invoicefileList"
                   :show-file-list="false" multiple drag :headers="headers" :on-success="(response, file, fileList) =>
-                    uploadSccess(response, file, fileList)
+                      uploadSccess(response, file, fileList)
                     " :on-preview="downFile" :disabled="operationType == 'detail'" :on-error="handleUploadError"
                   :on-remove="remove" accept="image/*,.pdf">
                   <i class="el-icon-upload"></i>
@@ -762,16 +666,7 @@
               </div>
             </div>
 
-            <div v-if="this.previewpdf && invoicepdfimgsrcList.length" class="pdfimgmin">
-              <!-- <img :src="pdfimg" /> -->
-              <el-image style="width: 95%; height: 90%" :src="invoicepdfimg"
-                @click="invoicehandleImageClick(initialIndex)">
-              </el-image>
-              <custom-image-viewer :url-list="invoicepdfimgsrcList" :initial-index="invoicecurrentIndex"
-                :visible="invoiceviewerVisible" @update:visible="invoiceviewerVisible = $event"
-                @close="invoicehandleViewerClose" />
-            </div>
-            <div v-else class="pdfimgmins">{{ hintitle }}</div>
+            <attachment-preview-pane :file="invoiceEmbeddedFile" style="flex: 1; min-width: 0;" />
           </div>
         </el-tab-pane>
       </el-tabs>
@@ -811,7 +706,8 @@
   exportReimbursement,
   getdownload,
   checkfund,
-  fundSubmit
+  fundSubmit,
+  listbypowerone
 } from "@/api/project/reimbursement";
 import {
   addReimbursementdetail,
@@ -833,6 +729,8 @@
 import { listReportname, listUser } from "@/api/project/organization";
 import { getToken } from "@/utils/auth";
 import debounce from "lodash/debounce";
+import { moneySum, moneyAdd, moneyRound } from "@/utils/money";
+import { checkFileName, checkDetails } from "@/utils/fileNameCheck";
 export default {
   components: {
     Treeselect,
@@ -866,13 +764,14 @@
       personsList: [],
       //涓嬫媺鍙互閫夋嫨浜哄憳鍒楄〃
       personsSel: [],
-      activeName: 1, //鏂囦欢绫诲瀷
+      activeName: 2, //鏂囦欢绫诲瀷锛氶粯璁ゅ彂绁ㄦ枃浠�
       // 閮ㄩ棬鏍戦�夐」
 
       deptOptions: undefined,
       //绁ㄦ嵁鏂囦欢
       pdftitle: "",
       pdfimg: "",
+      invoiceEmbeddedFile: null,
       pdfVisible: false,
       costtypeobj: {
         value: 0,
@@ -1021,6 +920,8 @@
         flowconclusion: null,
         fundid: null
       },
+      //杩炵画瀹℃壒锛氬緟瀹℃壒鍒楄〃
+      pendingList: [],
       jurisdiction: false,
 
       //淇濆瓨鎸夐挳鎺у埗
@@ -1179,17 +1080,8 @@
     handleUploadError() { },
     // 鑾峰彇璇锋眰澶�
     Getnetworkheader() {
-      console.log(window.location.href);
-      let string = window.location.href;
-      if (string.includes("9091")) {
-        const index = string.indexOf("9091");
-        this.Networkheader = string.slice(0, index + 4); // 鎴彇9091鍙婂叾鍓嶉儴瀛楃
-        console.log(this.Networkheader);
-      } else {
-        const index = string.indexOf("8032");
-        this.Networkheader = string.slice(0, index + 4); // 鎴彇8032鍙婂叾鍓嶉儴瀛楃
-        console.log(this.Networkheader);
-      }
+      // 浠ュ綋鍓嶉〉闈� origin 涓哄噯锛屽吋瀹� 80/8032/9091 鍙婂悗缁鍙h皟鏁�
+      this.Networkheader = window.location.origin;
     },
     // 鍙戠エ鍒囨崲
     handleClick(tab, event) {
@@ -1215,41 +1107,68 @@
     },
 
     //鏂囦欢涓婁紶鎴愬姛鍥炶皟
+    /**
+     * 2026-10-15锛氫笂浼犳椂鏍¢獙闄勪欢鏂囦欢鍚嶏紙涓氬姟瑕佹眰锛氫笉鍚堟牸绔嬪嵆鎻愮ず涓斾笉鍔犲叆鍒楄〃锛夈��
+     * 瑙勫垯涓庡悗绔� AttachmentNameValidator 鍚屽彛寰勶細涓嶅己鍒跺惈涓枃 / 鍘绘帀鎵╁睍鍚嶅悗涓诲共 鈮�20 瀛� /
+     * 涓嶅惈绌烘牸鍙� / \ : * ? " < > | # % 绛夌壒娈婂瓧绗︺��
+     */
+    checkUploadFileName(file) {
+      const raw = file && file.raw ? file.raw.name : file && file.name;
+      const r = checkFileName(raw);
+      if (!r.ok) {
+        this.$modal.msgError(r.msg);
+        return false;
+      }
+      return true;
+    },
+
+    /**
+     * 2026-10-15锛氫繚瀛樺墠鏍¢獙鏁村崟鏄庣粏闄勪欢鏂囦欢鍚嶏紙鍚悓涓�琛屽唴閲嶅悕锛夈��
+     * 鍙e緞锛堜笟鍔$‘璁わ級锛氬彧鏍¢獙"鏈鍙樻洿"鐨勯檮浠垛�斺�旇�佸崟鎹噷宸插瓨鍦ㄧ殑涓嶅悎瑙勯檮浠跺悕涓嶈兘鎶婁繚瀛樺崱姝�
+     * 锛堝惁鍒欒�佸崟鎹敼涓�涓噾棰濋兘瀛樹笉杩涘幓锛夈�傚悗绔寜 id 璇绘棫璁板綍鏀捐鍘嗗彶闄勪欢锛涘墠绔嬁涓嶅埌"鍝簺鏄巻鍙�"
+     * 鐨勬潈濞佷俊鎭紝鍥犳**浠呮柊澧炲崟鎹�**鍋氫繚瀛樺墠鎷︽埅锛岀紪杈戣�佸崟鎹椂鏂板鐨勪笉鍚堣闄勪欢鐢卞悗绔簩娆℃牎楠屾嫤涓嬨��
+     */
+    checkDetailFileNames() {
+      if (this.form && this.form.id) {
+        return true;
+      }
+      const c = checkDetails(this.rbDetails);
+      if (!c.ok) {
+        this.$modal.msgError(c.msg);
+        return false;
+      }
+      return true;
+    },
+
     uploadSccess(response, file, fileList) {
+      if (!this.checkUploadFileName(file)) {
+        return;
+      }
       this.rbDetails;
       const config = {
         headers: { Authorization: "Bearer " + this.ICDtoken }
       };
-      const pdfimg = this.Networkheader + "/prod-api" + response.fileName;
+      const pdfimg = this.Networkheader + process.env.VUE_APP_BASE_API + response.fileName;
       //鑾峰彇绁ㄦ嵁淇℃伅浣嶇疆
       if (this.activeName == 1) {
         if (response.code == 200) {
           this.previewpdf = true;
 
-          fetch(pdfimg, config)
-            .then(response => response.blob())
-            .then(blob => {
-              // 灏嗚幏鍙栫殑鏁版嵁娴佽浆鎹负URL
-              this.pdfimg = URL.createObjectURL(blob);
-              this.pdfimgsrcList.push(URL.createObjectURL(blob));
-              this.fileListto.push({
-                name: file.name,
-                url: URL.createObjectURL(blob)
-              });
-              // console.log(file.response.url);
-              // console.log(file);
-
-              this.pdfimgsrcList.push(file.response.url);
-              this.fileListto.push({
-                name: file.response.fileName,
-                url: file.response.url
-              });
-              console.log(URL.createObjectURL(blob), "ur杞崲");
-            })
-            .catch(error => {
-              console.error("Error loading image", error);
-              return;
-            });
+          // 鏂颁笂浼犳枃浠剁洿鎺ヤ娇鐢ㄦ祻瑙堝櫒鏈湴 File锛岄伩鍏嶆湇鍔$鏂囦欢鍦板潃/Token
+          // 寮傚父鏃舵妸 JSON 閿欒鍝嶅簲褰撴垚鍥剧墖鎴� PDF 棰勮銆�
+          const localBlob = file.raw;
+          const localUrl = URL.createObjectURL(localBlob);
+          this.pdfimg = localUrl;
+          this.embeddedFile = {
+            name: file.name,
+            url: localUrl,
+            type: /\.pdf$/i.test(file.name) ? "pdf" : "image"
+          };
+          this.pdfimgsrcList.push(localUrl);
+          this.fileListto.push({
+            name: file.name,
+            url: localUrl
+          });
 
           this.$modal.msgSuccess(response.msg);
 
@@ -1268,21 +1187,19 @@
       } else {
         if (response.code == 200) {
           this.previewpdf = true;
-          fetch(pdfimg, config)
-            .then(response => response.blob())
-            .then(blob => {
-              // 灏嗚幏鍙栫殑鏁版嵁娴佽浆鎹负URL
-              this.invoicepdfimg = URL.createObjectURL(blob);
-              this.invoicepdfimgsrcList.push(URL.createObjectURL(blob));
-              this.invoicefileListto.push({
-                name: file.name,
-                url: URL.createObjectURL(blob)
-              });
-            })
-            .catch(error => {
-              console.error("Error loading image", error);
-              return;
-            });
+          const localBlob = file.raw;
+          const localUrl = URL.createObjectURL(localBlob);
+          this.invoicepdfimg = localUrl;
+          this.invoiceEmbeddedFile = {
+            name: file.name,
+            url: localUrl,
+            type: /\.pdf$/i.test(file.name) ? "pdf" : "image"
+          };
+          this.invoicepdfimgsrcList.push(localUrl);
+          this.invoicefileListto.push({
+            name: file.name,
+            url: localUrl
+          });
 
           this.$modal.msgSuccess(response.msg);
 
@@ -1318,7 +1235,7 @@
       if (this.rbDetails[index].annexfilesList) {
         const fetchPromises = this.rbDetails[index].annexfilesList.map(
           (value, indexson) => {
-            const pdfimg = this.Networkheader + "/prod-api" + value.url;
+            const pdfimg = this.Networkheader + process.env.VUE_APP_BASE_API + value.url;
             return fetch(pdfimg, config)
               .then(response => response.blob())
               .then(blob => {
@@ -1351,7 +1268,7 @@
       if (this.rbDetails[index].invoicefilesList) {
         const fetchPromises = this.rbDetails[index].invoicefilesList.map(
           (value, indexson) => {
-            const pdfimg = this.Networkheader + "/prod-api" + value.url;
+            const pdfimg = this.Networkheader + process.env.VUE_APP_BASE_API + value.url;
             return fetch(pdfimg, config)
               .then(response => response.blob())
               .then(blob => {
@@ -1385,7 +1302,7 @@
         this.pdftitle = "";
       }
 
-      if (this.activeName == "common") {
+      if (this.activeName == 1) {
         this.pdftitle = "鍏�" + this.pdfimgsrcList.length + "椤�";
       } else {
         this.pdftitle = "鍏�" + this.invoicepdfimgsrcList.length + "椤�";
@@ -1394,50 +1311,17 @@
       console.log(this.rbDetails[index].annexfilesList, "annexfilesList");
     },
 
-    // 鐐瑰嚮宸蹭笂浼犳枃浠�
+    // 宸梾鎶ラ攢锛氶檮浠剁粺涓�浣跨敤鐙珛 FilePreview锛堝綍鍏ャ�佸鎵广�佽鎯呬竴鑷达級
     downFile(item) {
-      if (this.activeName == 1) {
-        this.pdftitle =
-          "鍏�" + this.pdfimgsrcList.length + "椤癸紝褰撳墠閫変腑" + item.name;
-        let name = item.name.split(".");
-        if (name[1] == "pdf") {
-          this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮");
-          this.previewpdf = false;
-          this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮";
-        } else if (name[1] == "jpg" || "png") {
-          console.log(item, "灞曠ず");
-          this.previewpdf = true;
-          if (item.url) {
-            this.pdfimg = item.url;
-          } else {
-            this.pdfimg = "";
-          }
-        } else {
-          this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮";
-          this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮");
-          this.previewpdf = false;
-        }
-      } else {
-        this.pdftitle =
-          "鍏�" + this.invoicepdfimgsrcList.length + "椤癸紝褰撳墠閫変腑" + item.name;
-        let name = item.name.split(".");
-        if (name[1] == "pdf") {
-          this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮");
-          this.previewpdf = false;
-          this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮";
-        } else if (name[1] == "jpg" || "png") {
-          this.previewpdf = true;
-          if (item.url) {
-            this.invoicepdfimg = item.url;
-          } else {
-            this.invoicepdfimg = "";
-          }
-        } else {
-          this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮";
-          this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮");
-          this.previewpdf = false;
-        }
+      const source =
+        this.activeName == 1 ? this.fileListto : this.invoicefileListto;
+      let list = (source || []).map(f => ({ name: f.name, url: f.url }));
+      let index = list.findIndex(f => f.url === item.url);
+      if (index < 0 && item && item.url) {
+        list = [{ name: item.name, url: item.url }];
+        index = 0;
       }
+      this.$previewFile(list, index > -1 ? index : 0);
     },
     getIndexInArray(arr, obj) {
       return arr.indexOf(obj);
@@ -1672,9 +1556,9 @@
           if (tempStr == "鏉窞") {
             row.otherexpense = "";
           } else if (
-            tempStr == "鏉窞-妗愬簮" ||
-            tempStr == "鏉窞-寤哄痉" ||
-            tempStr == "鏉窞-娣冲畨"
+            tempStr.includes("妗愬簮") ||
+            tempStr.includes("寤哄痉") ||
+            tempStr.includes("娣冲畨")
           ) {
             row.otherexpense = (parseInt(row.days) * 60).toString();
           } else {
@@ -2063,7 +1947,7 @@
             .map(item => ({ url: item, name: item }))
           : [];
         //瀹℃牳鐘舵��
-        this.form.recordstatus = response.data.recordstatus + "";
+        this.form.recordstatus = this.toStatusText(response.data.recordstatus, "-1");
         let ids = response.data.id;
         let listFundflowparams = {
           fundid: ids,
@@ -2074,14 +1958,19 @@
         });
 
         //鎶ラ攢鏄庣粏
-        getReimbursementdetaillist(ids).then(res => {
-          this.rbDetails = res.data;
-          //鍚堣璐圭敤
-          // if (this.rbDetails.length > 0) this.sumTotalFee();
-          for (let i = 0; i < this.rbDetails.length; i++) {
-            this.sumRowFee(this.rbDetails[i]);
-          }
-        });
+        getReimbursementdetaillist(ids)
+          .then(res => {
+            this.rbDetails = this.normalizeDetailList(res);
+            //鍚堣璐圭敤
+            // if (this.rbDetails.length > 0) this.sumTotalFee();
+            for (let i = 0; i < this.rbDetails.length; i++) {
+              this.sumRowFee(this.rbDetails[i]);
+            }
+          })
+          .catch(err => {
+            this.rbDetails = [];
+            console.error("鑾峰彇鎶ラ攢鏄庣粏澶辫触,id=" + ids, err);
+          });
 
         //浠樻淇℃伅
         this.queryParamsPayee.rbid = ids;
@@ -2104,12 +1993,21 @@
       this.reset();
       this.open = true;
       const id = ids || this.ids;
-      this.checkObj.fundid = id;
+      // 閲嶇疆瀹℃壒淇℃伅锛岄伩鍏嶄笂涓�鍗曠殑瀹℃壒缁撴灉甯﹀叆涓嬩竴鍗�
+      this.checkObj = {
+        flowlevelone: null,
+        flowconclusion: null,
+        fundid: id
+      };
+
+      // 杩炵画瀹℃壒锛氬姞杞藉綋鍓嶇敤鎴风殑寰呭鎵瑰垪琛�
+      this.getPendingList();
 
       getReimbursement(id).then(response => {
         this.form = response.data;
         console.log(this.form.checkstatus, "checkstatus");
-        this.form.checkstatus = this.form.checkstatus.toString();
+        // checkstatus 鍦ㄥ簱涓彲涓虹┖锛堥瀹$姸鎬佸皻鏈骇鐢熸椂锛夛紝鐩存帴 toString 浼氭姏 TypeError 涓柇鍚庣画鍙栨暟
+        this.form.checkstatus = this.toStatusText(this.form.checkstatus, "-1");
 
         //绁ㄦ嵁
         this.fileListto = this.form.annexfiles
@@ -2136,16 +2034,22 @@
         });
 
         //鎶ラ攢鏄庣粏
-        getReimbursementdetaillist(ids).then(res => {
-          this.rbDetails = res.data;
-          console.log(this.rbDetails);
+        getReimbursementdetaillist(ids)
+          .then(res => {
+            this.rbDetails = this.normalizeDetailList(res);
+            console.log("鎶ラ攢鏄庣粏琛屾暟锛�", this.rbDetails.length, this.rbDetails);
 
-          //鍚堣璐圭敤
-          // if (this.rbDetails.length > 0) this.sumTotalFee();
-          for (let i = 0; i < this.rbDetails.length; i++) {
-            this.sumRowFee(this.rbDetails[i]);
-          }
-        });
+            //鍚堣璐圭敤
+            // if (this.rbDetails.length > 0) this.sumTotalFee();
+            for (let i = 0; i < this.rbDetails.length; i++) {
+              this.sumRowFee(this.rbDetails[i]);
+            }
+          })
+          .catch(err => {
+            // 鍙栨暟澶辫触鏃朵笉鍐嶉潤榛橈細缃┖骞舵墦鍑哄師鍥狅紝閬垮厤鈥滄帴鍙f湁鏁版嵁浣嗛〉闈㈢┖鐧解�濇棤浠庢帓鏌�
+            this.rbDetails = [];
+            console.error("鑾峰彇鎶ラ攢鏄庣粏澶辫触,id=" + ids, err);
+          });
 
         //浠樻淇℃伅
         this.queryParamsPayee.rbid = ids;
@@ -2194,26 +2098,86 @@
         if (res.code == 200) {
           this.$modal.closeLoading();
           this.$modal.msgSuccess("鎻愪氦瀹℃牳鎴愬姛!");
-          // 鍏抽棴绐楀彛
-          this.$store.dispatch("tagsView/delView", this.$route);
-          this.$router.go(-1);
+          // 杩炵画瀹℃壒锛氳闂槸鍚︾户缁鎵逛笅涓�鍗�
+          this.continueOrExit();
         } else {
           this.$modal.closeLoading();
-          if (res.msg) {
-            this.$modal.msgError("鎿嶄綔澶辫");
-          } else {
-            this.$modal.msgError(res.msg);
-          }
+          this.$modal.msgError(res.msg || "鎿嶄綔澶辫触");
         }
       });
     },
 
+    // 鑾峰彇褰撳墠鐢ㄦ埛寰呭鎵瑰垪琛紙鐢ㄤ簬杩炵画瀹℃壒锛�
+    getPendingList() {
+      listbypowerone({
+        pageNum: 1,
+        pageSize: 1000,
+        CHECKFLAG: 1
+      })
+        .then(res => {
+          this.pendingList = res.rows || [];
+        })
+        .catch(() => {
+          this.pendingList = [];
+        });
+    },
+
+    // 瀹℃壒瀹屾垚鍚庯細璇㈤棶鏄惁缁х画瀹℃壒涓嬩竴鍗�
+    continueOrExit() {
+      const list = this.pendingList || [];
+      const curId = String(this.checkObj.fundid);
+      const idx = list.findIndex(item => String(item.id) === curId);
+      let next = null;
+      if (idx > -1 && idx + 1 < list.length) {
+        next = list[idx + 1];
+      } else {
+        // 褰撳墠宸叉槸鏈綅锛堟垨浠庝腑闂村紑濮嬶級锛屽彇鍓╀綑鍒楄〃涓涓�鏉¢潪褰撳墠鍗曟嵁
+        next = list.find(item => String(item.id) !== curId) || null;
+      }
+
+      if (next) {
+        this.$confirm("瀹℃壒宸插畬鎴愶紝鏄惁缁х画瀹℃壒涓嬩竴寮犲緟瀹℃壒鍗曟嵁锛�", "鎻愮ず", {
+          confirmButtonText: "缁х画瀹℃壒",
+          cancelButtonText: "杩斿洖鍒楄〃",
+          type: "info"
+        })
+          .then(() => {
+            // 鐩存帴鍦ㄥ綋鍓嶉〉闈㈠姞杞戒笅涓�寮犲緟瀹℃壒鍗曟嵁
+            this.handleCheck(next.id);
+            // 鍚屾鏇存柊鍦板潃鏍忥紝閬垮厤鍒锋柊鍚庡洖鍒颁笂涓�鍗�
+            this.$router
+              .replace({
+                path: this.$route.path,
+                query: { id: next.id, pos: 4 }
+              })
+              .catch(() => { });
+          })
+          .catch(() => {
+            this.exitToPage();
+          });
+      } else {
+        this.$modal.msgSuccess("宸叉棤寰呭鎵瑰崟鎹紝杩斿洖鍒楄〃");
+        this.exitToPage();
+      }
+    },
+
+    // 杩斿洖鍒楄〃椤�
+    exitToPage() {
+      this.$store.dispatch("tagsView/delView", this.$route);
+      this.$router.go(-1);
+    },
+
     /** 鎻愪氦淇濆瓨鎸夐挳 */
     submitForm: debounce(function (data) {
+      // 2026-10-15锛氫繚瀛樺墠闄勪欢鏂囦欢鍚嶈鑼冩牎楠岋紙浠呮柊澧炲崟鎹紱鑰佸崟鎹殑鍘嗗彶闄勪欢鐢卞悗绔寜"鍙牎楠屾湰娆″彉鏇�"鏀捐锛�
+      if (!this.checkDetailFileNames()) {
+        return;
+      }
+
       this.$refs["form"].validate(valid => {
         if (valid) {
           //绁ㄦ嵁鏂囦欢澶勭悊
-          // const addnumber = new Decimal(this.rbPayees.reduce((amount, item) => amount + Number(item.amount), 0 ));  
+          // const addnumber = new Decimal(this.rbPayees.reduce((amount, item) => amount + Number(item.amount), 0 ));
           // console.log(this.form.amountrequested,addnumber);
           // //鏍¢獙璇锋閲戦鍚堣鏄惁绛変簬鎶ラ攢鍗曢噾棰�
           // if (this.form.amountrequested != addnumber) {
@@ -2225,7 +2189,6 @@
           //   return;
           // }
 
-<<<<<<< HEAD
           // 1. 鍦� reduce 绱姞鏃讹紝鐩存帴浼犲叆瀛楃涓茬粰 Decimal锛屽苟浣跨敤 .plus() 鏂规硶杩涜绱姞
           // 鍒濆鍊艰涓� new Decimal(0)锛岀‘淇濆叏绋嬮珮绮惧害杩愮畻
           const addnumber = this.rbPayees.reduce((amount, item) => {
@@ -2237,14 +2200,6 @@
           // 2. 浣跨敤 Decimal 鐨� .eq() 鏂规硶杩涜涓ユ牸鐩哥瓑姣旇緝
           // 杩欐牱鏃㈣В鍐充簡绮惧害闂锛屼篃瑙e喅浜嗙被鍨嬭浆鎹㈡瘮杈冪殑闂
           if (!addnumber.eq(this.form.amountrequested)) {
-=======
-          // 淇濈暀2浣嶅皬鏁板悗杩涜姣旇緝
-          const requestedAmount = Number(this.form.amountrequested);
-          const calculatedAmount = Number(addnumber);
-
-          // 浣跨敤toFixed淇濈暀2浣嶅皬鏁�
-          if (requestedAmount.toFixed(2) !== calculatedAmount.toFixed(2)) {
->>>>>>> 5b26f73b191ca95f12df24ec3e3d7930b4590be7
             this.$message({
               message: "鎶ラ攢璇锋琛ㄤ腑鍚堣閲戦涓嶇瓑浜庢姤閿�鍗曠殑鎶ラ攢閲戦锛岃鏇存鍚庡啀淇濆瓨锛侊紒",
               type: "warning"
@@ -2302,7 +2257,7 @@
             //淇濆瓨鏄庣粏
             for (let i = 0; i < rbDetails.length; i++) {
               if (rbDetails[i].rbid != null) {
-                if (rbDetails[i].persontype == "瀹跺睘"||rbDetails[i].persontype == "涓撳") {
+                if (rbDetails[i].persontype == "瀹跺睘" || rbDetails[i].persontype == "涓撳") {
                   if (this.form.infoid) {
                     updateReimbursementdetail(rbDetails[i]);
                   } else {
@@ -2442,6 +2397,11 @@
     },
     // 鎺ュ彈鎻愰啋绔嬪埢淇濆瓨
     Savenow() {
+      // 2026-10-15锛氫繚瀛樺墠闄勪欢鏂囦欢鍚嶈鑼冩牎楠岋紙浠呮柊澧炲崟鎹紱鑰佸崟鎹殑鍘嗗彶闄勪欢鐢卞悗绔寜"鍙牎楠屾湰娆″彉鏇�"鏀捐锛�
+      if (!this.checkDetailFileNames()) {
+        return;
+      }
+
       this.Savereminder = false;
       this.Reminderquantity = 0;
       this.totalquantity = 0;
@@ -2718,108 +2678,71 @@
         });
     },
 
-    //璁$畻涓�琛屽悎璁�
-    //璁$畻褰撳墠琛屾姤閿�鍐呭璐圭敤鍚堣
-    sumRowFee(row) {
-      let totalFee = 0;
-      if (!isNaN(parseFloat(row.trafficexpense))) {
-        totalFee += parseFloat(row.trafficexpense);
+    /**
+     * 鐘舵�佺被瀛楁杞瓧绗︿覆锛堟帴鍙e彲鑳借繑鍥� null锛夈��
+     *
+     * 鑳屾櫙锛歝heckstatus銆乺ecordstatus 绛夊湪搴撲腑鍙┖锛屾棭鏈熺洿鎺ヨ皟鐢� .toString()
+     * 浼氭姏 TypeError 骞朵腑鏂叾鍚庣殑鍙栨暟閫昏緫锛岃〃鐜颁负鈥滄帴鍙e凡鏈夋暟鎹絾鏄庣粏鍖虹┖鐧解�濄��
+     *
+     * @param {*} value 鍘熷鐘舵�佸��
+     * @param {string} fallback 涓虹┖鏃剁殑鍏滃簳鍊�
+     * @returns {string}
+     */
+    toStatusText(value, fallback) {
+      if (value === null || value === undefined || value === "") {
+        return fallback;
       }
-      if (!isNaN(parseFloat(row.cityfee))) {
-        totalFee += parseFloat(row.cityfee);
-      }
-      if (!isNaN(parseFloat(row.hotelexpense))) {
-        totalFee += parseFloat(row.hotelexpense);
-      }
-      if (!isNaN(parseFloat(row.otherexpense))) {
-        totalFee += parseFloat(row.otherexpense);
-      }
-      if (!isNaN(parseFloat(row.foodexpenses))) {
-        totalFee += parseFloat(row.foodexpenses);
-      }
-      if (!isNaN(parseFloat(row.foodallowance))) {
-        totalFee += parseFloat(row.foodallowance);
-      }
-      if (!isNaN(parseFloat(row.otherfeeamount))) {
-        totalFee += parseFloat(row.otherfeeamount);
-      }
-      row.total = totalFee.toFixed(2);
+      return String(value);
+    },
 
-      /*
-      if (!isNaN(parseFloat(this.rbDetails[rowIndex].trafficexpense))) {
-        totalFee += parseFloat(this.rbDetails[rowIndex].trafficexpense);
+    /**
+     * 缁熶竴浠庢槑缁嗘帴鍙e搷搴斾腑鍙栧嚭鏁扮粍銆�
+     *
+     * 姝e父涓� AjaxResult 鐨� data 鏁扮粍锛涜嫢鍚庣鏀逛负鍒嗛〉缁撴瀯锛坱otal + rows锛夛紝
+     * res.data 灏嗕笉鏄暟缁勶紝鐩存帴缁戝畾鍒� el-table 浼氬鑷粹�滄湁鏁版嵁浣嗕笉鏄剧ず鈥濄��
+     *
+     * @param {Object} res 鎺ュ彛鍘熷鍝嶅簲
+     * @returns {Array} 鏄庣粏鏁扮粍锛堝紓甯告椂涓虹┖鏁扮粍锛屼笉浼氳琛ㄦ牸鎷垮埌闈炴暟缁勶級
+     */
+    normalizeDetailList(res) {
+      if (!res) {
+        return [];
       }
-      if (!isNaN(parseFloat(this.rbDetails[rowIndex].cityfee))) {
-        totalFee += parseFloat(this.rbDetails[rowIndex].cityfee);
+      if (Array.isArray(res.data)) {
+        return res.data;
       }
-      if (!isNaN(parseFloat(this.rbDetails[rowIndex].hotelexpense))) {
-        totalFee += parseFloat(this.rbDetails[rowIndex].hotelexpense);
+      if (Array.isArray(res.rows)) {
+        return res.rows;
       }
-      if (!isNaN(parseFloat(this.rbDetails[rowIndex].otherexpense))) {
-        totalFee += parseFloat(this.rbDetails[rowIndex].otherexpense);
-      }
-      if (!isNaN(parseFloat(this.rbDetails[rowIndex].foodexpenses))) {
-        totalFee += parseFloat(this.rbDetails[rowIndex].foodexpenses);
-      }
-      if (!isNaN(parseFloat(this.rbDetails[rowIndex].foodallowance))) {
-        totalFee += parseFloat(this.rbDetails[rowIndex].foodallowance);
-      }
-      if (!isNaN(parseFloat(this.rbDetails[rowIndex].otherfeeamount))) {
-        totalFee += parseFloat(this.rbDetails[rowIndex].otherfeeamount);
-      }
-      this.rbDetails[rowIndex].total = parseFloat(totalFee).toFixed(2);
-      this.$set(this.rbDetails, rowIndex, this.rbDetails[rowIndex]);
-      */
+      return [];
+    },
+
+    //璁$畻涓�琛屽悎璁�
+    //璁$畻褰撳墠琛屾姤閿�鍐呭璐圭敤鍚堣锛堥噾棰濅竴寰嬭蛋绮剧‘杩愮畻锛�
+    sumRowFee(row) {
+      const totalFee = moneySum([
+        row.trafficexpense,
+        row.cityfee,
+        row.hotelexpense,
+        row.otherexpense,
+        row.foodexpenses,
+        row.foodallowance,
+        row.otherfeeamount
+      ]);
+      row.total = moneyRound(totalFee).toFixed(2);
+
       //閲嶆柊璁$畻鏁翠釜鎶ラ攢鍗曠殑鍚堣
       this.sumTotalFee();
     },
 
     //璁$畻璐圭敤鍚堣
     sumTotalFee() {
-      let allSum = 0;
-
-      //鎹愮尞鑰呭灞炶垂鐢�
-      if (!isNaN(parseFloat(this.form.donoramount))) {
-        allSum += parseFloat(this.form.donoramount);
-      }
-
       //鎶ラ攢鏄庣粏璐圭敤
       try {
-        for (let i = 0; i < this.rbDetails.length; i++) {
-          /*
-          let totalFee = 0;
-          //璁$畻褰撳墠鎶ラ攢鍐呭璐圭敤鍚堣
-          if (!isNaN(parseFloat(this.rbDetails[i].total))) {
-            totalFee += parseFloat(this.rbDetails[i].total);
-          }
-          if (!isNaN(parseFloat(this.rbDetails[i].cityfee))) {
-            totalFee += parseFloat(this.rbDetails[i].cityfee);
-          }
-          if (!isNaN(parseFloat(this.rbDetails[i].hotelexpense))) {
-            totalFee += parseFloat(this.rbDetails[i].hotelexpense);
-          }
-          if (!isNaN(parseFloat(this.rbDetails[i].otherexpense))) {
-            totalFee += parseFloat(this.rbDetails[i].otherexpense);
-          }
-          if (!isNaN(parseFloat(this.rbDetails[i].foodexpenses))) {
-            totalFee += parseFloat(this.rbDetails[i].foodexpenses);
-          }
-          if (!isNaN(parseFloat(this.rbDetails[i].foodallowance))) {
-            totalFee += parseFloat(this.rbDetails[i].foodallowance);
-          }
-          if (!isNaN(parseFloat(this.rbDetails[i].otherfeeamount))) {
-            totalFee += parseFloat(this.rbDetails[i].otherfeeamount);
-          }
-          this.rbDetails[i].total = parseFloat(totalFee).toFixed(2);
-          this.$set(this.rbDetails, i, this.rbDetails[i]);
-          */
-
-          if (!isNaN(parseFloat(this.rbDetails[i].total))) {
-            allSum += parseFloat(this.rbDetails[i].total);
-          }
-        }
-
-        this.form.amountrequested = allSum.toFixed(2);
+        this.form.amountrequested = moneyAdd(
+          moneySum(this.rbDetails, "total"),
+          this.form.donoramount
+        ).toFixed(2);
         this.form.bigstrmoney = this.convertCurrency(this.form.amountrequested);
       } catch { }
     },

--
Gitblit v1.9.3