From 38c26c3049d55ffda598ce0263498448b7c60834 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期日, 08 十一月 2026 23:34:45 +0800
Subject: [PATCH] 增加增值税城建税

---
 src/views/project/tallage/computingBill/index.vue |  323 +++++++++++++++++++++++++++++++++--------------------
 1 files changed, 202 insertions(+), 121 deletions(-)

diff --git a/src/views/project/tallage/computingBill/index.vue b/src/views/project/tallage/computingBill/index.vue
index dbf2747..508a1cf 100644
--- a/src/views/project/tallage/computingBill/index.vue
+++ b/src/views/project/tallage/computingBill/index.vue
@@ -61,21 +61,50 @@
             </el-form-item>
           </el-col>
           <el-col :span="6"
-            ><el-form-item label="鎵g◣閲戦" prop="donateno">
+            ><el-form-item label="澧炲�肩◣" prop="donateno">
+              <el-input
+                v-model="form.vatAmount"
+                :disabled="true"
+                placeholder="璇疯緭鍏ュ鍊肩◣"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="6"
+            ><el-form-item label="鍩庡缓绋�" prop="donateno">
+              <el-input
+                v-model="form.cityTaxAmount"
+                :disabled="true"
+                placeholder="璇疯緭鍏ュ煄寤虹◣"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="6"
+            ><el-form-item label="鍔冲姟绋庡墠" prop="donateno">
+              <el-input
+                v-model="form.laborPretaxAmount"
+                :disabled="true"
+                placeholder="璇疯緭鍏ュ姵鍔$◣鍓�"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="6"
+            ><el-form-item label="鍔冲姟涓◣" prop="donateno">
               <el-input
                 v-model="form.taxMoney"
                 :disabled="true"
-                placeholder="璇疯緭鍏ユ墸绋庨噾棰�"
+                placeholder="璇疯緭鍏ュ姵鍔′釜绋�"
               />
             </el-form-item>
           </el-col>
 
           <el-col :span="6">
-            <el-form-item label="绋庡悗閲戦" prop="donationcategory">
+            <el-form-item label="鍔冲姟绋庡悗" prop="donationcategory">
               <el-input
                 v-model="form.taxedamount"
                 :disabled="true"
-                placeholder="璇疯緭鍏ユ敹娆捐鍙�"
+                placeholder="璇疯緭鍏ュ姵鍔$◣鍚�"
               />
             </el-form-item>
           </el-col>
@@ -195,23 +224,50 @@
                 />
               </template>
             </el-table-column>
-            <el-table-column label="鎵g◣閲戦" align="center" prop="taXmoney">
+            <el-table-column prop="vatCost" align="center" label="澧炲�肩◣">
               <template slot-scope="scope">
                 <el-input
-                  v-model="scope.row.taXmoney"
+                  v-model="scope.row.vatCost"
                   :disabled="true"
-                  placeholder="鎵g◣閲戦"
+                  placeholder="澧炲�肩◣"
+                />
+              </template>
+            </el-table-column>
+            <el-table-column prop="cityTaxCost" align="center" label="鍩庡缓绋�">
+              <template slot-scope="scope">
+                <el-input
+                  v-model="scope.row.cityTaxCost"
+                  :disabled="true"
+                  placeholder="鍩庡缓绋�"
+                />
+              </template>
+            </el-table-column>
+            <el-table-column prop="laborPretaxCost" align="center" label="鍔冲姟绋庡墠">
+              <template slot-scope="scope">
+                <el-input
+                  v-model="scope.row.laborPretaxCost"
+                  :disabled="true"
+                  placeholder="鍔冲姟绋庡墠"
+                />
+              </template>
+            </el-table-column>
+            <el-table-column label="鍔冲姟涓◣" align="center" prop="taxcost">
+              <template slot-scope="scope">
+                <el-input
+                  v-model="scope.row.taxcost"
+                  :disabled="true"
+                  placeholder="鍔冲姟涓◣"
                 />
               </template>
             </el-table-column>
 
