From 531d433ab95e1c5ca48637eca9dc157380f675c0 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期四, 12 十一月 2026 18:37:05 +0800
Subject: [PATCH] 修改了个税功能
---
src/views/project/fund/applyDetail/index.vue | 482 ++++++++++++++++++++++++++++++++++++----------------
1 files changed, 332 insertions(+), 150 deletions(-)
diff --git a/src/views/project/fund/applyDetail/index.vue b/src/views/project/fund/applyDetail/index.vue
index 22bbd87..b929c31 100644
--- a/src/views/project/fund/applyDetail/index.vue
+++ b/src/views/project/fund/applyDetail/index.vue
@@ -13,7 +13,7 @@
<el-col :span="5">
<el-form-item label="鐢宠鏃ユ湡" prop="applyTime">
<el-date-picker clearable :disabled="true" style="width: 100%" v-model="form.applyTime" type="date" format="yyyy-MM-dd"
- value-format="yyyy-MM-dd" placeholder="鏃� 鏈�">
+ value-format="yyyy-MM-dd HH:mm:ss" placeholder="鏃� 鏈�">
</el-date-picker>
</el-form-item>
</el-col>
@@ -49,7 +49,7 @@
</el-col>
<el-col :span="5" v-if="ismanager == true">
<el-form-item label="鐢宠閲戦" prop="pretaxcost">
- <el-input v-model="form.pretaxcost" placeholder="绋庡墠閲戦鍚堣" :disabled="true" />
+ <el-input :value="formatMoneyValue(form.pretaxcost)" class="money-input" placeholder="绋庡墠閲戦鍚堣" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="5">
@@ -68,15 +68,7 @@
<el-form-item label="鎹愮尞妗堜緥" prop="name">
<el-input :disabled="true" v-model="form.donorname" placeholder="璇疯緭鍏ユ崘鐚�呭鍚�" />
</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-col>
<el-col :span="10">
<el-form-item label="鐢宠璇存槑" prop="remark">
<el-input v-model="form.remark" placeholder="鐢宠璇存槑" />
@@ -132,7 +124,7 @@
</el-row>
<el-row>
<el-table :data="rbDetails" v-loading="loading" max-height="800" border highlight-current-row>
- <el-table-column prop="orderno" align="center" label="搴忓彿" width="88">
+ <el-table-column prop="orderno" align="center" label="搴忓彿" width="75">
<template slot-scope="scope">
<el-input v-model="scope.row.orderno" placeholder="搴忓彿" />
</template>
@@ -163,7 +155,7 @@
</el-select>
</template>
</el-table-column>
- <el-table-column prop="price" align="center" label="鍗曚环" width="120" v-if="businessType == 4">
+ <el-table-column prop="price" align="right" header-align="right" label="鍗曚环" width="120" v-if="businessType == 4" class-name="money-column" :formatter="formatMoney">
<template slot-scope="scope">
<el-input v-model="scope.row.price" placeholder="鍗曚环" @blur="
val => {
@@ -181,23 +173,29 @@
" />
</template>
</el-table-column>
- <el-table-column prop="amount" align="center" :label="amountlabel" width="120">
+ <el-table-column prop="amount" align="right" header-align="right" class-name="money-column" :label="amountlabel" width="120" :formatter="formatMoney">
<template slot-scope="scope">
- <el-input v-model="scope.row.amount" placeholder="閲戦" />
+ <el-input v-model="scope.row.amount" class="money-input" placeholder="閲戦" @blur="normalizeMoney(scope.row, 'amount')" />
</template>
</el-table-column>
- <el-table-column prop="taxamount" align="center" label="鎵g◣閲戦" width="120" v-if="
+ <el-table-column prop="vatAmount" align="right" header-align="right" class-name="money-column" label="澧炲�肩◣" width="110" :formatter="formatMoney"
+ v-if="businessType == '1'" />
+ <el-table-column prop="cityTaxAmount" align="right" header-align="right" class-name="money-column" label="鍩庡缓绋�" width="110" :formatter="formatMoney"
+ v-if="businessType == '1'" />
+ <el-table-column prop="laborPretaxAmount" align="right" header-align="right" class-name="money-column" label="鍔冲姟绋庡墠" width="120" :formatter="formatMoney"
+ v-if="businessType == '1'" />
+ <el-table-column prop="taxamount" align="right" header-align="right" class-name="money-column" label="鍔冲姟涓◣" width="120" v-if="
ismanager == true &&
(businessType == '1' || businessType == '2')
- ">
+ " :formatter="formatMoney">
<template slot-scope="scope">
- <el-input v-model="scope.row.taxamount" placeholder="鎵g◣閲戦" />
+ <el-input v-model="scope.row.taxamount" class="money-input" placeholder="鍔冲姟涓◣" @blur="normalizeMoney(scope.row, 'taxamount')" />
</template>
</el-table-column>
- <el-table-column prop="taxedamount" align="center" label="绋庡悗閲戦" width="120"
- v-if="businessType == '1' || businessType == '2'">
+ <el-table-column prop="taxedamount" align="right" header-align="right" class-name="money-column" label="鍔冲姟绋庡悗" width="120"
+ v-if="businessType == '1' || businessType == '2'" :formatter="formatMoney">
<template slot-scope="scope">
- <el-input v-model="scope.row.taxedamount" placeholder="绋庡悗閲戦" />
+ <el-input v-model="scope.row.taxedamount" class="money-input" placeholder="鍔冲姟绋庡悗" @blur="normalizeMoney(scope.row, 'taxedamount')" />
</template>
</el-table-column>
<el-table-column prop="beneficiaryname" column-key="sdad" align="center" :label="beneficiarylabel"
@@ -291,7 +289,7 @@
<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)
- " :on-preview="downFile" :disabled="operationType == 'detail'" :on-error="handleUploadError"
+ " :on-preview="downFile" :disabled="operationType == 'detail'" :on-error="handleUploadError" :before-upload="beforeUploadCheck"
:on-remove="remove" accept="image/*,.pdf">
<i class="el-icon-upload"></i>
<div class="el-upload__text">
@@ -299,7 +297,14 @@
<em><el-button :disabled="operationType == 'detail'" size="small" type="primary">鐐瑰嚮涓婁紶</el-button></em>
</div>
</el-upload>
- <el-table :data="fileListto" @row-click="downFile" style="width: 100%" height="400">
+ <div
+ v-if="operationType == 'detail'"
+ class="upload-disabled-tip"
+ >
+ <i class="el-icon-warning-outline" />
+ 褰撳墠涓烘煡鐪嬫ā寮忥紝涓嶈兘涓婁紶闄勪欢
+ </div>
+ <el-table ref="annexTable" :data="fileListto" :row-class-name="annexRowClass" @row-click="downFile" style="width: 100%" height="400">
<el-table-column prop="name" :show-overflow-tooltip="true" label="鍚嶇О">
<template slot-scope="scope">
<i style="color:#409EFF" class=" el-icon-s-order" />{{
@@ -524,16 +529,33 @@
</span>
</el-dialog>
<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 == 'invoice'
+ ? '褰撳墠姝e湪鎿嶄綔锛氬彂绁ㄦ枃浠讹紙璇风‘璁ょエ鎹睘浜庡彂绁級'
+ : '褰撳墠姝e湪鎿嶄綔锛氭櫘閫氶檮浠讹紙璇峰嬁鍦ㄦ涓婁紶鍙戠エ锛�'
+ "
+ :type="activeName == 'invoice' ? '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 v-if="businessType == 4" prop="price" align="center" label="鍗曚环">
+ <el-table-column v-if="businessType == 4" prop="price" align="right" header-align="right" class-name="money-column" label="鍗曚环" :formatter="formatMoney">
</el-table-column>
<el-table-column prop="quantity" align="center" label="鏁伴噺" v-if="businessType == 4">
</el-table-column>
- <el-table-column prop="amount" align="center" :label="amountlabel">
+ <el-table-column prop="amount" align="right" header-align="right" class-name="money-column" :label="amountlabel" :formatter="formatMoney">
</el-table-column>
- <el-table-column prop="taxedamount" align="center" label="绋庡悗閲戦" v-if="
+ <el-table-column prop="taxedamount" align="right" header-align="right" class-name="money-column" label="鍔冲姟绋庡悗" :formatter="formatMoney" v-if="
(this.ismanager == true) &
(form.applytype == '1' || form.applytype == '2')
">
@@ -578,7 +600,7 @@
<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)
- " :on-preview="downFile" :disabled="operationType == 'detail'" :on-error="handleUploadError"
+ " :on-preview="downFile" :disabled="operationType == 'detail'" :on-error="handleUploadError" :before-upload="beforeUploadCheck"
:on-remove="remove" accept="image/*,.pdf">
<i class="el-icon-upload"></i>
<div class="el-upload__text">
@@ -587,7 +609,14 @@
type="primary">鐐瑰嚮涓婁紶</el-button></em>
</div>
</el-upload>
- <el-table :data="fileListto" @row-click="downFile" style="width: 100%" height="400">
+ <div
+ v-if="operationType == 'detail'"
+ class="upload-disabled-tip"
+ >
+ <i class="el-icon-warning-outline" />
+ 褰撳墠涓烘煡鐪嬫ā寮忥紝涓嶈兘涓婁紶闄勪欢
+ </div>
+ <el-table ref="annexTable2" :data="fileListto" :row-class-name="annexRowClass" @row-click="downFile" style="width: 100%" height="400">
<el-table-column prop="name" :show-overflow-tooltip="true" label="鍚嶇О">
<template slot-scope="scope">
<i style="color:#409EFF" class=" el-icon-s-order" />
@@ -609,18 +638,7 @@
</div>
</div>
- <div v-if="this.previewpdf && pdfimgsrcList.length" class="pdfimgmin">
- <!-- <img :src="pdfimg" /> -->
- <el-image ref="imagePreview" style="width: 95%; height: 90%" :src="pdfimg"
- @click="handleImageClick(initialIndex)">
- <!-- <div slot="error" class="image-slot">
- <i class="el-icon-picture-outline"></i>
- </div> -->
- </el-image>
- <custom-image-viewer :url-list="pdfimgsrcList" :initial-index="currentIndex" :visible="viewerVisible"
- @update:visible="viewerVisible = $event" @close="handleViewerClose" />
- </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="invoice">
@@ -630,7 +648,7 @@
<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)
- " :on-preview="downFile" :disabled="operationType == 'detail'" :on-error="handleUploadError"
+ " :on-preview="downFile" :disabled="operationType == 'detail'" :on-error="handleUploadError" :before-upload="beforeUploadCheck"
:on-remove="remove" accept="image/*,.pdf">
<i class="el-icon-upload"></i>
<div class="el-upload__text">
@@ -639,7 +657,14 @@
type="primary">鐐瑰嚮涓婁紶</el-button></em>
</div>
</el-upload>
- <el-table :data="invoicefileListto" @row-click="downFile" style="width: 100%" height="400">
+ <div
+ v-if="operationType == 'detail'"
+ class="upload-disabled-tip"
+ >
+ <i class="el-icon-warning-outline" />
+ 褰撳墠涓烘煡鐪嬫ā寮忥紝涓嶈兘涓婁紶闄勪欢
+ </div>
+ <el-table ref="invoiceTable" :data="invoicefileListto" :row-class-name="invoiceRowClass" @row-click="downFile" style="width: 100%" height="400">
<el-table-column prop="name" :show-overflow-tooltip="true" label="鍚嶇О">
<template slot-scope="scope">
<i style="color:#409EFF" class=" el-icon-s-order" />
@@ -661,19 +686,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)">
- <!-- <div slot="error" class="image-slot">
- <i class="el-icon-picture-outline"></i>
- </div> -->
- </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>
@@ -795,6 +808,7 @@
import OrgSelecter from "@/views/project/components/orgselect";
import { getToken } from "@/utils/auth";
import { moneySum, moneyMul, moneySub, moneyRound } from "@/utils/money";
+import { checkFileName, checkDetails } from "@/utils/fileNameCheck";
import CustomImageViewer from "@/components/CustomImageViewer"; // 鏍规嵁浣犵殑璺緞璋冩暣
export default {
@@ -831,9 +845,10 @@
return callback();
}
const regex = /^[1-9]\d{5}(19|20)\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}([0-9]|X)$/;
- if (regex.test(value)) {
- } else {
- callback(new Error("韬唤璇佸彿鐮佹牸寮忛敊璇�"));
+ // 2026-10-19锛氭牸寮忎笉鍚堟硶绔嬪嵆鏃╅��銆傚師鏉ュ啓鎴� if/else 浣� else 閲屾病鏈� return锛�
+ // 浼氱户缁線涓嬭蛋寮傛鏌ラ噸锛屽鑷� callback 琚皟鐢ㄤ袱娆°��"韬唤璇佸彿鐮佹牸寮忛敊璇�"琚悗缁粨鏋滆鐩栥��
+ if (!regex.test(value)) {
+ return callback(new Error("韬唤璇佸彿鐮佹牸寮忛敊璇�"));
}
// 2. 璋冪敤鍚庣鎺ュ彛杩涜閲嶅鎬ф牎楠�
@@ -966,6 +981,10 @@
},
dialogrules: {
+ // 2026-10-19锛氳处鎴峰悕绉帮紙璐︽埛鏉ユ簮=浠庤处鎴峰簱 鏃剁殑涓嬫媺锛変篃鏄繀杈撻」
+ accountname: [
+ { required: true, message: "璇烽�夋嫨璐︽埛鍚嶇О", trigger: "change" }
+ ],
usertype: [
{ required: true, message: "璇疯緭鍏ヨ处鎴风被鍨�", trigger: "blur" }
],
@@ -975,6 +994,10 @@
unitTaxNo: [{ required: true, message: "璇疯緭鍏ョ◣鍙�", trigger: "blur" }],
idcardno: [
{
+ // 2026-10-19锛氬姞 required 鏍囪鍙负璁� el-form-item 鏍囧嚭蹇呰緭鏄熷彿锛圗lement 鐨� isRequired 鍙 rule.required锛夈��
+ // 鏈鍒欏甫 validator锛宎sync-validator 鐨� getValidationMethod 浼氱洿鎺ヨ繑鍥炶 validator銆佽烦杩囧唴寤� required 妫�鏌ワ紝
+ // 鎵�浠ユ牎楠岃涓轰笌鏀瑰姩鍓嶅畬鍏ㄤ竴鑷达紱鍙﹀**涓嶈兘鍔� message**锛屽惁鍒欎細瑕嗙洊涓嬮潰鑷畾涔� validator 鐨勬姤閿欐枃妗堛��
+ required: true,
// 璐︽埛绫诲瀷閫夋嫨"鍗曚綅鏈烘瀯"鏃朵笉闇�瑕佽韩浠借瘉鍙�
validator: (rule, value, callback) => {
if (this.hasUserType(this.accountselectform.usertype, "org")) {
@@ -1116,10 +1139,13 @@
fileListto: [],
invoicefileList: [],
invoicefileListto: [],
+ // 2026-11-10锛氭柊涓婁紶闄勪欢琛岄珮浜敤锛堥檮浠� / 鍙戠エ锛�
+ flashAnnexName: "",
+ flashInvoiceName: "",
invoicepdfimg: "",
invoicepdfimgsrcList: [],
invoDatatop: [],
- activeName: "common", //鏂囦欢绫诲瀷
+ activeName: "invoice", //鏂囦欢绫诲瀷锛氶粯璁ゅ彂绁ㄦ枃浠�
//涓婁紶闄勪欢璺緞
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload",
ICDtoken: getToken(),
@@ -1130,6 +1156,7 @@
//绁ㄦ嵁鏂囦欢
pdftitle: "",
pdfimg: "",
+ invoiceEmbeddedFile: null,
pdfimgsrcList: [],
currentIndex: 0, // 鍒濆绱㈠紩
invoicecurrentIndex: 0, // 鍒濆绱㈠紩
@@ -1232,14 +1259,8 @@
},
// 鑾峰彇璇锋眰澶�
Getnetworkheader() {
- let string = window.location.href;
- if (string.includes("9091")) {
- const index = string.indexOf("9091");
- this.Networkheader = string.slice(0, index + 4); // 鎴彇9091鍙婂叾鍓嶉儴瀛楃
- } else {
- const index = string.indexOf("8032");
- this.Networkheader = string.slice(0, index + 4); // 鎴彇8032鍙婂叾鍓嶉儴瀛楃
- }
+ // 浠ュ綋鍓嶉〉闈� origin 涓哄噯锛屽吋瀹� 80/8032/9091 鍙婂悗缁鍙h皟鏁�
+ this.Networkheader = window.location.origin;
},
/** 閫氳繃鍙傛暟鑾峰彇涓氬姟绫诲瀷 */
getroute() {
@@ -1561,6 +1582,11 @@
},
/** 鎻愪氦鎸夐挳 */
submitForm: debounce(function () {
+ // 2026-10-15锛氫繚瀛樺墠闄勪欢鏂囦欢鍚嶈鑼冩牎楠岋紙浠呮柊澧炲崟鎹紱鑰佸崟鎹殑鍘嗗彶闄勪欢鐢卞悗绔寜"鍙牎楠屾湰娆″彉鏇�"鏀捐锛�
+ if (!this.checkDetailFileNames()) {
+ return;
+ }
+
if (!this.randomnumber) {
this.randomnumber = this.generateRandomString(9);
this.form.randomnumber = this.randomnumber;
@@ -1658,7 +1684,7 @@
}
this.rbDetails[i] = tempDetail;
}
- //璁$畻褰撳墠琛屾姤閿�鍐呭璐圭敤鍚堣锛岀◣鍓嶉噾棰濓紙amount锛夈�佹墸绋庨噾棰濓紙taxamount锛夈�佺◣鍚庨噾棰濓紙taxedamount锛�
+ //璁$畻褰撳墠琛屾姤閿�鍐呭璐圭敤鍚堣锛岀◣鍓嶉噾棰濓紙amount锛夈�佸姵鍔′釜绋庯紙taxamount锛夈�佸姵鍔$◣鍚庯紙taxedamount锛�
if (this.businessType == "2") {
for (let j = 0; j < this.rbDetails.length; j++) {
let tempDetail = this.rbDetails[j];
@@ -2261,7 +2287,7 @@
});
},
- //璁$畻涓◣锛歵ype(A:宸茬煡绋庡墠閲戦锛岃绠楃◣鍚庨噾棰濓紱B锛氬凡鐭ョ◣鍚庨噾棰濓紝璁$畻绋庡墠閲戦)
+ //璁$畻涓◣锛歵ype(A:宸茬煡绋庡墠閲戦锛岃绠楀姵鍔$◣鍚庯紱B锛氬凡鐭ュ姵鍔$◣鍚庯紝璁$畻绋庡墠閲戦)
calculateTax(row, type) {
for (let i = 0; i < this.rbDetails.length; i++) {
if (!this.rbDetails[i].amount) {
@@ -2343,6 +2369,11 @@
},
// 鎺ュ彈鎻愰啋绔嬪埢淇濆瓨
Savenow() {
+ // 2026-10-15锛氫繚瀛樺墠闄勪欢鏂囦欢鍚嶈鑼冩牎楠岋紙浠呮柊澧炲崟鎹紱鑰佸崟鎹殑鍘嗗彶闄勪欢鐢卞悗绔寜"鍙牎楠屾湰娆″彉鏇�"鏀捐锛�
+ if (!this.checkDetailFileNames()) {
+ return;
+ }
+
if (!this.randomnumber) {
this.randomnumber = this.generateRandomString(9);
this.form.randomnumber = this.randomnumber;
@@ -2432,7 +2463,7 @@
}
this.rbDetails[i] = tempDetail;
}
- //璁$畻褰撳墠琛屾姤閿�鍐呭璐圭敤鍚堣锛岀◣鍓嶉噾棰濓紙amount锛夈�佹墸绋庨噾棰濓紙taxamount锛夈�佺◣鍚庨噾棰濓紙taxedamount锛�
+ //璁$畻褰撳墠琛屾姤閿�鍐呭璐圭敤鍚堣锛岀◣鍓嶉噾棰濓紙amount锛夈�佸姵鍔′釜绋庯紙taxamount锛夈�佸姵鍔$◣鍚庯紙taxedamount锛�
if (this.businessType == "2") {
for (let j = 0; j < this.rbDetails.length; j++) {
let tempDetail = this.rbDetails[j];
@@ -2586,6 +2617,23 @@
});
this.batchdialogVisible = true;
},
+ /**
+ * 鏄庣粏琛屾槸鍚︿负銆岀┖璁板綍銆嶏細鏈嶅姟椤圭洰銆佷笓瀹躲�佷笓瀹舵墍鍦ㄥ崟浣� 鏄惁閮戒负绌�
+ * 鐢ㄤ簬鎵归噺褰曞叆涓撳鏃跺垽鏂�"澶嶇敤鏈�鍚庝竴琛�"杩樻槸"杩藉姞鏂拌"
+ */
+ isBlankDetailRow(row) {
+ if (!row) {
+ return false;
+ }
+ const isEmpty = v =>
+ v === null || v === undefined || String(v).trim() === "";
+ return (
+ isEmpty(row.itemid) &&
+ isEmpty(row.beneficiaryname) &&
+ isEmpty(row.unitno) &&
+ isEmpty(row.unitname)
+ );
+ },
/** 鎵归噺褰曞叆寮规锛氬鍚�/鍗曚綅/宸ュ彿/韬唤璇佸悗4浣� 鍛戒腑鍒ゆ柇 */
personMatchKeyword(item, kw) {
const idcard = String(item.idcrad || "");
@@ -2611,6 +2659,17 @@
existed[String(row.beneficiaryname).trim()] = true;
}
});
+
+ // 2026-10-22锛氫慨姝�"瀵煎叆鍚庤〃鏍煎鍑轰竴琛岀┖璁板綍"銆�
+ // 瑙勫垯锛氬厛鐪嬫渶鍚庝竴鏉¤褰曪紝鑻ュ畠鐨�"鏈嶅姟椤圭洰 / 涓撳 / 涓撳鎵�鍦ㄥ崟浣�"閮芥槸绌虹殑锛�
+ // 璇存槑鏄竴鏉$┖璁板綍锛屽氨浠庤繖涓�琛屽紑濮嬪~锛涘惁鍒欒拷鍔犳柊琛屻��
+ let writeIndex = this.rbDetails.length;
+ if (
+ writeIndex > 0 &&
+ this.isBlankDetailRow(this.rbDetails[writeIndex - 1])
+ ) {
+ writeIndex -= 1;
+ }
const duplicated = [];
this.checkedCities.forEach(item => {
@@ -2670,7 +2729,13 @@
annexfiles: null
};
- this.rbDetails.push(rowData);
+ if (writeIndex < this.rbDetails.length) {
+ // 澶嶇敤鏈�鍚庨偅鏉$┖璁板綍
+ this.rbDetails.splice(writeIndex, 1, rowData);
+ } else {
+ this.rbDetails.push(rowData);
+ }
+ writeIndex++;
});
for (let i = 0; i < this.rbDetails.length; i++) {
this.rbDetails[i].orderno = i + 1;
@@ -2915,7 +2980,97 @@
invoicehandleViewerClose() {
this.invoiceviewerVisible = false;
},
- handleUploadError() { },
+ /**
+ * 2026-11-10锛氫笂浼犲墠缃牎楠岋紙before-upload锛�
+ * 鍘熷疄鐜版妸鏂囦欢鍚嶆牎楠屾斁鍦� on-success锛屾枃浠�**宸茬粡浼犲埌鏈嶅姟鍣�**鎵嶅垽鏂紝
+ * 涓嶅悎鏍煎氨鐩存帴涓㈠純 鈫� 鏈嶅姟鍣ㄧ暀鍨冨溇鏂囦欢銆佺晫闈㈠彧闂竴涓嬫彁绀猴紝鐢ㄦ埛鎰熻"娌″弽搴�"銆�
+ * 杩欓噷鍓嶇Щ鍒颁笂浼犲墠锛屼笉鍚堟牸鐩存帴涓嶅彂璇锋眰銆�
+ * @returns {boolean} false 闃绘涓婁紶
+ */
+ beforeUploadCheck(file) {
+ if (this.operationType === "detail") {
+ this.$modal.msgError("褰撳墠涓烘煡鐪嬫ā寮忥紝涓嶈兘涓婁紶闄勪欢");
+ return false;
+ }
+ return this.checkUploadFileName(file);
+ },
+
+ /**
+ * 2026-11-10锛氫笂浼犵粨鏋滃紓甯告椂鐨勭粺涓�鎻愮ず
+ * 鍚庣 /common/upload 鍑洪敊鏃惰繑鍥� HTTP 200 + code 500/401锛宔l-upload 浼氳蛋 on-success锛�
+ * 蹇呴』鍦ㄨ繖閲岀粰鍑烘槑纭彁绀猴紝鍚﹀垯鐢ㄦ埛鐪嬩笉鍒颁换浣曞弽棣堛��
+ */
+ notifyUploadFail(response) {
+ const code = response && response.code;
+ const msg = (response && response.msg) || "鏈煡閿欒";
+ if (code === 401 || code === 403) {
+ this.$modal.msgError("鐧诲綍宸茶繃鏈燂紝璇烽噸鏂扮櫥褰曞悗鍐嶄笂浼犻檮浠�");
+ return;
+ }
+ this.$modal.msgError("涓婁紶澶辫触锛�" + msg);
+ },
+
+ /**
+ * 2026-11-10锛氫笂浼犲け璐ワ紙HTTP 闈� 2xx / 鏂綉 / 琚綉鍏虫嫤鎴瓑锛�
+ * 鍘熷疄鐜版槸绌哄嚱鏁� `handleUploadError() { }`锛屽け璐ユ椂瀹屽叏娌℃湁鎻愮ず銆�
+ */
+ handleUploadError(err, file, fileList) {
+ const status = err && err.status;
+ const fileName = (file && file.name) || "鏂囦欢";
+ if (status === 401 || status === 403) {
+ this.$modal.msgError("鐧诲綍宸茶繃鏈燂紝璇烽噸鏂扮櫥褰曞悗鍐嶄笂浼犻檮浠�");
+ return;
+ }
+ let msg = "涓婁紶澶辫触";
+ if (status) {
+ msg += "锛欻TTP " + status + "锛堝彲鑳芥槸鏂囦欢杩囧ぇ鎴栫綉缁滃紓甯革級";
+ } else if (err && err.message) {
+ msg += "锛�" + err.message;
+ }
+ this.$modal.msgError(msg + "锛屾枃浠讹細" + fileName);
+ },
+
+ /** 鏂颁笂浼犺楂樹寒锛氶檮浠惰〃 */
+ annexRowClass({ row }) {
+ return row && row.name === this.flashAnnexName ? "row-flash" : "";
+ },
+
+ /** 鏂颁笂浼犺楂樹寒锛氬彂绁ㄨ〃 */
+ invoiceRowClass({ row }) {
+ return row && row.name === this.flashInvoiceName ? "row-flash" : "";
+ },
+
+ /**
+ * 2026-11-10锛氭柊涓婁紶闄勪欢瀹氫綅 鈥斺�� 楂樹寒 + 婊氬姩鍒拌〃鏍煎簳閮�
+ * @param {string} refName 琛ㄦ牸 ref
+ * @param {string} name 鏂囦欢鍚嶏紙鐢ㄤ簬 row-class-name 鍖归厤锛�
+ * @param {string} kind annex | invoice
+ */
+ flashTable(refName, name, kind) {
+ if (kind === "annex") {
+ this.flashAnnexName = name;
+ } else {
+ this.flashInvoiceName = name;
+ }
+ this.$nextTick(() => {
+ const table = this.$refs[refName];
+ const wrap =
+ table && table.$el
+ ? table.$el.querySelector(".el-table__body-wrapper")
+ : null;
+ if (wrap) {
+ wrap.scrollTop = wrap.scrollHeight;
+ }
+ });
+ setTimeout(() => {
+ if (kind === "annex") {
+ this.flashAnnexName = "";
+ } else {
+ this.flashInvoiceName = "";
+ }
+ }, 2000);
+ },
+
remove(file, fileList) {
const rbDetails = [...this.rbDetails];
if (this.activeName == "common") {
@@ -2927,32 +3082,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 == "common") {
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);
@@ -2965,27 +3156,29 @@
url: response.fileName
});
this.pdftitle = "鍏�" + this.pdfimgsrcList.length + "椤�";
+ // 2026-11-10锛氭柊琛岄珮浜苟婊氬姩鍒板彲瑙佷綅缃紝閬垮厤"鐪嬩笉鍑烘湁鍙嶅簲"
+ this.flashTable("annexTable", file.name, "annex");
+ this.flashTable("annexTable2", file.name, "annex");
} else {
- console.log(response.msg);
+ // 2026-11-10锛氬悗绔繑鍥� HTTP 200 + 闈� 200 涓氬姟鐮佹椂锛屽師鏉ュ彧 console.log锛岀晫闈㈡棤鎻愮ず
+ this.notifyUploadFail(response);
}
} 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);
@@ -2998,6 +3191,11 @@
url: response.fileName
});
this.pdftitle = "鍏�" + this.invoicepdfimgsrcList.length + "椤�";
+ // 2026-11-10锛氭柊琛岄珮浜苟婊氬姩鍒板彲瑙佷綅缃�
+ this.flashTable("invoiceTable", file.name, "invoice");
+ } else {
+ // 2026-11-10锛氬師鏉ヨ鍒嗘敮娌℃湁 else锛屽け璐ユ椂瀹屽叏鏃犳彁绀�
+ this.notifyUploadFail(response);
}
}
},
@@ -3021,7 +3219,7 @@
if (this.rbDetails[index].annexfilesList) {
// this.rbDetails[index].annexfilesList.forEach((value, indexson) => {
- // const pdfimg = this.Networkheader + "/prod-api" + value.url;
+ // const pdfimg = this.Networkheader + process.env.VUE_APP_BASE_API + value.url;
// fetch(pdfimg, config)
// .then(response => response.blob())
// .then(blob => {
@@ -3043,7 +3241,7 @@
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 => {
@@ -3076,7 +3274,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 => {
@@ -3119,50 +3317,17 @@
console.log(this.rbDetails[index].annexfilesList, "annexfilesList");
},
- // 鐐瑰嚮宸蹭笂浼犳枃浠�
+ // 璐圭敤鎶ラ攢锛氶檮浠剁粺涓�浣跨敤鐙珛 FilePreview锛堝綍鍏ャ�佸鎵广�佽鎯呬竴鑷达級
downFile(item) {
- if (this.activeName == "common") {
- 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 == "common" ? 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);
@@ -3301,6 +3466,10 @@
//涓撳/鍖荤枟鏈烘瀯/璐圭敤鎶ラ攢鏈烘瀯閫夋嫨
confirmSelectionDialog() {
this.$refs["accountselectform"].validate(valid => {
+ // 2026-10-19锛氬師鏉ユ病鏈夊垽鏂� valid锛屾牎楠屽け璐ヤ篃鐓ф牱寰�涓嬭蛋銆佺収鏍蜂繚瀛橈紙鏄熷彿/绾㈠瓧褰㈠悓铏氳锛�
+ if (!valid) {
+ return;
+ }
let tempIndex = this.accountselectform.index;
if (this.selectionType == "account") {
if (this.accountfrom == "1") {
@@ -3588,6 +3757,19 @@
text-align: center;
}
+/* 2026-11-10锛氭煡鐪嬫ā寮忎笅涓婁紶鍖虹殑璇存槑 + 鏂颁笂浼犺楂樹寒 */
+.upload-disabled-tip {
+ margin-top: 6px;
+ font-size: 13px;
+ color: #e6a23c;
+ text-align: center;
+}
+
+::v-deep .el-table .row-flash td {
+ background-color: #e7f1f4 !important;
+ transition: background-color 0.3s ease;
+}
+
.pdfimg {
display: flex; // text-align: center;
width: 100%;
--
Gitblit v1.9.3