From a6cdc43d699044409e06c78583a2337ccaa3b96e Mon Sep 17 00:00:00 2001
From: sinake <sinake1@qq.com>
Date: 星期三, 04 十一月 2026 14:41:27 +0800
Subject: [PATCH] 器官回款机构搜索
---
src/views/project/travelexpenseapply/travelexpensedetail/index.vue | 576 +++++++++++++++++++++++++++++++-------------------------
1 files changed, 319 insertions(+), 257 deletions(-)
diff --git a/src/views/project/travelexpenseapply/travelexpensedetail/index.vue b/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
index 48e6a20..cef13e4 100644
--- a/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
+++ b/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
@@ -5,7 +5,7 @@
<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>
@@ -14,8 +14,8 @@
<el-form-item label="缁忓姙浜�" prop="username">
<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-option v-for="(item, index) in personsList" :key="item.reportNo + '-' + index"
+ :label="item.reportName" :value="item.reportName">
</el-option>
</el-select>
</el-form-item>
@@ -47,12 +47,18 @@
</el-form-item>
</el-col>
<el-col :span="5">
- <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-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" />
+ </div>
</el-col>
</el-row>
<el-row style="margin-top: 10px">
@@ -86,7 +92,7 @@
<el-form-item label="鍑哄樊浜�" prop="travelers">
<el-select v-model="form.travelers" clearable filterable allow-create ref="getReportname"
default-first-option placeholder="璇烽�夋嫨" @change="getAccountinfo()">
- <el-option v-for="item in travelers" :key="item.reportNo" :label="item.reportName"
+ <el-option v-for="item in travelers" :label="item.reportName"
:value="item.reportName">
</el-option>
</el-select>
@@ -224,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>
@@ -240,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>
@@ -445,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>
@@ -527,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="杩斿洖浜ら�氬伐鍏�">
@@ -566,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>
@@ -597,24 +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"
- :preview-src-list="pdfimgsrcList" -->
- >
- <el-image ref="imagePreview" style="width: 95%; height: 90%" :src="pdfimg"
- @click="handleImageClick(initialIndex)">
- </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">
@@ -623,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>
@@ -654,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>
@@ -703,7 +706,8 @@
exportReimbursement,
getdownload,
checkfund,
- fundSubmit
+ fundSubmit,
+ listbypowerone
} from "@/api/project/reimbursement";
import {
addReimbursementdetail,
@@ -725,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,
@@ -741,7 +747,8 @@
"sys_recordstatus",
"sys_travelexpensebelong",
"sys_traffictype",
- "sys_area_name"
+ "sys_area_name",
+ "sys_DonationStatus"
],
data() {
return {
@@ -757,13 +764,14 @@
personsList: [],
//涓嬫媺鍙互閫夋嫨浜哄憳鍒楄〃
personsSel: [],
- activeName: 1, //鏂囦欢绫诲瀷
+ activeName: 2, //鏂囦欢绫诲瀷锛氶粯璁ゅ彂绁ㄦ枃浠�
// 閮ㄩ棬鏍戦�夐」
deptOptions: undefined,
//绁ㄦ嵁鏂囦欢
pdftitle: "",
pdfimg: "",
+ invoiceEmbeddedFile: null,
pdfVisible: false,
costtypeobj: {
value: 0,
@@ -912,6 +920,8 @@
flowconclusion: null,
fundid: null
},
+ //杩炵画瀹℃壒锛氬緟瀹℃壒鍒楄〃
+ pendingList: [],
jurisdiction: false,
//淇濆瓨鎸夐挳鎺у埗
@@ -1070,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) {
@@ -1106,32 +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)
- });
- })
- .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);
@@ -1150,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);
@@ -1200,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 => {
@@ -1233,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 => {
@@ -1267,7 +1302,7 @@
this.pdftitle = "";
}
- if (this.activeName == "common") {
+ if (this.activeName == 1) {
this.pdftitle = "鍏�" + this.pdfimgsrcList.length + "椤�";
} else {
this.pdftitle = "鍏�" + this.invoicepdfimgsrcList.length + "椤�";
@@ -1276,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);
@@ -1554,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 {
@@ -1678,10 +1680,22 @@
if (item.id == this.form.infoid) {
this.form.donorno = item.donorno;
this.form.donorname = item.name;
+
+ // 鏂板锛氬皢鎹愮尞鑰呯殑 recordstate 璧嬪�煎埌 invoicecount
+ if (item.recordstate !== undefined && item.recordstate !== null) {
+ this.form.invoicecount = item.recordstate.toString();
+ } else {
+ this.form.invoicecount = ""; // 濡傛灉 recordstate 涓虹┖锛屾竻绌哄瓧娈�
+ }
}
});
},
-
+ // 娣诲姞娓呴櫎鏂规硶
+ clearDonatorInfo() {
+ this.form.donorno = "";
+ this.form.donorname = "";
+ this.form.invoicecount = ""; // 娓呯┖ invoicecount
+ },
onpick(e) {
// console.log(e,this.value1)
},
@@ -1933,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,
@@ -1944,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;
@@ -1974,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
@@ -2006,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;
@@ -2064,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) {
@@ -2163,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 {
@@ -2303,6 +2397,11 @@
},
// 鎺ュ彈鎻愰啋绔嬪埢淇濆瓨
Savenow() {
+ // 2026-10-15锛氫繚瀛樺墠闄勪欢鏂囦欢鍚嶈鑼冩牎楠岋紙浠呮柊澧炲崟鎹紱鑰佸崟鎹殑鍘嗗彶闄勪欢鐢卞悗绔寜"鍙牎楠屾湰娆″彉鏇�"鏀捐锛�
+ if (!this.checkDetailFileNames()) {
+ return;
+ }
+
this.Savereminder = false;
this.Reminderquantity = 0;
this.totalquantity = 0;
@@ -2579,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