فهرست منبع

修改对账中心操作流程

Qukatie 1 هفته پیش
والد
کامیت
b7f878e67e

+ 10 - 2
src/views/iosBasicData/financialManagement/computationCenter/components/pickedData.vue

@@ -915,8 +915,16 @@ export default {
             }
           });
         }
-        this.amountSubSum = Number(this.amountDSubSum - this.amountCSubSum);
-        this.amountSubUsdSum = Number(this.amountDSubUsdSum - this.amountCSubUsdSum);
+        //收款 总收-总付
+        if (this.form.dc == "D") {
+          this.amountSubSum = Number(this.amountDSubSum - this.amountCSubSum);
+          this.amountSubUsdSum = Number(this.amountDSubUsdSum - this.amountCSubUsdSum);
+        } 
+        //付款 总收-总付
+        if (this.form.dc == "C") {
+          this.amountSubSum = Number(this.amountCSubSum - this.amountDSubSum);
+          this.amountSubUsdSum = Number(this.amountCSubUsdSum - this.amountDSubUsdSum);
+        }
       },
       deep: true, // 深度监听
       immediate: true, // 第一次改变就执行

+ 6 - 6
src/views/iosBasicData/financialManagement/finstlbills/components/advancePayment.vue

@@ -1,8 +1,8 @@
 <template>
   <div>
     <el-dialog title="预付款" :visible.sync="dialogVisible" append-to-body width="60%" :before-close="handleClose">
-      <el-tag type="success" style="margin-right: 6px;">应收(CNY):{{ form.amountDr || 0 }}</el-tag>
-      <el-tag type="info">应收(USD):{{ form.amountDrUsd || 0 }}</el-tag>
+      <el-tag type="success" style="margin-right: 6px;">应收(CNY):{{ form.amountSub || 0 }}</el-tag>
+      <el-tag type="info">应收(USD):{{ form.amountSubUsd || 0 }}</el-tag>
       <avue-crud
         v-if="dialogVisible"
         :option="option"
@@ -107,11 +107,11 @@ export default {
             USDSUM += Number(item.usedAmount ? item.usedAmount : 0);
           }
         }
