|
@@ -126,7 +126,7 @@
|
|
|
pmArr:[],
|
|
pmArr:[],
|
|
|
peArr:[],
|
|
peArr:[],
|
|
|
tableData:{
|
|
tableData:{
|
|
|
- header: ['公司名称', '付款方式', '价格(元)'],
|
|
|
|
|
|
|
+ header: ['公司名称', '付款方式', '销售金额(元)'],
|
|
|
data: [
|
|
data: [
|
|
|
['行1列1', '行1列2', '行1列3'],
|
|
['行1列1', '行1列2', '行1列3'],
|
|
|
['行2列1', '行2列2', '行2列3'],
|
|
['行2列1', '行2列2', '行2列3'],
|
|
@@ -160,7 +160,32 @@
|
|
|
//初始化
|
|
//初始化
|
|
|
this.Date()
|
|
this.Date()
|
|
|
},
|
|
},
|
|
|
|
|
+ created() {
|
|
|
|
|
+ if (screenfull.isEnabled && !screenfull.isFullscreen) {
|
|
|
|
|
+ this.allView()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // this.refreshAll(this.allDate)
|
|
|
|
|
+
|
|
|
|
|
+ if (this.timer){
|
|
|
|
|
+ clearInterval(this.timer)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.timer = setInterval(() => {
|
|
|
|
|
+ this.refreshAll(this.allDate)
|
|
|
|
|
+ },600000)
|
|
|
|
|
+ },
|
|
|
|
|
+ beforeDestroy() {
|
|
|
|
|
+ if (screenfull.isFullscreen) {
|
|
|
|
|
+ screenfull.toggle()
|
|
|
|
|
+ }
|
|
|
|
|
+ clearInterval(this.timer)
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ allView() {
|
|
|
|
|
+ // 默认显示全屏
|
|
|
|
|
+ screenfull.request()
|
|
|
|
|
+ },
|
|
|
Date() {
|
|
Date() {
|
|
|
const nowDate = new Date();
|
|
const nowDate = new Date();
|
|
|
const date = {
|
|
const date = {
|
|
@@ -239,7 +264,7 @@
|
|
|
curdPost('sql',sql).then(res=>{
|
|
curdPost('sql',sql).then(res=>{
|
|
|
let arr = res.variables.data
|
|
let arr = res.variables.data
|
|
|
for (var i = 0; i < arr.length; i++) {
|
|
for (var i = 0; i < arr.length; i++) {
|
|
|
- let changeArr = [arr[i].zhuan_huan_ke_hu_,arr[i].fu_kuan_fang_shi_,arr[i].jiage]
|
|
|
|
|
|
|
+ let changeArr = [arr[i].zhuan_huan_ke_hu_,arr[i].fu_kuan_fang_shi_,this.moneyFormat(arr[i].jiage)]
|
|
|
this.tableData.data.push(changeArr)
|
|
this.tableData.data.push(changeArr)
|
|
|
}
|
|
}
|
|
|
// }
|
|
// }
|
|
@@ -323,6 +348,32 @@
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ },
|
|
|
|
|
+ moneyFormat (num, decimal = 2, split = ',') {
|
|
|
|
|
+ /*
|
|
|
|
|
+ parameter:
|
|
|
|
|
+ num:格式化目标数字
|
|
|
|
|
+ decimal:保留几位小数,默认2位
|
|
|
|
|
+ split:千分位分隔符,默认为,
|
|
|
|
|
+ */
|
|
|
|
|
+ if (isFinite(num)) { // num是数字
|
|
|
|
|
+ if (num === 0) { // 为0
|
|
|
|
|
+ return num.toFixed(decimal)
|
|
|
|
|
+ } else { // 非0
|
|
|
|
|
+ var res = ''
|
|
|
|
|
+ var dotIndex = String(num).indexOf('.')
|
|
|
|
|
+ if (dotIndex === -1) { // 整数
|
|
|
|
|
+ res = String(num).replace(/(\d)(?=(?:\d{3})+$)/g, `$1${split}`) + '.' + '0'.repeat(decimal)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const numStr = String((Math.round(num * Math.pow(10, decimal)) / Math.pow(10, decimal)).toFixed(decimal)) // 四舍五入,然后固定保留2位小数
|
|
|
|
|
+ const decimals = numStr.slice(dotIndex, dotIndex + decimal + 1) // 截取小数位
|
|
|
|
|
+ res = String(numStr.slice(0, dotIndex)).replace(/(\d)(?=(?:\d{3})+$)/g, `$1${split}`) + decimals
|
|
|
|
|
+ }
|
|
|
|
|
+ return res
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return '--'
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|