|
@@ -96,7 +96,6 @@ async function fetchData() {
|
|
|
|
|
|
const resp = await getTableData(params);
|
|
|
gridOptions.data = resp.data;
|
|
|
- console.log("=>(MonthlyRating.vue:121) gridOptions.data", gridOptions.data);
|
|
|
gridOptions.pagerConfig.total = resp.total;
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
@@ -113,12 +112,12 @@ async function handleDownload() {
|
|
|
asin : searchAsin.value,
|
|
|
sku : searchSku.value,
|
|
|
};
|
|
|
-
|
|
|
+console.log(asinMonthDate.value);
|
|
|
const resp = await getTableDownloadData(params);
|
|
|
const url = window.URL.createObjectURL(resp.data);
|
|
|
const link = document.createElement('a');
|
|
|
link.href = url;
|
|
|
- link.setAttribute('download', asinMonthDate.slice(0, 7) + '平均评分.xlsx');
|
|
|
+ link.setAttribute('download', asinMonthDate.value + '平均评分.xlsx');
|
|
|
document.body.appendChild(link);
|
|
|
link.click();
|
|
|
document.body.removeChild(link);
|
|
@@ -126,7 +125,7 @@ async function handleDownload() {
|
|
|
gridOptions.loading = false;
|
|
|
ElMessage.success('下载成功!');
|
|
|
} catch (error) {
|
|
|
- ElMessage.error('下载失败!');
|
|
|
+ console.log(error);
|
|
|
} finally {
|
|
|
gridOptions.loading = false;
|
|
|
}
|
|
@@ -151,10 +150,8 @@ function headerStyle() {
|
|
|
|
|
|
watch(asinMonthDate, (newVal) => {
|
|
|
const date = dayjs(newVal).startOf('month').format('YYYY-MM-DD');
|
|
|
- console.log("=>(MonthlyRating.vue:180) date", date);
|
|
|
if (date !== asinMonthDate.value) {
|
|
|
asinMonthDate.value = date;
|
|
|
- console.log("=>(MonthlyRating.vue:183) asinMonthDate.value", asinMonthDate.value);
|
|
|
fetchData();
|
|
|
}
|
|
|
}
|