|
|
@@ -40,69 +40,14 @@ let trendChart: echarts.ECharts | null = null
|
|
|
|
|
|
const yuanToWan = (value: number) => Number((value / 10000).toFixed(2))
|
|
|
|
|
|
-const inventoryData: InventoryItem[] = [
|
|
|
- {
|
|
|
- project: '东营库',
|
|
|
- mayInventoryAmount: yuanToWan(2921827.56),
|
|
|
- yearBeginningBacklog: yuanToWan(1644059.52),
|
|
|
- mayBacklogAmount: yuanToWan(1436126.52)
|
|
|
- },
|
|
|
- {
|
|
|
- project: '川庆',
|
|
|
- mayInventoryAmount: yuanToWan(491050.94),
|
|
|
- yearBeginningBacklog: 0,
|
|
|
- mayBacklogAmount: yuanToWan(308801.56)
|
|
|
- },
|
|
|
- {
|
|
|
- project: '南美',
|
|
|
- mayInventoryAmount: yuanToWan(2491993.31),
|
|
|
- yearBeginningBacklog: 0,
|
|
|
- mayBacklogAmount: 0
|
|
|
- },
|
|
|
- {
|
|
|
- project: '非洲',
|
|
|
- mayInventoryAmount: yuanToWan(2276836.24),
|
|
|
- yearBeginningBacklog: yuanToWan(175144.46),
|
|
|
- mayBacklogAmount: yuanToWan(391697.89)
|
|
|
- },
|
|
|
- {
|
|
|
- project: '中东',
|
|
|
- mayInventoryAmount: yuanToWan(127300.64),
|
|
|
- yearBeginningBacklog: yuanToWan(14784.43),
|
|
|
- mayBacklogAmount: yuanToWan(103461.07)
|
|
|
- },
|
|
|
- {
|
|
|
- project: '中亚',
|
|
|
- mayInventoryAmount: yuanToWan(188389.42),
|
|
|
- yearBeginningBacklog: 0,
|
|
|
- mayBacklogAmount: 0
|
|
|
- },
|
|
|
- {
|
|
|
- project: '塔河库',
|
|
|
- mayInventoryAmount: yuanToWan(17175342.26),
|
|
|
- yearBeginningBacklog: yuanToWan(9890389.23),
|
|
|
- mayBacklogAmount: yuanToWan(9261631.2)
|
|
|
- },
|
|
|
- {
|
|
|
- project: '塔里木',
|
|
|
- mayInventoryAmount: yuanToWan(4599437.38),
|
|
|
- yearBeginningBacklog: 0,
|
|
|
- mayBacklogAmount: yuanToWan(890890.45)
|
|
|
- },
|
|
|
- {
|
|
|
- project: '吐哈库',
|
|
|
- mayInventoryAmount: yuanToWan(2342089.06),
|
|
|
- yearBeginningBacklog: yuanToWan(1097925.36),
|
|
|
- mayBacklogAmount: yuanToWan(1190879.22)
|
|
|
- }
|
|
|
-]
|
|
|
-
|
|
|
function formatAmount(value: number) {
|
|
|
return Number(value || 0).toFixed(2)
|
|
|
}
|
|
|
|
|
|
function getFactoryInventoryData(data: InventoryDistributionResponse | null): InventoryItem[] {
|
|
|
- if (!data) return inventoryData
|
|
|
+ if (!data) {
|
|
|
+ return []
|
|
|
+ }
|
|
|
|
|
|
const factoryNames = new Set([
|
|
|
...Object.keys(data.factoryNameInventoryPair || {}),
|
|
|
@@ -231,7 +176,7 @@ function getDistributionOption(
|
|
|
}),
|
|
|
series: [
|
|
|
{
|
|
|
- name: '5月底余额',
|
|
|
+ name: '库存',
|
|
|
type: 'pie',
|
|
|
radius: layout.distributionPieRadius,
|
|
|
center: ['27%', layout.distributionPieCenterY],
|
|
|
@@ -240,15 +185,18 @@ function getDistributionOption(
|
|
|
show: true,
|
|
|
position: 'outside',
|
|
|
formatter: '{b}\n{d}%',
|
|
|
- color: THEME.text.regular,
|
|
|
+ color: 'inherit',
|
|
|
fontSize: layout.labelFontSize,
|
|
|
- fontWeight: 600,
|
|
|
+ fontWeight: 500,
|
|
|
fontFamily: FONT_FAMILY
|
|
|
},
|
|
|
labelLine: {
|
|
|
show: true,
|
|
|
length: layout.labelDistance,
|
|
|
- length2: layout.labelDistance
|
|
|
+ length2: layout.labelDistance,
|
|
|
+ lineStyle: {
|
|
|
+ color: 'inherit'
|
|
|
+ }
|
|
|
},
|
|
|
data: data.map((item) => ({
|
|
|
name: item.project,
|
|
|
@@ -256,7 +204,7 @@ function getDistributionOption(
|
|
|
}))
|
|
|
},
|
|
|
{
|
|
|
- name: '5月底积压',
|
|
|
+ name: '积压库存',
|
|
|
type: 'pie',
|
|
|
radius: layout.distributionPieRadius,
|
|
|
center: ['73%', layout.distributionPieCenterY],
|
|
|
@@ -265,15 +213,18 @@ function getDistributionOption(
|
|
|
show: true,
|
|
|
position: 'outside',
|
|
|
formatter: '{b}\n{d}%',
|
|
|
- color: THEME.text.regular,
|
|
|
+ color: 'inherit',
|
|
|
fontSize: layout.labelFontSize,
|
|
|
- fontWeight: 600,
|
|
|
+ fontWeight: 500,
|
|
|
fontFamily: FONT_FAMILY
|
|
|
},
|
|
|
labelLine: {
|
|
|
show: true,
|
|
|
length: layout.labelDistance,
|
|
|
- length2: layout.labelDistance
|
|
|
+ length2: layout.labelDistance,
|
|
|
+ lineStyle: {
|
|
|
+ color: 'inherit'
|
|
|
+ }
|
|
|
},
|
|
|
data: data
|
|
|
.filter((item) => item.mayBacklogAmount > 0)
|