소스 검색

金额格式

sqg 3 년 전
부모
커밋
93730823ee
2개의 변경된 파일26개의 추가작업 그리고 0개의 파일을 삭제
  1. 13 0
      front-vue/src/views/service/credit/pdfShow.vue
  2. 13 0
      front-vue/src/views/service/financeRecord/pdfShow.vue

+ 13 - 0
front-vue/src/views/service/credit/pdfShow.vue

@@ -657,6 +657,19 @@ export default {
     handleInput(str) {
         return amtformat(str, 2, ".", ",");
     },
+    //格式化金额 
+    amtFormat(cellValue) {
+      if(cellValue == null || cellValue== undefined || cellValue == ''){
+      cellValue = '0.00'
+      }
+      cellValue += '';
+            if (!cellValue.includes('.')) {
+      cellValue += '.00';
+      }
+      return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
+        return $1 + ',';
+      }).replace(/\.$/, '');
+    },
     /* //  将数字金额转换为大写金额 */
     smallToBig(money) {
       //  将数字金额转换为大写金额

+ 13 - 0
front-vue/src/views/service/financeRecord/pdfShow.vue

@@ -674,6 +674,19 @@ export default {
     handleInput(str) {
         return amtformat(str, 2, ".", ",");
     },
+    //格式化金额 
+    amtFormat(cellValue) {
+      if(cellValue == null || cellValue== undefined || cellValue == ''){
+      cellValue = '0.00'
+      }
+      cellValue += '';
+            if (!cellValue.includes('.')) {
+      cellValue += '.00';
+      }
+      return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
+        return $1 + ',';
+      }).replace(/\.$/, '');
+    },
     /* //  将数字金额转换为大写金额 */
     smallToBig(money) {
       //  将数字金额转换为大写金额