浏览代码

feat: 新增累计应收总金额字段并计算其值

xieyong 2 周之前
父节点
当前提交
202cdc129f
共有 1 个文件被更改,包括 17 次插入 和 1 次删除
  1. 17 1
      src/views/saleManage/saleOrder/accountstatement/components/receivableInfo.vue

+ 17 - 1
src/views/saleManage/saleOrder/accountstatement/components/receivableInfo.vue

@@ -16,6 +16,13 @@
             </el-input>
           </el-form-item>
         </el-col>
+        <el-col :span="8">
+          <el-form-item label="累计应收总金额">
+            <el-input disabled v-model="receivedTotalPriceCumulative">
+              <template slot="append">元</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
 
@@ -291,6 +298,14 @@
         // );
         // return isNaN(value) ? 0 : value;
         return this.dataForm?.statReceipt?.receivedTotalPrice || 0;
+      },
+      // 累计应收总金额:取自下方明细行 receivedAmt 之和(不可调整)
+      receivedTotalPriceCumulative() {
+        const sum = this.localList.reduce(
+          (pre, cur) => pre + Math.round((+cur.receivedAmt || 0) * 100),
+          0
+        );
+        return sum / 100;
       }
     },
     watch: {
@@ -433,7 +448,8 @@
         return {
           receivableList: this.localList.map((item) => ({ ...item })),
           statementAdvanceTotalPrice: this.statementAdvanceTotalPrice,
-          receivedTotalPrice: this.receivedTotalPrice
+          receivedTotalPrice: this.receivedTotalPrice,
+          receivedTotalPriceCumulative: this.receivedTotalPriceCumulative
         };
       },
       validate() {