소스 검색

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

xieyong 2 주 전
부모
커밋
a6510e5ac2
1개의 변경된 파일과 17개의 추가작업 그리고 1개의 파일을 삭제
  1. 17 1
      src/views/purchasingManage/purchaseOrder/accountstatement/components/payablesInfo.vue

+ 17 - 1
src/views/purchasingManage/purchaseOrder/accountstatement/components/payablesInfo.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="payableTotalPrice">
+              <template slot="append">元</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
 
@@ -308,6 +315,14 @@
         //     0
         //   ) / 100
         // );
+      },
+      // 累计应付总金额:取自下方明细行 payableAmt 之和(不可调整)
+      payableTotalPrice() {
+        const sum = this.localList.reduce(
+          (pre, cur) => pre + Math.round((+cur.payableAmt || 0) * 100),
+          0
+        );
+        return sum / 100;
       }
     },
     watch: {
@@ -451,7 +466,8 @@
         return {
           payablesList: this.localList.map((item) => ({ ...item })),
           statementAdvanceTotalPrice: this.statementAdvanceTotalPrice,
-          receivedTotalPrice: this.receivedTotalPrice
+          receivedTotalPrice: this.receivedTotalPrice,
+          payableTotalPrice: this.payableTotalPrice
         };
       },
       validate() {