浏览代码

计算金额方式同步添加缴费,四舍五入

wolyshaw 4 年之前
父节点
当前提交
811a65930f
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/views/teamDetail/components/modals/create-user-pay.vue

+ 2 - 1
src/views/teamDetail/components/modals/create-user-pay.vue

@@ -145,6 +145,7 @@
   </div>
 </template>
 <script>
+import numeral from 'numeral'
 import paymentCycle from "../../../resetTeaming/modals/payment-cycle";
 import otherform from "../../../resetTeaming/modals/other";
 import extraClass from "../../../resetTeaming/modals/extra-class";
@@ -213,7 +214,7 @@ export default {
     priceChange (item, index) {
       const _ = [...this.eclass]
       const active = this.organizationCourseUnitPriceSettingsByType[item.courseType] || {}
-      const price = Math.ceil((item.courseTotalMinuties || 1) * (active.unitPrice || 1))
+      const price = Math.round(numeral(item.courseTotalMinuties || 1).multiply(active.unitPrice || 1).value())
       item.courseCurrentPrice = price
       item.courseOriginalPrice = price
       _[index] = item