Преглед изворни кода

Merge branch 'master' of ssh://gogs.zfire.top:2222/zfire-front/zfire-newmall-admin

linwenxin пре 1 година
родитељ
комит
0cded4c8d8

+ 14 - 0
src/utils/common.js

@@ -198,6 +198,20 @@ export const debounce = (fn, delay = 1000) => {
   }
 }
 
+export function thousands(num) {
+  if (num === null) {
+    return '';
+  }
+  var n = Number(num).toFixed(2);
+  if (isNaN(n)) {
+    return n;
+  }
+  n = n + '';
+  var [a, b] = n.split('.');
+  var aq = Number(a).toLocaleString();
+  return `${aq}.${b}`;
+}
+
 export default {
   successMsg,
   errorMsg,

+ 2 - 1
src/views/workOrder/basicConfiguration/settlementStandard/components/install.vue

@@ -11,6 +11,7 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
 import { listPageV2,pageExport, add, edit, del, getMainList, getTypeList } from "@/api/workOrder/settlementStandardInstall";
+import { thousands } from '@/utils/common'
 export default {
   components: { TemplatePage, ImageUpload },
   mixins: [import_mixin],
@@ -173,7 +174,7 @@ export default {
 							</el-input>
 						</el-form-item>
 					</div>
-		    	):(<div style="padding: 6px;">{row.normAmount}</div>)
+		    	):(<div style="padding: 6px;">{thousands(row.normAmount)}</div>)
 		  	}
 		}
 		if (item.jname === 'remark') {

+ 2 - 1
src/views/workOrder/basicConfiguration/settlementStandard/components/other.vue

@@ -12,6 +12,7 @@ import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
 import { del } from "@/api/workOrder/settlementStandardInstall";
 import { listPageV2,pageExport, add, edit } from "@/api/workOrder/settlementStandardOther";
+import { thousands } from '@/utils/common'
 export default {
   components: { TemplatePage, ImageUpload },
   mixins: [import_mixin],
@@ -120,7 +121,7 @@ export default {
 							</el-input>
 						</el-form-item>
 					</div>
-		    	):(<div style="padding: 6px;">{row.normAmount}</div>)
+		    	):(<div style="padding: 6px;">{thousands(row.normAmount)}</div>)
 		  	}
 		}
 		if (item.jname === 'remark') {

+ 2 - 1
src/views/workOrder/basicConfiguration/settlementStandard/components/repair.vue

@@ -12,6 +12,7 @@ import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
 import { del, getMainList, getTypeList } from "@/api/workOrder/settlementStandardInstall";
 import { listPageV2,pageExport, add, edit } from "@/api/workOrder/settlementStandardRepair";
+import { thousands } from '@/utils/common'
 export default {
   components: { TemplatePage, ImageUpload },
   mixins: [import_mixin],
@@ -179,7 +180,7 @@ export default {
 							</el-input>
 						</el-form-item>
 					</div>
-		    	):(<div style="padding: 6px;">{row.repairAmount}</div>)
+		    	):(<div style="padding: 6px;">{thousands(row.repairAmount)}</div>)
 		  	}
 		}
 		if (item.jname === 'normAmount') {