|
@@ -5,7 +5,12 @@
|
|
* @Author: xinyan
|
|
* @Author: xinyan
|
|
*/
|
|
*/
|
|
|
|
|
|
-import { exportPlanSalesData } from '/src/views/reportManage/dataCenter/api';
|
|
|
|
|
|
+import {
|
|
|
|
+ exportPlanSalesData,
|
|
|
|
+ getDayTotalData,
|
|
|
|
+ getMonthTotalData, getPlanSalesTotalData,
|
|
|
|
+ getWeekTotalData
|
|
|
|
+} from '/src/views/reportManage/dataCenter/api';
|
|
import { reactive, ref } from 'vue';
|
|
import { reactive, ref } from 'vue';
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
import Selector from '/src/views/reportManage/dataCenter/normalDisplay/components/Selector/index.vue';
|
|
import Selector from '/src/views/reportManage/dataCenter/normalDisplay/components/Selector/index.vue';
|
|
@@ -18,6 +23,7 @@ const currentYear = ref('');
|
|
// 筛选查询
|
|
// 筛选查询
|
|
const selectorRef = ref(null);
|
|
const selectorRef = ref(null);
|
|
const taskIds = ref({});
|
|
const taskIds = ref({});
|
|
|
|
+const totalRow = ref([]);// 汇总数据
|
|
|
|
|
|
const gridOptions = reactive({
|
|
const gridOptions = reactive({
|
|
border: 'inner',
|
|
border: 'inner',
|
|
@@ -76,16 +82,32 @@ const gridEvents = {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+
|
|
|
|
+async function fetchTotalData(taskIds) {
|
|
|
|
+ try {
|
|
|
|
+ const resp = await getPlanSalesTotalData({
|
|
|
|
+ year_date: currentYear.value,
|
|
|
|
+ task_ids: taskIds,
|
|
|
|
+ });
|
|
|
|
+ totalRow.value = resp.data;
|
|
|
|
+ totalRow.value.platformNumber = '汇总';
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.error('Error fetching total data:', error);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
async function getList() {
|
|
async function getList() {
|
|
try {
|
|
try {
|
|
gridOptions.loading = true;
|
|
gridOptions.loading = true;
|
|
|
|
+ await fetchTotalData(taskIds.value);
|
|
const response = await getPlanList({
|
|
const response = await getPlanList({
|
|
page: gridOptions.pagerConfig.currentPage,
|
|
page: gridOptions.pagerConfig.currentPage,
|
|
limit: gridOptions.pagerConfig.pageSize,
|
|
limit: gridOptions.pagerConfig.pageSize,
|
|
year_date: currentYear.value,
|
|
year_date: currentYear.value,
|
|
task_ids: taskIds.value,
|
|
task_ids: taskIds.value,
|
|
});
|
|
});
|
|
- gridOptions.data = response.data;
|
|
|
|
|
|
+ // gridOptions.data = response.data;
|
|
|
|
+ gridOptions.data = [totalRow.value, ...response.data];
|
|
gridOptions.pagerConfig.total = response.total;
|
|
gridOptions.pagerConfig.total = response.total;
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.error('Error fetching task data:', error);
|
|
console.error('Error fetching task data:', error);
|
|
@@ -131,7 +153,16 @@ watch(currentYear, (newVal, oldVal) => {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
-const cellStyle = () => {
|
|
|
|
|
|
+const cellStyle = (row) => {
|
|
|
|
+ if (row.$rowIndex === 0 && row.$columnIndex < 5) {
|
|
|
|
+ return {
|
|
|
|
+ position: 'sticky',
|
|
|
|
+ top: 0,
|
|
|
|
+ zIndex: 30,
|
|
|
|
+ fontSize: '12px',
|
|
|
|
+ fontWeight: '600',
|
|
|
|
+ };
|
|
|
|
+ }
|
|
return {
|
|
return {
|
|
fontSize: '12px',
|
|
fontSize: '12px',
|
|
fontWeight: '600',
|
|
fontWeight: '600',
|
|
@@ -145,7 +176,15 @@ const headerCellStyle = () => {
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
|
|
-const rowStyle = () => {
|
|
|
|
|
|
+const rowStyle = (row) => {
|
|
|
|
+ if (row.$rowIndex === 0) {
|
|
|
|
+ return {
|
|
|
|
+ background: '#def6fe',
|
|
|
|
+ position: 'sticky',
|
|
|
|
+ top: 0,
|
|
|
|
+ zIndex: 1,
|
|
|
|
+ };
|
|
|
|
+ }
|
|
return {
|
|
return {
|
|
padding: 0,
|
|
padding: 0,
|
|
height: '50px',
|
|
height: '50px',
|