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 |  186 +++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 164 insertions(+), 22 deletions(-)

diff --git a/src/views/project/fund/applyDetail/index.vue b/src/views/project/fund/applyDetail/index.vue
index c83ab67..b929c31 100644
--- a/src/views/project/fund/applyDetail/index.vue
+++ b/src/views/project/fund/applyDetail/index.vue
@@ -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">
@@ -124,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>
@@ -155,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 => {
@@ -173,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="鍔冲姟涓◣" 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="鍔冲姟涓◣" />
+                <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"
@@ -283,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">
@@ -291,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" />{{
@@ -536,13 +549,13 @@
       />
       <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')
           ">
@@ -587,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">
@@ -596,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" />
@@ -628,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">
@@ -637,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" />
@@ -1112,6 +1139,9 @@
       fileListto: [],
       invoicefileList: [],
       invoicefileListto: [],
+      // 2026-11-10锛氭柊涓婁紶闄勪欢琛岄珮浜敤锛堥檮浠� / 鍙戠エ锛�
+      flashAnnexName: "",
+      flashInvoiceName: "",
       invoicepdfimg: "",
       invoicepdfimgsrcList: [],
       invoDatatop: [],
@@ -2950,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") {
@@ -3036,8 +3156,12 @@
             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) {
@@ -3067,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);
         }
       }
     },
@@ -3628,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