-            <el-table-column prop="taxedcost" align="center" label="绋庡悗閲戦">
+            <el-table-column prop="taxedcost" align="center" label="鍔冲姟绋庡悗">
               <template slot-scope="scope">
                 <el-input
                   @blur="chargeSum"
                   :disabled="true"
                   v-model="scope.row.taxedcost"
-                  placeholder="绋庡悗閲戦"
+                  placeholder="鍔冲姟绋庡悗"
                 />
               </template>
             </el-table-column>
@@ -397,14 +453,32 @@
                 >
                 </el-table-column>
                 <el-table-column
-                  prop="taXmoney"
-                  label="鎵g◣閲戦"
+                  prop="vatCost"
+                  label="澧炲�肩◣"
+                  show-overflow-tooltip
+                >
+                </el-table-column>
+                <el-table-column
+                  prop="cityTaxCost"
+                  label="鍩庡缓绋�"
+                  show-overflow-tooltip
+                >
+                </el-table-column>
+                <el-table-column
+                  prop="laborPretaxCost"
+                  label="鍔冲姟绋庡墠"
+                  show-overflow-tooltip
+                >
+                </el-table-column>
+                <el-table-column
+                  prop="taxcost"
+                  label="鍔冲姟涓◣"
                   show-overflow-tooltip
                 >
                 </el-table-column>
                 <el-table-column
                   prop="taxedcost"
-                  label="绋庡悗閲戦"
+                  label="鍔冲姟绋庡悗"
                   show-overflow-tooltip
                 >
                 </el-table-column>
@@ -439,8 +513,17 @@
         :close-on-click-modal="false"
         :title="pdftitle"
         :visible.sync="pdfVisible"
+        :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>
         <div class="pdfimg">
           <div class="box-pdf">
             <div>
@@ -526,19 +609,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"
-            >
-              <!-- <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-dialog>
     </div>
@@ -751,6 +822,7 @@
 
   created() {
     console.log(234);
+    this.Networkheader = window.location.origin;
     this.GetMaxTaxid();
 
     //鑾峰彇鍙傛暟
@@ -814,8 +886,6 @@
         });
       }
       this.donorchargeorgans.forEach(item => {
-        item.taXmoney = item.pretaxcost - item.taxedcost;
-        item.taXmoney = item.taXmoney.toFixed(2);
         this.accumulation();
       });
       if (this.form.id) {
@@ -830,47 +900,81 @@
 
       this.dialogVisiblepatient = false;
     },
