Commit 907e5cf0 authored by 王礼鸿 Baimax Wang's avatar 王礼鸿 Baimax Wang

Merge remote-tracking branch 'origin/ld_databoard_fix' into 230829_wlh_fix

# Conflicts:
#	src/module/api/apiList.js
#	src/module/databoard/index.vue
parents b889adc7 fe7f1a53
......@@ -14,8 +14,10 @@
"js-base64": "^3.7.5",
"js-md5": "^0.7.3",
"materialize-css": "^0.98.2",
"moment": "^2.29.4",
"vue": "^2.3.3",
"vue-axios": "^3.5.2",
"vue-cookies": "^1.8.3",
"vue-router": "^2.3.1"
},
"devDependencies": {
......@@ -5295,6 +5297,14 @@
"mkdirp": "bin/cmd.js"
}
},
"node_modules/moment": {
"version": "2.29.4",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
"integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==",
"engines": {
"node": "*"
}
},
"node_modules/move-concurrently": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
......@@ -8889,6 +8899,11 @@
"vue": "^3.0.0 || ^2.0.0"
}
},
"node_modules/vue-cookies": {
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/vue-cookies/-/vue-cookies-1.8.3.tgz",
"integrity": "sha512-VBRsyRMVdahBgFfh389TMHPmDdr4URDJNMk4FKSCfuNITs7+jitBDhwyL4RJd3WUsfOYNNjPAkfbehyH9AFuoA=="
},
"node_modules/vue-hot-reload-api": {
"version": "2.3.4",
"resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz",
......@@ -14358,6 +14373,11 @@
"minimist": "^1.2.6"
}
},
"moment": {
"version": "2.29.4",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
"integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w=="
},
"move-concurrently": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
......@@ -17354,6 +17374,11 @@
"integrity": "sha512-GP+dct7UlAWkl1qoP3ppw0z6jcSua5/IrMpjB5O8bh089iIiJ+hdxPYH2NPEpajlYgkW5EVMP95ttXWdas1O0g==",
"requires": {}
},
"vue-cookies": {
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/vue-cookies/-/vue-cookies-1.8.3.tgz",
"integrity": "sha512-VBRsyRMVdahBgFfh389TMHPmDdr4URDJNMk4FKSCfuNITs7+jitBDhwyL4RJd3WUsfOYNNjPAkfbehyH9AFuoA=="
},
"vue-hot-reload-api": {
"version": "2.3.4",
"resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz",
......
......@@ -16,8 +16,10 @@
"js-base64": "^3.7.5",
"js-md5": "^0.7.3",
"materialize-css": "^0.98.2",
"moment": "^2.29.4",
"vue": "^2.3.3",
"vue-axios": "^3.5.2",
"vue-cookies": "^1.8.3",
"vue-router": "^2.3.1"
},
"devDependencies": {
......
......@@ -20,6 +20,35 @@ export const userLogin = (username, pass, captchaSign, verificationcode, captcha
}
}, 'POST');
//首页营业额率值 -汇总
export const getBusinessConditionDatas = (cur_day) => fetch('/api/query/*/action/get_business_condition_datas', {
aux: {
cur_day: cur_day
}
}, 'POST');
//明细页营业额汇月 -汇总
export const getBusinessConditionDataByMonth = (cur_day) => fetch('/api/query/*/action/get_business_condition_datas_by_month', {
aux: {
cur_day: cur_dayS
}
}, 'POST');
//明细页营业额汇年 -汇总
export const getBusinessConditionDatasByYear = (cur_day) => fetch('/api/query/*/action/get_business_condition_datas_by_year', {
aux: {
cur_day: cur_dayS
}
}, 'POST');
// 应收账款汇总
export const arSummaryBar = () => fetch("/api/query/dash_board/action/get_ar_summary_bar", {}, "POST")
......
import VueCookies from "vue-cookies";
export default async (url = '', data = {}, type = 'GET', method = 'fetch') => {
let baseUrl = '';
if (process.env.NODE_ENV == 'development') {
......@@ -26,7 +28,8 @@ export default async (url = '', data = {}, type = 'GET', method = 'fetch') => {
method: type,
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'X-XSRF-TOKEN':VueCookies.get("XSRF-TOKEN")
},
mode: "cors",
cache: "force-cache"
......
This diff is collapsed.
//环比值=(当日营业额-昨日营业额)/昨日营业额*100%计算
export const calc_hb_str = function (cur, pre) {
return conver_num_rate(formater((cur - pre) / pre * 100));
};
//同比值=(当日营业额上个月同一日营业额)/上个月同一日营业额*100%计算
export const calc_tb_str = function (cur, pre) {
return conver_num_rate(formater(cur / pre * 100));
};
//conver amont
export const conver_amont = function (amont) {
return formater(amont / 10000);
};
//Positive and negative
export const conver_num_rate = function (amont) {
if (amont > 0) {
return "+" + amont + "%"
} else {
return "-" + amont + "%"
}
};
//数字金额显示
function formater(data) {
if (!data) return '0.00'
// 将数据分割,保留两位小数
data = data.toFixed(2)
// 获取整数部分
const intPart = Math.trunc(data)
// 整数部分处理,增加,
const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
// 预定义小数部分
let floatPart = '.00'
// 将数据分割为小数部分和整数部分
const newArr = data.toString().split('.')
if (newArr.length === 2) { // 有小数部分
floatPart = newArr[1].toString() // 取得小数部分
return intPartFormat + '.' + floatPart
}
return intPartFormat + floatPart
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment