Commit 52586d31e2b5021689b8168fbbb04a1372760937
1 parent
27fc15bb
更换第四版
Showing
10 changed files
with
40 additions
and
585 deletions
src/api/project/global.ts
@@ -3,27 +3,15 @@ import { defHttp } from '/@/utils/http/axios'; | @@ -3,27 +3,15 @@ import { defHttp } from '/@/utils/http/axios'; | ||
3 | enum Api { | 3 | enum Api { |
4 | DATA = '/order/erp/index/data', | 4 | DATA = '/order/erp/index/data', |
5 | CHART_DATA = '/order/erp/index/chartData', | 5 | CHART_DATA = '/order/erp/index/chartData', |
6 | - | ||
7 | - SALES_DATA = '/order/erp/index/totalSalesStatistics', //销售额完成情况 | ||
8 | - CUSTOMER_SALES = '/order/erp/index/salesStatusEveryCustomer', //每个客户销售额情况 | ||
9 | } | 6 | } |
10 | 7 | ||
11 | -export const getApiData = async (params?) => { | ||
12 | - const res = await defHttp.get<any>({ url: Api.DATA, params }); | ||
13 | - return res; | ||
14 | -}; | ||
15 | - | ||
16 | -export const getChartData = async (params?) => { | ||
17 | - const res = await defHttp.get<any>({ url: Api.CHART_DATA, params }); | ||
18 | - return res; | ||
19 | -}; | ||
20 | - | ||
21 | -export const getSalesData = async (params?) => { | ||
22 | - const res = await defHttp.get<any>({ url: Api.SALES_DATA, params }); | 8 | +export const getApiData = async () => { |
9 | + const res = await defHttp.get<any>({ url: Api.DATA }); | ||
23 | return res; | 10 | return res; |
24 | }; | 11 | }; |
25 | 12 | ||
26 | -export const getCustomerSalesData = async (params?) => { | ||
27 | - const res = await defHttp.get<any>({ url: Api.CUSTOMER_SALES, params }); | 13 | +export const getChartData = async () => { |
14 | + const res = await defHttp.get<any>({ url: Api.CHART_DATA }); | ||
15 | + console.log(res, '5656reschatdata'); | ||
28 | return res; | 16 | return res; |
29 | }; | 17 | }; |
src/store/modules/data.ts
@@ -3,16 +3,9 @@ import type { UserInfo } from '/#/store'; | @@ -3,16 +3,9 @@ import type { UserInfo } from '/#/store'; | ||
3 | import { defineStore } from 'pinia'; | 3 | import { defineStore } from 'pinia'; |
4 | import { store } from '/@/store'; | 4 | import { store } from '/@/store'; |
5 | import { RoleEnum } from '/@/enums/roleEnum'; | 5 | import { RoleEnum } from '/@/enums/roleEnum'; |
6 | -import { exchangeTab } from '@/store/modules/user'; | ||
7 | 6 | ||
8 | -import { | ||
9 | - getApiData, | ||
10 | - getChartData, | ||
11 | - getSalesData, | ||
12 | - getCustomerSalesData, | ||
13 | -} from '/@/api/project/global'; | 7 | +import { getApiData, getChartData } from '/@/api/project/global'; |
14 | import { formatToDate } from '/@/utils/dateUtil'; | 8 | import { formatToDate } from '/@/utils/dateUtil'; |
15 | -import { watch } from 'vue'; | ||
16 | 9 | ||
17 | interface UserState { | 10 | interface UserState { |
18 | userInfo: Nullable<UserInfo>; | 11 | userInfo: Nullable<UserInfo>; |
@@ -29,10 +22,6 @@ export const useDataStore = defineStore({ | @@ -29,10 +22,6 @@ export const useDataStore = defineStore({ | ||
29 | data: {}, | 22 | data: {}, |
30 | // token | 23 | // token |
31 | chartData: {}, | 24 | chartData: {}, |
32 | - //销售额完成情况 | ||
33 | - salesData: {}, | ||
34 | - //每个客户销售额 | ||
35 | - customerChartData1: {}, | ||
36 | }), | 25 | }), |
37 | getters: { | 26 | getters: { |
38 | getData(state) { | 27 | getData(state) { |
@@ -41,12 +30,6 @@ export const useDataStore = defineStore({ | @@ -41,12 +30,6 @@ export const useDataStore = defineStore({ | ||
41 | getChartData(state) { | 30 | getChartData(state) { |
42 | return state.chartData; | 31 | return state.chartData; |
43 | }, | 32 | }, |
44 | - getSalesData(state) { | ||
45 | - return state.salesData; | ||
46 | - }, | ||
47 | - getCustomerChartData1(state) { | ||
48 | - return state.customerChartData1; | ||
49 | - }, | ||
50 | }, | 33 | }, |
51 | actions: { | 34 | actions: { |
52 | setData(info) { | 35 | setData(info) { |
@@ -55,12 +38,6 @@ export const useDataStore = defineStore({ | @@ -55,12 +38,6 @@ export const useDataStore = defineStore({ | ||
55 | setChartData(data) { | 38 | setChartData(data) { |
56 | this.chartData = data; | 39 | this.chartData = data; |
57 | }, | 40 | }, |
58 | - setSalesData(info) { | ||
59 | - this.salesData = info ? info : ''; | ||
60 | - }, | ||
61 | - setCustomerChartData1(data) { | ||
62 | - this.customerChartData1 = data; | ||
63 | - }, | ||
64 | 41 | ||
65 | async getFetchData(): Promise<any> { | 42 | async getFetchData(): Promise<any> { |
66 | try { | 43 | try { |
@@ -70,17 +47,10 @@ export const useDataStore = defineStore({ | @@ -70,17 +47,10 @@ export const useDataStore = defineStore({ | ||
70 | return Promise.reject(error); | 47 | return Promise.reject(error); |
71 | } | 48 | } |
72 | }, | 49 | }, |
73 | - async getFetchData2(): Promise<any> { | ||
74 | - try { | ||
75 | - const data = await getSalesData(); | ||
76 | - this.salesData = data; | ||
77 | - } catch (error) { | ||
78 | - return Promise.reject(error); | ||
79 | - } | ||
80 | - }, | ||
81 | async getFetchChartData(): Promise<any> { | 50 | async getFetchChartData(): Promise<any> { |
82 | try { | 51 | try { |
83 | const data = await getChartData(); | 52 | const data = await getChartData(); |
53 | + console.log(data, '5656chartData'); | ||
84 | const x = [], | 54 | const x = [], |
85 | y = []; | 55 | y = []; |
86 | data.forEach((value) => { | 56 | data.forEach((value) => { |
@@ -88,23 +58,7 @@ export const useDataStore = defineStore({ | @@ -88,23 +58,7 @@ export const useDataStore = defineStore({ | ||
88 | y.push(value.orderCount); | 58 | y.push(value.orderCount); |
89 | }); | 59 | }); |
90 | this.chartData = { x, y }; | 60 | this.chartData = { x, y }; |
91 | - } catch (error) { | ||
92 | - return Promise.reject(error); | ||
93 | - } | ||
94 | - }, | ||
95 | - async getCustomerSalesData1(): Promise<any> { | ||
96 | - try { | ||
97 | - const data = await getCustomerSalesData(); | ||
98 | - | ||
99 | - const x = [], | ||
100 | - y = [], | ||
101 | - z = []; | ||
102 | - for (const key in data) { | ||
103 | - x.push(key); | ||
104 | - y.push(data[key].salesAmount); | ||
105 | - z.push(data[key].target); | ||
106 | - } | ||
107 | - this.customerChartData1 = { x, y, z }; | 61 | + console.log(this.getChartData, '5656 this.chartData'); |
108 | } catch (error) { | 62 | } catch (error) { |
109 | return Promise.reject(error); | 63 | return Promise.reject(error); |
110 | } | 64 | } |
src/views/dashboard/analysis/components/GrowCard.vue
1 | <template> | 1 | <template> |
2 | - <div class="md:flex" v-if="exchangeTab === 'tab1'"> | 2 | + <div class="md:flex"> |
3 | <template v-for="(item, index) in growCardList" :key="item.title"> | 3 | <template v-for="(item, index) in growCardList" :key="item.title"> |
4 | <Card | 4 | <Card |
5 | size="small" | 5 | size="small" |
@@ -24,21 +24,6 @@ | @@ -24,21 +24,6 @@ | ||
24 | </Card> | 24 | </Card> |
25 | </template> | 25 | </template> |
26 | </div> | 26 | </div> |
27 | - <div class="md:flex" v-if="exchangeTab === 'tab2'"> | ||
28 | - <template v-for="(item, index) in growCardList2" :key="item.title"> | ||
29 | - <Card | ||
30 | - size="small" | ||
31 | - :loading="loading" | ||
32 | - :title="item.title" | ||
33 | - class="md:w-1/4 w-full !md:mt-0" | ||
34 | - :class="{ '!md:mr-4': index + 1 < 5, '!mt-4': index > 0 }" | ||
35 | - > | ||
36 | - <div class="py-4 px-4 flex justify-between items-center" style="font-size: 20px"> | ||
37 | - {{ item.value }} | ||
38 | - </div> | ||
39 | - </Card> | ||
40 | - </template> | ||
41 | - </div> | ||
42 | </template> | 27 | </template> |
43 | <script lang="ts" setup> | 28 | <script lang="ts" setup> |
44 | import { CountTo } from '/@/components/CountTo/index'; | 29 | import { CountTo } from '/@/components/CountTo/index'; |
@@ -46,40 +31,17 @@ | @@ -46,40 +31,17 @@ | ||
46 | import { Tag, Card } from 'ant-design-vue'; | 31 | import { Tag, Card } from 'ant-design-vue'; |
47 | import { growCardList } from '../data'; | 32 | import { growCardList } from '../data'; |
48 | import { useDataStoreWithOut } from '/@/store/modules/data'; | 33 | import { useDataStoreWithOut } from '/@/store/modules/data'; |
49 | - import { computed, onMounted, ref, watch, watchEffect } from 'vue'; | ||
50 | - import { | ||
51 | - exchangeTab, | ||
52 | - businessPersonIn, | ||
53 | - customerCodeIn, | ||
54 | - dateTime, | ||
55 | - period, | ||
56 | - } from '/@/store/modules/user'; | ||
57 | - import { number } from 'vue-types'; | ||
58 | - import { getSalesData, getApiData } from '/@/api/project/global'; | ||
59 | - import { useOrderStoreWithOut } from '/@/store/modules/order'; | 34 | + import { computed } from 'vue'; |
60 | 35 | ||
61 | const dataStore = useDataStoreWithOut(); | 36 | const dataStore = useDataStoreWithOut(); |
62 | - const data1 = ref(); | ||
63 | - watch( | ||
64 | - [dateTime, period], | ||
65 | - async ([newDateTime, newPeriod], [oldBusinessPersonIn, oldCustomerCodeIn]) => { | ||
66 | - console.log('businessPersonIn changed from', oldBusinessPersonIn, 'to', newDateTime); | ||
67 | - console.log('customerCodeIn changed from', oldCustomerCodeIn, 'to', newPeriod); | ||
68 | 37 | ||
69 | - // 在这里添加你希望在这两个值改变时执行的逻辑 | ||
70 | - data1.value = await getApiData({ | ||
71 | - dateTime: newDateTime, | ||
72 | - period: newPeriod, | ||
73 | - }); | ||
74 | - }, | ||
75 | - ); | ||
76 | const growCardList = computed(() => { | 38 | const growCardList = computed(() => { |
77 | const data = dataStore.getData; | 39 | const data = dataStore.getData; |
78 | return [ | 40 | return [ |
79 | { | 41 | { |
80 | title: '订单完成', | 42 | title: '订单完成', |
81 | icon: 'visit-count|svg', | 43 | icon: 'visit-count|svg', |
82 | - value: data1.value?.allCount || 0, | 44 | + value: data?.orderFinishedCount || 0, |
83 | total: 120000, | 45 | total: 120000, |
84 | color: 'green', | 46 | color: 'green', |
85 | action: '月', | 47 | action: '月', |
@@ -87,7 +49,7 @@ | @@ -87,7 +49,7 @@ | ||
87 | { | 49 | { |
88 | title: '跟单和质检中', | 50 | title: '跟单和质检中', |
89 | icon: 'total-sales|svg', | 51 | icon: 'total-sales|svg', |
90 | - value: data1.value?.trackingAndInspectingList || 0, | 52 | + value: data?.orderInspectingCount || 0, |
91 | total: 500000, | 53 | total: 500000, |
92 | color: 'blue', | 54 | color: 'blue', |
93 | action: '月', | 55 | action: '月', |
@@ -95,7 +57,7 @@ | @@ -95,7 +57,7 @@ | ||
95 | { | 57 | { |
96 | title: '利润分析表待审核', | 58 | title: '利润分析表待审核', |
97 | icon: 'download-count|svg', | 59 | icon: 'download-count|svg', |
98 | - value: data1.value?.profitList || 0, | 60 | + value: data?.orderProfitWaitAuditCount || 0, |
99 | total: 120000, | 61 | total: 120000, |
100 | color: 'orange', | 62 | color: 'orange', |
101 | action: '周', | 63 | action: '周', |
@@ -103,7 +65,7 @@ | @@ -103,7 +65,7 @@ | ||
103 | { | 65 | { |
104 | title: '项目报告书待审核', | 66 | title: '项目报告书待审核', |
105 | icon: 'transaction|svg', | 67 | icon: 'transaction|svg', |
106 | - value: data1.value?.reportList || 0, | 68 | + value: data?.orderReportWaitAuditCount || 0, |
107 | total: 50000, | 69 | total: 50000, |
108 | color: 'purple', | 70 | color: 'purple', |
109 | action: '年', | 71 | action: '年', |
@@ -111,94 +73,17 @@ | @@ -111,94 +73,17 @@ | ||
111 | { | 73 | { |
112 | title: '订单初始化', | 74 | title: '订单初始化', |
113 | icon: 'transaction|svg', | 75 | icon: 'transaction|svg', |
114 | - value: data1.value?.orderInitList || 0, | 76 | + value: data?.orderCount || 0, |
115 | total: 50000, | 77 | total: 50000, |
116 | color: 'purple', | 78 | color: 'purple', |
117 | action: '年', | 79 | action: '年', |
118 | }, | 80 | }, |
119 | ]; | 81 | ]; |
120 | }); | 82 | }); |
121 | - const data2 = ref(); | ||
122 | - // watchEffect(async () => { | ||
123 | - // data2.value = await getSalesData({ | ||
124 | - // businessPersonIn: businessPersonIn, | ||
125 | - // customerCodeIn: customerCodeIn, | ||
126 | - // }); | ||
127 | - // }); | ||
128 | - onMounted(async () => { | ||
129 | - data1.value = await getApiData({ | ||
130 | - dateTime: dateTime.value, | ||
131 | - period: period.value, | ||
132 | - }); | ||
133 | - data2.value = await getSalesData({ | ||
134 | - businessPersonIn: businessPersonIn.value, | ||
135 | - customerCodeIn: customerCodeIn.value, | ||
136 | - }); | ||
137 | - }); | ||
138 | - watch( | ||
139 | - [businessPersonIn, customerCodeIn], | ||
140 | - async ([newDateTime, newPeriod], [oldBusinessPersonIn, oldCustomerCodeIn]) => { | ||
141 | - console.log('businessPersonIn changed from', oldBusinessPersonIn, 'to', newDateTime); | ||
142 | - console.log('customerCodeIn changed from', oldCustomerCodeIn, 'to', newPeriod); | ||
143 | - | ||
144 | - // 在这里添加你希望在这两个值改变时执行的逻辑 | ||
145 | - data2.value = await getSalesData({ | ||
146 | - businessPersonIn: newDateTime, | ||
147 | - customerCodeIn: newPeriod, | ||
148 | - }); | ||
149 | - }, | ||
150 | - ); | ||
151 | - const growCardList2 = computed(() => { | ||
152 | - return [ | ||
153 | - { | ||
154 | - title: '总销售额', | ||
155 | - icon: 'visit-count|svg', | ||
156 | - value: data2.value?.yearlySalesAmountTarget || 0, | ||
157 | - total: 120000, | ||
158 | - color: 'green', | ||
159 | - action: '年', | ||
160 | - }, | ||
161 | - { | ||
162 | - title: '总销售额完成率', | ||
163 | - icon: 'visit-count|svg', | ||
164 | - value: data2.value?.yearlySalesAmountCompletionRate || 0, | ||
165 | - total: 120000, | ||
166 | - color: 'green', | ||
167 | - action: '年', | ||
168 | - }, | ||
169 | - { | ||
170 | - title: '每月销售额目标', | ||
171 | - icon: 'visit-count|svg', | ||
172 | - value: data2.value?.monthlySalesAmountTarget || 0, | ||
173 | - total: 120000, | ||
174 | - color: 'green', | ||
175 | - action: '月', | ||
176 | - }, | ||
177 | - { | ||
178 | - title: '当月销售额完成率', | ||
179 | - icon: 'visit-count|svg', | ||
180 | - value: data2.value?.monthlySalesAmountCompletionRate || 0, | ||
181 | - total: 120000, | ||
182 | - color: 'green', | ||
183 | - action: '月', | ||
184 | - }, | ||
185 | - { | ||
186 | - title: '今日销售额', | ||
187 | - icon: 'visit-count|svg', | ||
188 | - value: data2.value?.daylySalesAmount || 0, | ||
189 | - total: 120000, | ||
190 | - color: 'green', | ||
191 | - action: '日', | ||
192 | - }, | ||
193 | - ]; | ||
194 | - }); | ||
195 | 83 | ||
196 | defineProps({ | 84 | defineProps({ |
197 | loading: { | 85 | loading: { |
198 | type: Boolean, | 86 | type: Boolean, |
199 | }, | 87 | }, |
200 | - exchangeTab: { | ||
201 | - type: String, | ||
202 | - }, | ||
203 | }); | 88 | }); |
204 | </script> | 89 | </script> |
src/views/dashboard/analysis/components/SiteAnalysis.vue
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | <VisitAnalysis /> | 9 | <VisitAnalysis /> |
10 | </p> | 10 | </p> |
11 | <p v-if="activeKey === 'tab2'"> | 11 | <p v-if="activeKey === 'tab2'"> |
12 | - <VisitAnalysisBar style="margin-top: 100px" /> | 12 | + <VisitAnalysisBar /> |
13 | </p> | 13 | </p> |
14 | </Card> | 14 | </Card> |
15 | </template> | 15 | </template> |
@@ -18,8 +18,6 @@ | @@ -18,8 +18,6 @@ | ||
18 | import { Card } from 'ant-design-vue'; | 18 | import { Card } from 'ant-design-vue'; |
19 | import VisitAnalysis from './VisitAnalysis.vue'; | 19 | import VisitAnalysis from './VisitAnalysis.vue'; |
20 | import VisitAnalysisBar from './VisitAnalysisBar.vue'; | 20 | import VisitAnalysisBar from './VisitAnalysisBar.vue'; |
21 | - import { exchangeTab } from '@/store/modules/user'; | ||
22 | - import type { SelectProps } from 'ant-design-vue'; | ||
23 | 21 | ||
24 | const activeKey = ref('tab1'); | 22 | const activeKey = ref('tab1'); |
25 | 23 | ||
@@ -28,40 +26,13 @@ | @@ -28,40 +26,13 @@ | ||
28 | key: 'tab1', | 26 | key: 'tab1', |
29 | tab: '订单趋势', | 27 | tab: '订单趋势', |
30 | }, | 28 | }, |
31 | - { | ||
32 | - key: 'tab2', | ||
33 | - tab: '销售额完成率', | ||
34 | - }, | 29 | + // { |
30 | + // key: 'tab2', | ||
31 | + // tab: '访问量', | ||
32 | + // }, | ||
35 | ]; | 33 | ]; |
36 | 34 | ||
37 | function onTabChange(key) { | 35 | function onTabChange(key) { |
38 | activeKey.value = key; | 36 | activeKey.value = key; |
39 | - exchangeTab.value = key; | ||
40 | } | 37 | } |
41 | </script> | 38 | </script> |
42 | -<style scoped> | ||
43 | - .custom-radio-group .ant-radio-button-wrapper { | ||
44 | - background-color: white; /* 未选中按钮的背景颜色为白色 */ | ||
45 | - color: #1684fc; /* 未选中按钮的文字颜色为 #1684fc */ | ||
46 | - border-color: #1684fc; /* 未选中按钮的边框颜色 */ | ||
47 | - } | ||
48 | - | ||
49 | - .custom-radio-group .ant-radio-button-wrapper-checked { | ||
50 | - background-color: #1684fc; /* 选中按钮的背景颜色为 #1684fc */ | ||
51 | - color: white; /* 选中按钮的文字颜色为白色 */ | ||
52 | - border-color: #1684fc; /* 选中按钮的边框颜色 */ | ||
53 | - } | ||
54 | - | ||
55 | - .custom-radio-group .ant-radio-button-wrapper-checked:hover { | ||
56 | - background-color: #1684fc; /* 悬停在选中按钮时保持相同的背景颜色 */ | ||
57 | - color: white; /* 悬停在选中按钮时保持文字为白色 */ | ||
58 | - } | ||
59 | - | ||
60 | - .custom-radio-group .ant-radio-button-wrapper:hover { | ||
61 | - border-color: #1684fc; /* 悬停在未选中按钮时的边框颜色 */ | ||
62 | - } | ||
63 | - | ||
64 | - .custom-radio-group .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-checked):hover { | ||
65 | - color: #1684fc; /* 悬停在未选中按钮时文字颜色为 #1684fc */ | ||
66 | - } | ||
67 | -</style> |
src/views/dashboard/analysis/components/VisitAnalysis.vue
1 | <template> | 1 | <template> |
2 | - <span style="margin-left: 50px; font-size: 18px">选择年份:</span> | ||
3 | - <a-select | ||
4 | - v-model:value="yearValue" | ||
5 | - show-search | ||
6 | - placeholder="请选择" | ||
7 | - style="width: 200px" | ||
8 | - :options="yearOptions" | ||
9 | - :filter-option="filterOption" | ||
10 | - @change="handleChangeYear" | ||
11 | - /> | ||
12 | - <div style="position: fixed; top: 80px; right: 70px"> | ||
13 | - <a-radio-group | ||
14 | - v-model:value="periodCopy" | ||
15 | - class="custom-radio-group" | ||
16 | - :style="{ marginLeft: '100px' }" | ||
17 | - > | ||
18 | - <a-radio-button value="月" @click="handlePeriodChange('月')">月</a-radio-button> | ||
19 | - <a-radio-button value="年" @click="handlePeriodChange('年')">年</a-radio-button> | ||
20 | - </a-radio-group> | ||
21 | - </div> | ||
22 | <div ref="chartRef" :style="{ height: '500px', width }"></div> | 2 | <div ref="chartRef" :style="{ height: '500px', width }"></div> |
23 | </template> | 3 | </template> |
24 | 4 | ||
@@ -28,71 +8,15 @@ | @@ -28,71 +8,15 @@ | ||
28 | import { basicProps } from './props'; | 8 | import { basicProps } from './props'; |
29 | import { max } from 'lodash-es'; | 9 | import { max } from 'lodash-es'; |
30 | import { useDataStoreWithOut } from '/@/store/modules/data'; | 10 | import { useDataStoreWithOut } from '/@/store/modules/data'; |
31 | - import { getChartData } from '/@/api/project/global'; | ||
32 | - import { dateTime, period } from '/@/store/modules/user'; | ||
33 | - import { useMessage } from '/@/hooks/web/useMessage'; | ||
34 | 11 | ||
35 | defineProps({ | 12 | defineProps({ |
36 | ...basicProps, | 13 | ...basicProps, |
37 | }); | 14 | }); |
38 | - const yearValue = ref(); | ||
39 | - const yearOptions = [ | ||
40 | - // { | ||
41 | - // label: '2025', | ||
42 | - // value: 2025, | ||
43 | - // }, | ||
44 | - { | ||
45 | - label: '2024', | ||
46 | - value: 2024, | ||
47 | - }, | ||
48 | - { | ||
49 | - label: '2023', | ||
50 | - value: 2023, | ||
51 | - }, | ||
52 | - ]; | ||
53 | - const periodCopy = ref(); | ||
54 | - const { createMessage } = useMessage(); //错误提示组件 | ||
55 | - const { error } = createMessage; | ||
56 | const chartRef = ref<HTMLDivElement | null>(null); | 15 | const chartRef = ref<HTMLDivElement | null>(null); |
57 | const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>); | 16 | const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>); |
58 | - const filterOption = (input: string, option: any) => { | ||
59 | - return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0; | ||
60 | - }; | ||
61 | - function handlePeriodChange(value) { | ||
62 | - //没选年份报错 | ||
63 | - if (value == '月') { | ||
64 | - if (dateTime.value == undefined) { | ||
65 | - error('请选择年份'); | ||
66 | - return; | ||
67 | - } | ||
68 | - } else if (value == '年') { | ||
69 | - yearValue.value = null; | ||
70 | - } | ||
71 | - period.value = value; | ||
72 | - } | ||
73 | - function handleChangeYear(value) { | ||
74 | - if (period.value == null) { | ||
75 | - period.value = '月'; | ||
76 | - periodCopy.value = '月'; | ||
77 | - } | ||
78 | - yearValue.value = value; | ||
79 | - dateTime.value = yearValue.value; | ||
80 | - } | ||
81 | const dataStore = useDataStoreWithOut(); | 17 | const dataStore = useDataStoreWithOut(); |
82 | - //监控选择器变化 | ||
83 | - watchEffect(async () => { | ||
84 | - // const data = dataStore?.getChartData || {}; | ||
85 | - const chartData = await getChartData({ | ||
86 | - dateTime: dateTime.value, | ||
87 | - period: period.value, | ||
88 | - }); | ||
89 | - const x = [], | ||
90 | - y = []; | ||
91 | - for (const key in chartData) { | ||
92 | - x.push(chartData[key].date); | ||
93 | - y.push(chartData[key].count); | ||
94 | - } | ||
95 | - const data = { x, y }; | 18 | + watchEffect(() => { |
19 | + const data = dataStore?.getChartData || {}; | ||
96 | const maxY = data?.y ? max(data?.y) : 0; | 20 | const maxY = data?.y ? max(data?.y) : 0; |
97 | setOptions({ | 21 | setOptions({ |
98 | tooltip: { | 22 | tooltip: { |
@@ -106,6 +30,7 @@ | @@ -106,6 +30,7 @@ | ||
106 | }, | 30 | }, |
107 | xAxis: { | 31 | xAxis: { |
108 | type: 'category', | 32 | type: 'category', |
33 | + boundaryGap: false, | ||
109 | data: data?.x, | 34 | data: data?.x, |
110 | splitLine: { | 35 | splitLine: { |
111 | show: true, | 36 | show: true, |
@@ -162,29 +87,3 @@ | @@ -162,29 +87,3 @@ | ||
162 | }); | 87 | }); |
163 | }); | 88 | }); |
164 | </script> | 89 | </script> |
165 | -<style scoped> | ||
166 | - .custom-radio-group .ant-radio-button-wrapper { | ||
167 | - border-color: #1684fc; /* 未选中按钮的边框颜色 */ | ||
168 | - background-color: white; /* 未选中按钮的背景颜色为白色 */ | ||
169 | - color: #1684fc; /* 未选中按钮的文字颜色为 #1684fc */ | ||
170 | - } | ||
171 | - | ||
172 | - .custom-radio-group .ant-radio-button-wrapper-checked { | ||
173 | - border-color: #1684fc; /* 选中按钮的边框颜色 */ | ||
174 | - background-color: #1684fc; /* 选中按钮的背景颜色为 #1684fc */ | ||
175 | - color: white; /* 选中按钮的文字颜色为白色 */ | ||
176 | - } | ||
177 | - | ||
178 | - .custom-radio-group .ant-radio-button-wrapper-checked:hover { | ||
179 | - background-color: #1684fc; /* 悬停在选中按钮时保持相同的背景颜色 */ | ||
180 | - color: white; /* 悬停在选中按钮时保持文字为白色 */ | ||
181 | - } | ||
182 | - | ||
183 | - .custom-radio-group .ant-radio-button-wrapper:hover { | ||
184 | - border-color: #1684fc; /* 悬停在未选中按钮时的边框颜色 */ | ||
185 | - } | ||
186 | - | ||
187 | - .custom-radio-group .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-checked):hover { | ||
188 | - color: #1684fc; /* 悬停在未选中按钮时文字颜色为 #1684fc */ | ||
189 | - } | ||
190 | -</style> |
src/views/dashboard/analysis/components/VisitAnalysisBar.vue
1 | <template> | 1 | <template> |
2 | - <div style="margin-bottom: 30px"> | ||
3 | - <span v-if="role === ROLE.ADMIN"> | ||
4 | - <span style="font-size: 18px; margin-right: 10px">业务员</span> | ||
5 | - <a-select | ||
6 | - v-model:value="value1" | ||
7 | - show-search | ||
8 | - placeholder="请选择" | ||
9 | - style="width: 200px" | ||
10 | - :options="customerCodeOptions" | ||
11 | - :filter-option="filterOption" | ||
12 | - @focus="handleFocus" | ||
13 | - @blur="handleBlur" | ||
14 | - @change="handleChangeBusiness" | ||
15 | - /> | ||
16 | - <span style="font-size: 18px; margin-left: 50px; margin-right: 10px">客户编码</span> | ||
17 | - <a-select | ||
18 | - v-model:value="value2" | ||
19 | - show-search | ||
20 | - placeholder="请选择" | ||
21 | - style="width: 200px" | ||
22 | - :options="businessPersonOptions" | ||
23 | - :filter-option="filterOption" | ||
24 | - @focus="handleFocus" | ||
25 | - @blur="handleBlur" | ||
26 | - @change="handleChangeCustomer" | ||
27 | - /> | ||
28 | - <span style="right: 10px" | ||
29 | - ><a-button | ||
30 | - type="default" | ||
31 | - @click="clearData" | ||
32 | - :style="{ marginLeft: '100px', borderRadius: '5px 5px 5px 5px' }" | ||
33 | - > | ||
34 | - 重置 | ||
35 | - </a-button> | ||
36 | - <a-button | ||
37 | - :style="{ marginLeft: '20px', borderRadius: '5px 5px 5px 5px' }" | ||
38 | - shape="default" | ||
39 | - type="primary" | ||
40 | - @click="updateData" | ||
41 | - >查询</a-button | ||
42 | - ></span | ||
43 | - ></span | ||
44 | - > | ||
45 | - <div style="position: fixed; top: 80px; right: 70px"> | ||
46 | - <a-radio-group | ||
47 | - v-model:value="periodChange" | ||
48 | - class="custom-radio-group" | ||
49 | - :style="{ marginLeft: '100px' }" | ||
50 | - > | ||
51 | - <a-radio-button value="MONTH" @click="handlePeriodChange('MONTH')">月</a-radio-button> | ||
52 | - <a-radio-button value="QUARTER" @click="handlePeriodChange('QUARTER')">季度</a-radio-button> | ||
53 | - <a-radio-button value="YEAR" @click="handlePeriodChange('YEAR')">年</a-radio-button> | ||
54 | - </a-radio-group> | ||
55 | - </div></div | ||
56 | - > | ||
57 | - <div v-if="role !== ROLE.ADMIN" style="margin-bottom: 60px"></div> | ||
58 | - <div ref="chartRef" :style="{ height: '400px', width }"></div> | 2 | + <div ref="chartRef" :style="{ height, width }"></div> |
59 | </template> | 3 | </template> |
60 | <script lang="ts"> | 4 | <script lang="ts"> |
61 | import { basicProps } from './props'; | 5 | import { basicProps } from './props'; |
62 | </script> | 6 | </script> |
63 | <script lang="ts" setup> | 7 | <script lang="ts" setup> |
64 | - import { computed, onMounted, ref, Ref, watchEffect } from 'vue'; | 8 | + import { onMounted, ref, Ref } from 'vue'; |
65 | import { useECharts } from '/@/hooks/web/useECharts'; | 9 | import { useECharts } from '/@/hooks/web/useECharts'; |
66 | - import { useDataStoreWithOut } from '/@/store/modules/data'; | ||
67 | - import { businessPersonIn, customerCodeIn, useUserStoreWithOut } from '@/store/modules/user'; | ||
68 | - | ||
69 | - //biaoji | ||
70 | - import type { SelectProps } from 'ant-design-vue'; | ||
71 | - import { getCustomerSalesData } from '/@/api/project/global'; | ||
72 | - import { useOrderStoreWithOut } from '/@/store/modules/order'; | ||
73 | - import { useOrderInfo } from '/@/hooks/component/order'; | ||
74 | - import { ROLE } from '/@/views/project/order/type.d'; | ||
75 | - | ||
76 | - const userStore = useUserStoreWithOut(); | ||
77 | - const user = userStore.getUserInfo; | ||
78 | - const role = computed(() => { | ||
79 | - return user?.roleSmallVO?.code; | ||
80 | - }); | ||
81 | - const orderStore = useOrderStoreWithOut(); | ||
82 | - onMounted(async () => { | ||
83 | - await orderStore.getDict(); | ||
84 | - }); | ||
85 | - const { customerCode: customerCodeOptions, businessPerson: businessPersonOptions } = | ||
86 | - useOrderInfo(orderStore); | ||
87 | - | ||
88 | - const periodChange = ref('MONTH'); | ||
89 | - // const businessPersonInChange = ref(); | ||
90 | - const businessPersonInChange: string[] = []; | ||
91 | - const customerCodeInChange: string[] = []; | ||
92 | - const handleChangeBusiness = (value: string) => { | ||
93 | - if (businessPersonInChange.length === 0) { | ||
94 | - // 如果数组为空,直接将 value 值放入数组 | ||
95 | - businessPersonInChange.push(value); | ||
96 | - } else { | ||
97 | - // 如果数组不为空,清空数组再将 value 值放入数组 | ||
98 | - businessPersonInChange.length = 0; // 也可以使用 array.splice(0, array.length); | ||
99 | - businessPersonInChange.push(value); | ||
100 | - } | ||
101 | - // console.log(`5656selected ${businessPersonInChange}`); | ||
102 | - }; | ||
103 | - const handleChangeCustomer = (value: string) => { | ||
104 | - if (customerCodeInChange.length === 0) { | ||
105 | - // 如果数组为空,直接将 value 值放入数组 | ||
106 | - customerCodeInChange.push(value); | ||
107 | - } else { | ||
108 | - // 如果数组不为空,清空数组再将 value 值放入数组 | ||
109 | - customerCodeInChange.length = 0; // 也可以使用 array.splice(0, array.length); | ||
110 | - customerCodeInChange.push(value); | ||
111 | - } | ||
112 | - // console.log(`5656selected ${customerCodeInChange}`); | ||
113 | - }; | ||
114 | - const handleBlur = () => {}; | ||
115 | - const handleFocus = () => {}; | ||
116 | - const filterOption = (input: string, option: any) => { | ||
117 | - return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0; | ||
118 | - }; | ||
119 | - | ||
120 | - const value1 = ref(); | ||
121 | - const value2 = ref(); | ||
122 | - | ||
123 | - function handlePeriodChange(value) { | ||
124 | - periodChange.value = value; | ||
125 | - } | ||
126 | - //biaoji | ||
127 | 10 | ||
128 | defineProps({ | 11 | defineProps({ |
129 | ...basicProps, | 12 | ...basicProps, |
130 | }); | 13 | }); |
131 | - const dataStore = useDataStoreWithOut(); | ||
132 | 14 | ||
133 | const chartRef = ref<HTMLDivElement | null>(null); | 15 | const chartRef = ref<HTMLDivElement | null>(null); |
134 | const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>); | 16 | const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>); |
135 | - | ||
136 | - function updateData() { | ||
137 | - customerCodeIn.value = value1.value; | ||
138 | - businessPersonIn.value = value2.value; | ||
139 | - } | ||
140 | - function clearData() { | ||
141 | - customerCodeIn.value = null; | ||
142 | - businessPersonIn.value = null; | ||
143 | - value1.value = null; | ||
144 | - value2.value = null; | ||
145 | - } | ||
146 | - | ||
147 | - watchEffect(async () => { | ||
148 | - // const data1 = dataStore?.getCustomerChartData1 || {}; | ||
149 | - const data2 = await getCustomerSalesData({ | ||
150 | - businessPersonIn: businessPersonIn.value, | ||
151 | - customerCodeIn: customerCodeIn.value, | ||
152 | - period: periodChange.value, | ||
153 | - }); | ||
154 | - const x = [], | ||
155 | - y = [], | ||
156 | - z = []; | ||
157 | - for (const key in data2) { | ||
158 | - x.push(key); | ||
159 | - y.push(data2[key].salesAmount); | ||
160 | - z.push(data2[key].target); | ||
161 | - } | ||
162 | - const customerChartData1 = { x, y, z }; | 17 | + onMounted(() => { |
163 | setOptions({ | 18 | setOptions({ |
164 | tooltip: { | 19 | tooltip: { |
165 | trigger: 'axis', | 20 | trigger: 'axis', |
@@ -170,65 +25,23 @@ | @@ -170,65 +25,23 @@ | ||
170 | }, | 25 | }, |
171 | }, | 26 | }, |
172 | }, | 27 | }, |
173 | - legend: { | ||
174 | - data: ['销售额', '销售目标'], | ||
175 | - }, | ||
176 | - grid: { left: '1%', right: '1%', top: '10 %', bottom: 0, containLabel: true }, | 28 | + grid: { left: '1%', right: '1%', top: '2 %', bottom: 0, containLabel: true }, |
177 | xAxis: { | 29 | xAxis: { |
178 | type: 'category', | 30 | type: 'category', |
179 | - data: customerChartData1?.x, | 31 | + data: [...new Array(12)].map((_item, index) => `${index + 1}月`), |
180 | }, | 32 | }, |
181 | yAxis: { | 33 | yAxis: { |
182 | type: 'value', | 34 | type: 'value', |
183 | - // // max: 8000, | ||
184 | - // splitNumber: 4, | 35 | + max: 8000, |
36 | + splitNumber: 4, | ||
185 | }, | 37 | }, |
186 | series: [ | 38 | series: [ |
187 | { | 39 | { |
188 | - name: '销售额', | ||
189 | - data: customerChartData1?.y, | 40 | + data: [3000, 2000, 3333, 5000, 3200, 4200, 3200, 2100, 3000, 5100, 6000, 3200, 4800], |
190 | type: 'bar', | 41 | type: 'bar', |
191 | barMaxWidth: 80, | 42 | barMaxWidth: 80, |
192 | }, | 43 | }, |
193 | - { | ||
194 | - name: '销售目标', | ||
195 | - smooth: true, | ||
196 | - data: customerChartData1?.z, | ||
197 | - type: 'line', | ||
198 | - areaStyle: { | ||
199 | - color: 'rgba(255, 255, 255, 0)', | ||
200 | - }, | ||
201 | - itemStyle: { | ||
202 | - color: 'rgba(124, 205, 214)', | ||
203 | - }, | ||
204 | - }, | ||
205 | ], | 44 | ], |
206 | }); | 45 | }); |
207 | }); | 46 | }); |
208 | </script> | 47 | </script> |
209 | -<style scoped> | ||
210 | - .custom-radio-group .ant-radio-button-wrapper { | ||
211 | - background-color: white; /* 未选中按钮的背景颜色为白色 */ | ||
212 | - color: #1684fc; /* 未选中按钮的文字颜色为 #1684fc */ | ||
213 | - border-color: #1684fc; /* 未选中按钮的边框颜色 */ | ||
214 | - } | ||
215 | - | ||
216 | - .custom-radio-group .ant-radio-button-wrapper-checked { | ||
217 | - background-color: #1684fc; /* 选中按钮的背景颜色为 #1684fc */ | ||
218 | - color: white; /* 选中按钮的文字颜色为白色 */ | ||
219 | - border-color: #1684fc; /* 选中按钮的边框颜色 */ | ||
220 | - } | ||
221 | - | ||
222 | - .custom-radio-group .ant-radio-button-wrapper-checked:hover { | ||
223 | - background-color: #1684fc; /* 悬停在选中按钮时保持相同的背景颜色 */ | ||
224 | - color: white; /* 悬停在选中按钮时保持文字为白色 */ | ||
225 | - } | ||
226 | - | ||
227 | - .custom-radio-group .ant-radio-button-wrapper:hover { | ||
228 | - border-color: #1684fc; /* 悬停在未选中按钮时的边框颜色 */ | ||
229 | - } | ||
230 | - | ||
231 | - .custom-radio-group .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-checked):hover { | ||
232 | - color: #1684fc; /* 悬停在未选中按钮时文字颜色为 #1684fc */ | ||
233 | - } | ||
234 | -</style> |
src/views/dashboard/analysis/data.ts
@@ -49,54 +49,3 @@ export const growCardList: GrowCardItem[] = [ | @@ -49,54 +49,3 @@ export const growCardList: GrowCardItem[] = [ | ||
49 | action: '年', | 49 | action: '年', |
50 | }, | 50 | }, |
51 | ]; | 51 | ]; |
52 | - | ||
53 | -export const growCardList2: GrowCardItem[] = [ | ||
54 | - { | ||
55 | - title: '总销售额', | ||
56 | - icon: 'visit-count|svg', | ||
57 | - value: 2000, | ||
58 | - total: 120000, | ||
59 | - color: 'green', | ||
60 | - action: '年', | ||
61 | - }, | ||
62 | - { | ||
63 | - title: '总销售额完成率', | ||
64 | - icon: 'visit-count|svg', | ||
65 | - value: 2000, | ||
66 | - total: 120000, | ||
67 | - color: 'green', | ||
68 | - action: '年', | ||
69 | - }, | ||
70 | - { | ||
71 | - title: '每月销售额目标', | ||
72 | - icon: 'visit-count|svg', | ||
73 | - value: 2000, | ||
74 | - total: 120000, | ||
75 | - color: 'green', | ||
76 | - action: '月', | ||
77 | - }, | ||
78 | - { | ||
79 | - title: '当月销售额完成率', | ||
80 | - icon: 'visit-count|svg', | ||
81 | - value: 2000, | ||
82 | - total: 120000, | ||
83 | - color: 'green', | ||
84 | - action: '月', | ||
85 | - }, | ||
86 | - { | ||
87 | - title: '当月销售额完成率', | ||
88 | - icon: 'visit-count|svg', | ||
89 | - value: 2000, | ||
90 | - total: 120000, | ||
91 | - color: 'green', | ||
92 | - action: '日', | ||
93 | - }, | ||
94 | - { | ||
95 | - title: '今日销售额', | ||
96 | - icon: 'visit-count|svg', | ||
97 | - value: 2000, | ||
98 | - total: 120000, | ||
99 | - color: 'green', | ||
100 | - action: '日', | ||
101 | - }, | ||
102 | -]; |
src/views/dashboard/analysis/index.vue
1 | <template> | 1 | <template> |
2 | <div class="p-4"> | 2 | <div class="p-4"> |
3 | - <GrowCard :loading="loading" class="enter-y" :exchangeTab="exchangeTab" /> | 3 | + <GrowCard :loading="loading" class="enter-y" /> |
4 | <SiteAnalysis class="!my-4 enter-y" :loading="loading" /> | 4 | <SiteAnalysis class="!my-4 enter-y" :loading="loading" /> |
5 | <!-- <div class="md:flex enter-y"> | 5 | <!-- <div class="md:flex enter-y"> |
6 | <VisitRadar class="md:w-1/3 w-full" :loading="loading" /> | 6 | <VisitRadar class="md:w-1/3 w-full" :loading="loading" /> |
@@ -10,24 +10,17 @@ | @@ -10,24 +10,17 @@ | ||
10 | </div> | 10 | </div> |
11 | </template> | 11 | </template> |
12 | <script lang="ts" setup> | 12 | <script lang="ts" setup> |
13 | - import { onMounted, ref, watch } from 'vue'; | 13 | + import { onMounted, ref } from 'vue'; |
14 | import GrowCard from './components/GrowCard.vue'; | 14 | import GrowCard from './components/GrowCard.vue'; |
15 | import SiteAnalysis from './components/SiteAnalysis.vue'; | 15 | import SiteAnalysis from './components/SiteAnalysis.vue'; |
16 | import { useDataStoreWithOut } from '/@/store/modules/data'; | 16 | import { useDataStoreWithOut } from '/@/store/modules/data'; |
17 | - import { exchangeTab } from '@/store/modules/user'; | ||
18 | 17 | ||
19 | const loading = ref(true); | 18 | const loading = ref(true); |
20 | const dataStore = useDataStoreWithOut(); | 19 | const dataStore = useDataStoreWithOut(); |
21 | - watch( | ||
22 | - () => exchangeTab.value, | ||
23 | - () => {}, | ||
24 | - ); | 20 | + |
25 | onMounted(() => { | 21 | onMounted(() => { |
26 | dataStore.getFetchData(); | 22 | dataStore.getFetchData(); |
27 | - dataStore.getFetchData2(); | ||
28 | dataStore.getFetchChartData(); | 23 | dataStore.getFetchChartData(); |
29 | - dataStore.getCustomerSalesData1(); | ||
30 | - exchangeTab.value; | ||
31 | }); | 24 | }); |
32 | 25 | ||
33 | setTimeout(() => { | 26 | setTimeout(() => { |
src/views/project/approve/PayPanel.vue
@@ -113,7 +113,10 @@ | @@ -113,7 +113,10 @@ | ||
113 | </a-list> --> | 113 | </a-list> --> |
114 | <template #appendFooter> | 114 | <template #appendFooter> |
115 | <a-button | 115 | <a-button |
116 | - v-if="(!isApproved && role === ROLE.ADMIN) || (!isApproved && showInvoice)" | 116 | + v-if=" |
117 | + ((!isApproved && role === ROLE.ADMIN) || (!isApproved && showInvoice)) && | ||
118 | + (role !== ROLE.BUSINESS || role !== ROLE.TRACKER) | ||
119 | + " | ||
117 | @click="handleFalse" | 120 | @click="handleFalse" |
118 | > | 121 | > |
119 | 不通过</a-button | 122 | 不通过</a-button |
src/views/project/config/index.vue
@@ -24,9 +24,9 @@ | @@ -24,9 +24,9 @@ | ||
24 | <Tabs.TabPane key="6" tab="提成成本配置"> | 24 | <Tabs.TabPane key="6" tab="提成成本配置"> |
25 | <TablePanel :searchInfo="{ relationCode: 'costSettingItem' }" :column="6" /> | 25 | <TablePanel :searchInfo="{ relationCode: 'costSettingItem' }" :column="6" /> |
26 | </Tabs.TabPane> | 26 | </Tabs.TabPane> |
27 | - <Tabs.TabPane key="7" tab="销售额配置" v-if="role !== ROLE.FINANCE"> | 27 | + <!-- <Tabs.TabPane key="7" tab="销售额配置" v-if="role !== ROLE.FINANCE"> |
28 | <TablePanel :searchInfo="{ relationCode: 'salesAmount' }" :column="7" /> | 28 | <TablePanel :searchInfo="{ relationCode: 'salesAmount' }" :column="7" /> |
29 | - </Tabs.TabPane> | 29 | + </Tabs.TabPane> --> |
30 | <Tabs.TabPane key="8" tab="生产科应付日期"> | 30 | <Tabs.TabPane key="8" tab="生产科应付日期"> |
31 | <TablePanel :searchInfo="{ relationCode: 'produHodTime' }" :column="8" /> | 31 | <TablePanel :searchInfo="{ relationCode: 'produHodTime' }" :column="8" /> |
32 | </Tabs.TabPane> | 32 | </Tabs.TabPane> |