-        if (Number(CNYSUM) > Number(this.form.amountDr)) {
-          return this.$message.error("使用金额CNY合计不能超过应收金额(CNY):" + this.form.amountDr);
+        if (Number(CNYSUM) > Number(this.form.amountSub)) {
+          return this.$message.error("使用金额CNY合计不能超过应收金额(CNY):" + this.form.amountSub);
         }
-        if (Number(USDSUM) > Number(this.form.amountDrUsd)) {
-          return this.$message.error("使用金额USD合计不能超过应收金额(USD):" + this.form.amountDrUsd);
+        if (Number(USDSUM) > Number(this.form.amountSubUsd)) {
+          return this.$message.error("使用金额USD合计不能超过应收金额(USD):" + this.form.amountSubUsd);
         }
         this.$emit(
           "apData",

+ 71 - 83
src/views/iosBasicData/financialManagement/finstlbills/components/cashierItem.vue

@@ -1,10 +1,8 @@
 <template>
   <div>
     <el-dialog title="指示" :visible.sync="dialogVisible" append-to-body width="60%" :before-close="handleClose">
-      <el-tag type="success" style="margin-right: 10px;">剩余收费(RMB){{ Number(form.amountDr - form.actualAmountDr).toFixed(2) }}</el-tag>
-      <el-tag type="info" style="margin-right: 10px;">剩余收费(USD){{ Number(form.amountDrUsd - form.actualAmountDrUsd).toFixed(2) }}</el-tag>
-      <el-tag type="warning" style="margin-right: 10px;">剩余付费(RMB){{ Number(form.amountCr - form.actualAmountCr).toFixed(2) }}</el-tag>
-      <el-tag type="danger">剩余付费(USD){{ Number(form.amountCrUsd - form.actualAmountCrUsd).toFixed(2) }}</el-tag>
+      <el-tag type="warning" style="margin-right: 10px;">剩余付费(RMB){{ Number(form.amountSub - form.actualAmountCr).toFixed(2) }}</el-tag>
+      <el-tag type="danger">剩余付费(USD){{ Number(form.amountSubUsd - form.actualAmountCrUsd).toFixed(2) }}</el-tag>
       <avue-crud
         v-if="dialogVisible"
         :option="option"
@@ -278,63 +276,63 @@ export default {
     //生成指示
     async processData(row, list, dataList) {
       this.loading = true;
-      let amountDr = 0;
-      let amountDrUsd = 0;
-      let amountCr = 0;
-      let amountCrUsd = 0;
-      for (let item of dataList) {
-        if (item.dc == "D" && item.currentStlCurCode == "CNY") {
-          amountDr += Number(item.currentStlAmountRMB);
-        }
-        if (item.dc == "D" && item.currentStlCurCode == "USD") {
-          amountDrUsd += Number(item.currentStlAmountUSD);
-        }
-        if (item.dc == "C" && item.currentStlCurCode == "CNY") {
-          amountCr += Number(item.currentStlAmountRMB);
-        }
-        if (item.dc == "C" && item.currentStlCurCode == "USD") {
-          amountCrUsd += Number(item.currentStlAmountUSD);
-        }
-      }
-      if (amountDr > 0 || amountDrUsd > 0) {
-        let obj = {
-          type: 2,
-          date: row.billDate + " 00:00:00",
-          dc: "D"
-        };
-        const res = await bcurrencyGetExrate(obj);
-        res.data.data.forEach(item => {
-          if (amountDr > 0 && item.code == "CNY") {
-            this.data.push({
-              srcId: row.id,
-              dc: "D",
-              curCode: item.code,
-              exrate: item.exrate,
-              amount: amountDr,
-              amountLoc: Number(Number(amountDr ? amountDr : 0)).toFixed(2),
-              taxRate: 0,
-              amountTax: Number(Number(amountDr ? amountDr : 0)).toFixed(2),
-              amountNet: 0,
-              applyCashierAmount: 0
-            });
-          }
-          if (amountDrUsd > 0 && item.code == "USD") {
-            this.data.push({
-              srcId: row.id,
-              dc: "D",
-              curCode: item.code,
-              exrate: item.exrate,
-              amount: amountDrUsd,
-              amountLoc: Number(Number(amountDrUsd ? amountDrUsd : 0) * Number(item.exrate ? item.exrate : 0)).toFixed(2),
-              taxRate: 0,
-              amountTax: Number(Number(amountDrUsd ? amountDrUsd : 0) * Number(item.exrate ? item.exrate : 0)).toFixed(2),
-              amountNet: 0,
-              applyCashierAmount: 0
-            });
-          }
-        });
-      }
-      if (amountCr > 0 || amountCrUsd > 0) {
+      // let amountDr = 0;
+      // let amountDrUsd = 0;
+      // let amountCr = 0;
+      // let amountCrUsd = 0;
+      // for (let item of dataList) {
+        // if (item.dc == "D" && item.currentStlCurCode == "CNY") {
+        //   amountDr += Number(item.currentStlAmountRMB);
+        // }
+        // if (item.dc == "D" && item.currentStlCurCode == "USD") {
+        //   amountDrUsd += Number(item.currentStlAmountUSD);
+        // }
+      //   if (item.dc == "C" && item.currentStlCurCode == "CNY") {
+      //     amountCr += Number(item.currentStlAmountRMB);
+      //   }
+      //   if (item.dc == "C" && item.currentStlCurCode == "USD") {
+      //     amountCrUsd += Number(item.currentStlAmountUSD);
+      //   }
+      // }
+      // if (amountDr > 0 || amountDrUsd > 0) {
+      //   let obj = {
+      //     type: 2,
+      //     date: row.billDate + " 00:00:00",
+      //     dc: "D"
+      //   };
+      //   const res = await bcurrencyGetExrate(obj);
+      //   res.data.data.forEach(item => {
+      //     if (amountDr > 0 && item.code == "CNY") {
+      //       this.data.push({
+      //         srcId: row.id,
+      //         dc: "D",
+      //         curCode: item.code,
+      //         exrate: item.exrate,
+      //         amount: amountDr,
+      //         amountLoc: Number(Number(amountDr ? amountDr : 0)).toFixed(2),
+      //         taxRate: 0,
+      //         amountTax: Number(Number(amountDr ? amountDr : 0)).toFixed(2),
+      //         amountNet: 0,
+      //         applyCashierAmount: 0
+      //       });
+      //     }
+      //     if (amountDrUsd > 0 && item.code == "USD") {
+      //       this.data.push({
+      //         srcId: row.id,
+      //         dc: "D",
+      //         curCode: item.code,
+      //         exrate: item.exrate,
+      //         amount: amountDrUsd,
+      //         amountLoc: Number(Number(amountDrUsd ? amountDrUsd : 0) * Number(item.exrate ? item.exrate : 0)).toFixed(2),
+      //         taxRate: 0,
+      //         amountTax: Number(Number(amountDrUsd ? amountDrUsd : 0) * Number(item.exrate ? item.exrate : 0)).toFixed(2),
+      //         amountNet: 0,
+      //         applyCashierAmount: 0
+      //       });
+      //     }
+      //   });
+      // }
+      if (this.form.amountSub > 0 || this.form.amountSubUsd > 0) {
         let obj = {
           type: 2,
           date: row.billDate + " 00:00:00",
@@ -342,30 +340,30 @@ export default {
         };
         const res = await bcurrencyGetExrate(obj);
         res.data.data.forEach(item => {
-          if (amountCr > 0 && item.code == "CNY") {
+          if (this.form.amountSub > 0 && item.code == "CNY") {
             this.data.push({
               srcId: row.id,
               dc: "C",
               curCode: item.code,
               exrate: item.exrate,
-              amount: amountCr,
-              amountLoc: Number(Number(amountCr ? amountCr : 0)).toFixed(2),
+              amount: this.form.amountSub,
+              amountLoc: Number(Number(this.form.amountSub ? this.form.amountSub : 0)).toFixed(2),
               taxRate: 0,
-              amountTax: Number(Number(amountCr ? amountCr : 0)).toFixed(2),
+              amountTax: Number(Number(this.form.amountSub ? this.form.amountSub : 0)).toFixed(2),
               amountNet: 0,
               applyCashierAmount: 0
             });
           }
-          if (amountCrUsd > 0 && item.code == "USD") {
+          if (this.form.amountSubUsd > 0 && item.code == "USD") {
             this.data.push({
               srcId: row.id,
               dc: "C",
               curCode: item.code,
               exrate: item.exrate,
-              amount: amountCrUsd,
-              amountLoc: Number(Number(amountCrUsd ? amountCrUsd : 0) * Number(item.exrate ? item.exrate : 0)).toFixed(2),
+              amount: this.form.amountSubUsd,
+              amountLoc: Number(Number(this.form.amountSubUsd ? this.form.amountSubUsd : 0) * Number(item.exrate ? item.exrate : 0)).toFixed(2),
               taxRate: 0,
-              amountTax: Number(Number(amountCrUsd ? amountCrUsd : 0) * Number(item.exrate ? item.exrate : 0)).toFixed(2),
+              amountTax: Number(Number(this.form.amountSubUsd ? this.form.amountSubUsd : 0) * Number(item.exrate ? item.exrate : 0)).toFixed(2),
               amountNet: 0,
               applyCashierAmount: 0
             });
@@ -389,24 +387,14 @@ export default {
         if (!row.amount || row.amount == 0 || row.amount < 0) {
           return this.$message.error("金额不能为非正数");
         }
-        if (row.dc == "D" && row.curCode == "CNY") {
-          if (Number(row.amount) > Number(this.form.amountDr - this.form.actualAmountDr)) {
-            return this.$message.error("金额不能超过剩余出纳收费(RMB):" + Number(this.form.amountDr - this.form.actualAmountDr));
-          }
-        }
-        if (row.dc == "D" && row.curCode == "USD") {
-          if (Number(row.amount) > Number(this.form.amountDrUsd - this.form.actualAmountDrUsd)) {
-            return this.$message.error("金额不能超过剩余出纳收费(USD):" + Number(this.form.amountDrUsd - this.form.actualAmountDrUsd));
-          }
-        }
         if (row.dc == "C" && row.curCode == "CNY") {
-          if (Number(row.amount) > Number(this.form.amountCr - this.form.actualAmountCr)) {
-            return this.$message.error("金额不能超过剩余出纳付费(RMB):" + Number(this.form.amountCr - this.form.actualAmountCr));
+          if (Number(row.amount) > Number(this.form.amountSub - this.form.actualAmountCr)) {
+            return this.$message.error("金额不能超过剩余出纳付费(RMB):" + Number(this.form.amountSub - this.form.actualAmountCr));
           }
         }
         if (row.dc == "C" && row.curCode == "USD") {
-          if (Number(row.amount) > Number(this.form.amountCrUsd - this.form.actualAmountCrUsd)) {
-            return this.$message.error("金额不能超过剩余出纳付费(USD):" + Number(this.form.amountCrUsd - this.form.actualAmountCrUsd));
+          if (Number(row.amount) > Number(this.form.amountSubUsd - this.form.actualAmountCrUsd)) {
+            return this.$message.error("金额不能超过剩余出纳付费(USD):" + Number(this.form.amountSubUsd - this.form.actualAmountCrUsd));
           }
         }
         submit(row).then(res => {

+ 88 - 8
src/views/iosBasicData/financialManagement/finstlbills/detailsPage.vue

@@ -36,10 +36,10 @@
             >更多操作<i class="el-icon-arrow-down el-icon--right"></i>
           </el-button>
           <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item command="付费申请">付费申请</el-dropdown-item>
-            <el-dropdown-item v-if="!roleName.includes('财务')" command="收付相抵">收付相抵</el-dropdown-item>
-            <el-dropdown-item v-if="!roleName.includes('财务')" command="挂账销账">挂账销账</el-dropdown-item>
-            <el-dropdown-item command="发票申请">发票申请</el-dropdown-item>
+            <el-dropdown-item v-if="form.dc == 'C'" command="付费申请">付费申请</el-dropdown-item>
+            <el-dropdown-item v-if="!roleName.includes('财务') && isOffsetting" command="收付相抵">收付相抵</el-dropdown-item>
+            <el-dropdown-item v-if="!roleName.includes('财务') && isWriteOff" command="挂账销账">挂账销账</el-dropdown-item>
+            <el-dropdown-item v-if="isApplication" command="发票申请">发票申请</el-dropdown-item>
           </el-dropdown-menu>
         </el-dropdown>
         <el-button class="el-button--small-yh" type="primary" size="small" v-if="editButton" @click="inEdit">编 辑 </el-button>
@@ -633,6 +633,44 @@ export default {
     }
   },
   methods: {
+    compareSizes() {
+      if (this.form.finStlBillsItemsList.length == 0) {
+        return "不比较";
+      }
+      if (this.form.finStlBillsItemsList.length == this.form.finStlBillsItemsList.filter((item) => item.dc == "D").length) {
+        return "全收";
+      }
+      if (this.form.finStlBillsItemsList.length == this.form.finStlBillsItemsList.filter((item) => item.dc == "C").length) {
+        return "全付";
+      }
+      let DSUM = 0;
+      let CSUM = 0;
+      for (let item of this.form.finStlBillsItemsList) {
+        if (item.dc == "D") {
+          if (item.currentStlCurCode == "CNY") {
+            DSUM += Number(item.currentStlAmountRMB);
+          } else {
+            DSUM += Number(item.currentStlAmountUSD) * item.currentStlExrate;
+          }
+        }
+        if (item.dc == "C") {
+          if (item.currentStlCurCode == "CNY") {
+            CSUM += Number(item.currentStlAmountRMB);
+          } else {
+            CSUM += Number(item.currentStlAmountUSD) * item.currentStlExrate;
+          }
+        }
+      }
+      if (DSUM > CSUM) {
+        return "D";
+      }
+      if (DSUM < CSUM) {
+        return "C";
+      }
+      if (DSUM == CSUM) {
+        return "相等";
+      }
+    },
     enter() {
       this.showSpan = true;
     },
@@ -871,10 +909,8 @@ export default {
         if (this.form.operatingType == "付费申请") {
           getListAllDetail({ srcId: this.form.id }).then((res) => {
             if (
-              Number(this.form.amountDr) != Number(this.form.actualAmountDr) ||
-              Number(this.form.amountCr) != Number(this.form.actualAmountCr) ||
-              Number(this.form.amountDrUsd) != Number(this.form.actualAmountDrUsd) ||
-              Number(this.form.amountCrUsd) != Number(this.form.actualAmountCrUsd)
+              Number(this.form.amountSub) != Number(this.form.actualAmountCr) ||
+              Number(this.form.amountSubUsd) != Number(this.form.actualAmountCrUsd)
             ) {
               this.$confirm("对账金额与实际支付金额不相等,是否确认对账?", {
                 confirmButtonText: "确定",
@@ -1252,6 +1288,50 @@ export default {
     },
   },
   watch: {},
+  computed: {
+    // 收  1.只有收费明细-发票申请,挂账销账,
+    //     2.收付明细都有
+    //      1).收付金额相等-收付相抵
+    //      2).收大于付-发票申请(金额取差额),收付相抵,挂账销账(销账金额取差额)
+    // 付 1.只有付费-付费申请
+    //    2.收付明细都有且付大于收-付费申请(指示金额取差额),收付相抵
+    //收付相抵
+    isOffsetting() {
+      if (this.form.id) {
+        if (this.form.finStlBillsItemsList.length != this.form.finStlBillsItemsList.filter((item) => item.dc == "D").length) {
+          if (this.form.dc == "C" && this.compareSizes() == "C") {
+            return true;
+          }
+          if (this.form.dc == "D" && this.compareSizes() == "D") {
+            return true;
+          }
+          if (this.form.dc == "D" && this.compareSizes() == "相等") {
+            return true;
+          }
+        } else {
+          return false;
+        }
+      } else {
+        return false;
+      }
+    },
+    //挂账销账
+    isWriteOff() {
+      if (this.form.id && this.form.dc == "D" && (this.compareSizes() == "D" || this.compareSizes() == "全收")) {
+        return true;
+      } else {
+        return false;
+      }
+    },
+    //发票申请
+    isApplication() {
+      if (this.form.id && this.form.dc == "D" && (this.compareSizes() == "D" || this.compareSizes() == "全收")) {
+        return true;
+      } else {
+        return false;
+      }
+    },
+  },
 };
 </script>