Commit d95936b5 by 李伟康

commit 盯防

1 parent ce310f83
...@@ -12970,6 +12970,11 @@ ...@@ -12970,6 +12970,11 @@
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
}, },
"number-precision": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/number-precision/-/number-precision-1.6.0.tgz",
"integrity": "sha512-05OLPgbgmnixJw+VvEh18yNPUo3iyp4BEWJcrLu4X9W05KmMifN7Mu5exYvQXqxxeNWhvIF+j3Rij+HmddM/hQ=="
},
"nwsapi": { "nwsapi": {
"version": "2.2.1", "version": "2.2.1",
"resolved": "https://registry.npmmirror.com/nwsapi/-/nwsapi-2.2.1.tgz", "resolved": "https://registry.npmmirror.com/nwsapi/-/nwsapi-2.2.1.tgz",
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
"jspdf": "^2.5.1", "jspdf": "^2.5.1",
"lowdb": "^1.0.0", "lowdb": "^1.0.0",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"number-precision": "^1.6.0",
"qrcodejs2": "^0.0.2", "qrcodejs2": "^0.0.2",
"qs": "^6.8.0", "qs": "^6.8.0",
"rfdc": "^1.3.0", "rfdc": "^1.3.0",
......
...@@ -78,6 +78,7 @@ import onShowMixin from './onShowMixin' ...@@ -78,6 +78,7 @@ import onShowMixin from './onShowMixin'
import { getBoardMerchantList, exportMerchantList } from '@api/earlyWarningManager' import { getBoardMerchantList, exportMerchantList } from '@api/earlyWarningManager'
import { deepClone, downLoadFile } from '@/common/util' import { deepClone, downLoadFile } from '@/common/util'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import NP from 'number-precision'
const RATIO_KEY = { const RATIO_KEY = {
output: 'outputRatio', output: 'outputRatio',
orderNumber: 'orderNumberRatio', orderNumber: 'orderNumberRatio',
...@@ -140,7 +141,8 @@ export default { ...@@ -140,7 +141,8 @@ export default {
}, { }, {
label: '主营品牌', label: '主营品牌',
prop: "carBrandList", prop: "carBrandList",
addHtml: 'popoverHtml' addHtml: 'popoverHtml',
minWidth: 200,
}, { }, {
label: '业务性质', label: '业务性质',
prop: "businessScenario", prop: "businessScenario",
...@@ -199,11 +201,11 @@ export default { ...@@ -199,11 +201,11 @@ export default {
this.originTableData = [] this.originTableData = []
const res = await getBoardMerchantList(this.searchForm) const res = await getBoardMerchantList(this.searchForm)
res.map(e => { res.map(e => {
// e.output = Math.floor(Math.random() * 10001) // e.output = Math.random() * 9999 + 1
// e.orderNumber = Math.floor(Math.random() * 10001) // e.orderNumber = Math.floor(Math.random() * 10001)
// e.customerUnitPrice = Math.floor(Math.random() * 10001) // e.customerUnitPrice = Math.random() * 9999 + 1
// e.penetrationRate = Math.floor(Math.random() * 100) // e.penetrationRate = Math.random() * 10 + 1
// e.touchConversionRate = Math.floor(Math.random() * 100) // e.touchConversionRate = Math.random() * 10 + 1
// e.outputRatio = Math.floor(Math.random() * 201) - 100 // e.outputRatio = Math.floor(Math.random() * 201) - 100
let supervisionNameList = [] let supervisionNameList = []
e.supervisionList?.map(i => { e.supervisionList?.map(i => {
...@@ -246,13 +248,16 @@ export default { ...@@ -246,13 +248,16 @@ export default {
}, },
formatterValue (e) { formatterValue (e) {
const { scope, prop } = e const { scope, prop } = e
let str = scope[prop] let num = scope[prop]
if (str != null) { if (num != null) {
str = str.toLocaleString() const isRate = ['penetrationRate', 'touchConversionRate'].includes(prop)
if (['output', 'customerUnitPrice'].includes(prop)) str = `¥${str}` if (isRate) num = NP.times(num, 100)
if (['penetrationRate', 'touchConversionRate'].includes(prop)) str = `${str}%` if (num % 1 !== 0) num = num.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
} else str = '-' else num = num.toLocaleString();
return str if (['output', 'customerUnitPrice'].includes(prop)) num = `¥${num}`
if (isRate) num += '%'
} else num = '-'
return num
}, },
percentColor (e) { percentColor (e) {
const { scope, prop } = e, const { scope, prop } = e,
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
import SearchBox from '../SearchBox' import SearchBox from '../SearchBox'
import BoardItem from './BoardItem' import BoardItem from './BoardItem'
import { getShopGuardIndexBoard } from '@api/earlyWarningManager' import { getShopGuardIndexBoard } from '@api/earlyWarningManager'
import NP from 'number-precision'
export default { export default {
name: '', name: '',
components: { components: {
...@@ -166,6 +166,7 @@ export default { ...@@ -166,6 +166,7 @@ export default {
const res = await getShopGuardIndexBoard(params) const res = await getShopGuardIndexBoard(params)
Object.keys(res).map(key => { Object.keys(res).map(key => {
if (res[key] != null) { if (res[key] != null) {
if (key == 'outputCompletionProgress') res[key] = NP.times(res[key], 0.01)
if (key == 'budget') res[key] = '¥' + res[key].toLocaleString() if (key == 'budget') res[key] = '¥' + res[key].toLocaleString()
} else res[key] = '-' } else res[key] = '-'
}) })
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import NP from 'number-precision'
export default { export default {
name: '', name: '',
props: { props: {
...@@ -66,8 +67,11 @@ export default { ...@@ -66,8 +67,11 @@ export default {
}, },
formattedValue (num, unit) { formattedValue (num, unit) {
if (num != null) { if (num != null) {
num = num.toLocaleString() if (unit) num = NP.times(num, 100);
if (unit) num = `${num}%` // 检查数字是否有小数部分
if (num % 1 !== 0) num = num.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
else num = num.toLocaleString();
if (unit) num += '%';
} }
else num = '-' else num = '-'
return num return num
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!