-    // 璁$畻涓◣
+    // 璁$畻涓◣锛堝厛淇濆瓨褰撳墠鍗曟嵁锛屼繚瀛樻垚鍔熷悗鍐嶇畻绋庯紱绠楃◣鎴愬姛鍚庝粠鍚庣閲嶆柊鍔犺浇锛屼笉鍐嶇敤椤甸潰鏃ч噾棰濆洖鍐欙級
     calculateFn() {
       if (this.form.id >= this.MaxFundTaxId) {
-        this.$modal.loading("姝e湪鎻愪氦锛岃绋嶅�欙紒");
         this.$modal
-          .confirm("鍗冲皢杩涜绠楃◣鏄惁宸蹭繚瀛樺叏閮ㄦ暟鎹�?")
-          .then(res => {
-            listbxiaostatistics({
-              fundTaxId: Number(this.form.id),
-              addOrupdate: 1
-            }).then(res1 => {
-              if (res1.code == 200) {
-                this.$modal.msgSuccess("璁$畻鎴愬姛");
-                this.$modal.closeLoading();
-                this.form.istax = 1;
-                this.form.taxedtime = this.$moment().format(
-                  "YYYY-MM-DD HH:mm:ss"
-                );
-                this.submitForm();
-              } else {
-                this.$modal.closeLoading();
-                this.$modal.msgError(res1.msg);
+          .confirm("绠楃◣鍓嶄細鍏堜繚瀛樺綋鍓嶅崟鎹紝鏄惁缁х画?")
+          .then(() => {
+            this.form.serviceFunds = this.donorchargeorgans;
+            this.$refs["form"].validate(valid => {
+              if (!valid) {
+                this.$modal.msgError("鍗曟嵁鏍¢獙鏈�氳繃锛岃妫�鏌ュ悗閲嶈瘯");
+                return;
               }
+              this.$modal.loading("姝e湪鎻愪氦锛岃绋嶅�欙紒");
+              updateFundtax(this.form).then(res0 => {
+                if (res0.code != 200) {
+                  this.$modal.closeLoading();
+                  this.$modal.msgError(res0.msg);
+                  return;
+                }
+                listbxiaostatistics({
+                  fundTaxId: Number(this.form.id),
+                  addOrupdate: 1
+                }).then(res1 => {
+                  if (res1.code == 200) {
+                    // 鍚庣宸插洖鍐� service_fund / service_fundtax锛岃繖閲屽彧鍋氶噸鏂板姞杞�
+                    this.refreshFundtax().then(() => {
+                      this.$modal.closeLoading();
+                      this.$modal.msgSuccess("璁$畻鎴愬姛");
+                    });
+                  } else {
+                    this.$modal.closeLoading();
+                    this.$modal.msgError(res1.msg);
+                  }
+                });
+              });
             });
           })
-
           .catch(() => {});
       } else {
         this.$modal.msgError("褰撳墠鍗曟嵁涓嶄负鏈�鏂扮敵璇峰崟");
       }
     },
-    // 閲戦鍚堣
+    // 浠庡悗绔噸鏂板姞杞芥眹鎬诲崟锛堝惈鏄庣粏鍗曟嵁琛岋級骞堕噸绠楀悎璁�
+    refreshFundtax() {
+      return getFundtax(this.form.id).then(response => {
+        this.form = response.data;
+        if (this.form.serviceFunds && this.form.serviceFunds[0]) {
+          this.donorchargeorgans = this.form.serviceFunds;
+          this.donorchargeorgans.forEach((item, index) => {
+            item.index = index + 1;
+          });
+        }
+        this.accumulation();
+        return response;
+      });
+    },
+    // 閲戦鍚堣锛�6 涓噾棰濆叏閮ㄥ彇鑷崟鎹笂鐨勫悗绔噾棰濓紝涓嶅啀鐢ㄢ�滅◣鍓�-绋庡悗鈥濆�掔畻锛�
     accumulation() {
       this.form.pretaxamount = this.donorchargeorgans
-        .reduce((acc, obj) => acc + Number(obj.pretaxcost), 0)
+        .reduce((acc, obj) => acc + Number(obj.pretaxcost || 0), 0)
+        .toFixed(2);
+      this.form.vatAmount = this.donorchargeorgans
+        .reduce((acc, obj) => acc + Number(obj.vatCost || 0), 0)
+        .toFixed(2);
+      this.form.cityTaxAmount = this.donorchargeorgans
+        .reduce((acc, obj) => acc + Number(obj.cityTaxCost || 0), 0)
+        .toFixed(2);
+      this.form.laborPretaxAmount = this.donorchargeorgans
+        .reduce((acc, obj) => acc + Number(obj.laborPretaxCost || 0), 0)
         .toFixed(2);
       this.form.taxMoney = this.donorchargeorgans
-        .reduce((acc, obj) => acc + Number(obj.taXmoney), 0)
+        .reduce((acc, obj) => acc + Number(obj.taxcost || 0), 0)
         .toFixed(2);
       this.form.taxedamount = this.donorchargeorgans
-        .reduce((acc, obj) => acc + Number(obj.taxedcost), 0)
+        .reduce((acc, obj) => acc + Number(obj.taxedcost || 0), 0)
         .toFixed(2);
     },
     // 澶氶�夋閫変腑鏁版嵁
@@ -1013,14 +1117,12 @@
       this.title = "涓撳璐规眹鎬诲崟缂栬緫";
       getFundtax(this.curId).then(response => {
         this.form = response.data;
-        if (this.form.serviceFunds[0]) {
+        if (this.form.serviceFunds && this.form.serviceFunds[0]) {
           this.donorchargeorgans = this.form.serviceFunds;
           this.donorchargeorgans.forEach((item, index) => {
-            item.taXmoney = item.pretaxcost - item.taxedcost;
-            item.taXmoney = item.taXmoney.toFixed(2);
             item.index = index + 1;
-            this.accumulation();
           });
+          this.accumulation();
         }
       });
     },
@@ -1030,14 +1132,12 @@
       this.title = "鏌ョ湅涓撳璐规眹鎬诲崟";
       getFundtax(this.curId).then(response => {
         this.form = response.data;
-        if (this.form.serviceFunds[0]) {
+        if (this.form.serviceFunds && this.form.serviceFunds[0]) {
           this.donorchargeorgans = this.form.serviceFunds;
           this.donorchargeorgans.forEach((item, index) => {
-            item.taXmoney = item.pretaxcost - item.taxedcost;
-            item.taXmoney = item.taXmoney.toFixed(2);
             item.index = index + 1;
-            this.accumulation();
           });
+          this.accumulation();
         }
       });
     },
@@ -1055,21 +1155,10 @@
           if (this.form.id != null) {
             updateFundtax(this.form).then(res1 => {
               if (res1.code == 200) {
-                console.log(3);
                 this.$modal.msgSuccess("淇濆瓨鎴愬姛锛�");
-                getFundtax(this.form.id).then(response => {
-                  this.form = response.data;
-                  if (this.form.serviceFunds[0]) {
-                    this.donorchargeorgans = this.form.serviceFunds;
-                    this.donorchargeorgans.forEach((item, index) => {
-                      item.taXmoney = item.pretaxcost - item.taxedcost;
-                      item.taXmoney = item.taXmoney.toFixed(2);
-                      item.index = index + 1;
-                      this.accumulation();
-                    });
-                  }
+                this.refreshFundtax().then(() => {
+                  this.$modal.closeLoading();
                 });
-                this.$modal.closeLoading();
               } else {
                 this.$modal.closeLoading();
                 this.$modal.msgError(res1.msg);
@@ -1079,20 +1168,10 @@
             addFundtax(this.form).then(response => {
               if (response.code == 200) {
                 this.$modal.msgSuccess("鏂板鎴愬姛锛�");
-                getFundtax(response.data.fundTaxId).then(res => {
-                  this.form = res.data;
-                  if (this.form.serviceFunds[0]) {
-                    this.donorchargeorgans = this.form.serviceFunds;
-                    this.donorchargeorgans.forEach((item, index) => {
-                      item.taXmoney = item.pretaxcost - item.taxedcost;
-                      item.taXmoney = item.taXmoney.toFixed(2);
-                      item.index = index + 1;
-
-                      this.accumulation();
-                    });
-                  }
+                this.form.id = response.data.fundTaxId;
+                this.refreshFundtax().then(() => {
+                  this.$modal.closeLoading();
                 });
-                this.$modal.closeLoading();
               } else {
                 this.$modal.msgError(response.msg);
                 this.$modal.closeLoading();
@@ -1201,25 +1280,23 @@
       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 (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;
-          });
+        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);
 
@@ -1257,7 +1334,7 @@
       if (this.donorchargeorgans[index].annexFilesList) {
         const fetchPromises = this.donorchargeorgans[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 => {
@@ -1296,28 +1373,32 @@
       );
     },
 
-    // 鐐瑰嚮宸蹭笂浼犳枃浠�
+    // 鐐瑰嚮宸蹭笂浼犳枃浠讹細鍦ㄩ檮浠跺脊绐楀彸渚у唴宓岄瑙�
     downFile(item) {
+      if (this.operationType == "detail") {
+        const list = (this.fileListto || []).map(f => ({
+          name: f.name,
+          url: f.url
+        }));
+        const index = list.findIndex(f => f.url === item.url);
+        this.$previewFile(list, index > -1 ? index : 0);
+        return;
+      }
+      const ext = String(item.name || "").toLowerCase().split(".").pop();
+      const isImage = ["jpg", "jpeg", "png", "gif", "bmp", "webp"].includes(ext);
+      if (ext !== "pdf" && !isImage) {
+        this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮";
+        this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮");
+        return;
+      }
+      this.embeddedFile = {
+        name: item.name,
+        url: item.url,
+        type: ext === "pdf" ? "pdf" : "image"
+      };
       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;
-      }
+      this.pdfVisible = true;
     },
     getIndexInArray(arr, obj) {
       return arr.indexOf(obj);

--
Gitblit v1.9.3