|
|
|
|
@ -36,17 +36,16 @@
|
|
|
|
|
>帕累托分析</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="success"
|
|
|
|
|
plain
|
|
|
|
|
icon="Edit"
|
|
|
|
|
:disabled="single"
|
|
|
|
|
@click="handleUpdate"
|
|
|
|
|
v-hasPermi="['warehouse:WmsImportResult:edit']"
|
|
|
|
|
>修改</el-button>
|
|
|
|
|
>项目分析</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="danger"
|
|
|
|
|
@ -55,7 +54,7 @@
|
|
|
|
|
:disabled="multiple"
|
|
|
|
|
@click="handleDelete"
|
|
|
|
|
v-hasPermi="['warehouse:WmsImportResult:remove']"
|
|
|
|
|
>删除</el-button>
|
|
|
|
|
>趋势分析</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
@ -73,8 +72,8 @@
|
|
|
|
|
<el-row class="mb8">
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<!-- 根据currentComponent动态切换组件 -->
|
|
|
|
|
<component
|
|
|
|
|
:is="currentComponent"
|
|
|
|
|
<component
|
|
|
|
|
:is="currentComponent"
|
|
|
|
|
v-if="currentComponent"
|
|
|
|
|
:selected-time-range="queryForm.selectedTimeRange"
|
|
|
|
|
:pareto-data="paretoData"
|
|
|
|
|
@ -83,7 +82,7 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 消息显示文本框 -->
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
@ -150,7 +149,7 @@ function handlePareto() {
|
|
|
|
|
// 根据选择的时间范围计算开始和结束日期
|
|
|
|
|
const endDate = new Date();
|
|
|
|
|
const startDate = new Date();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (queryForm.value.selectedTimeRange === '近1年') {
|
|
|
|
|
startDate.setFullYear(endDate.getFullYear() - 1);
|
|
|
|
|
} else if (queryForm.value.selectedTimeRange === '近2年') {
|
|
|
|
|
@ -158,7 +157,7 @@ function handlePareto() {
|
|
|
|
|
} else if (queryForm.value.selectedTimeRange === '近3年') {
|
|
|
|
|
startDate.setFullYear(endDate.getFullYear() - 3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 格式化日期为 YYYY-MM-DD
|
|
|
|
|
const formatDate = (date) => {
|
|
|
|
|
const year = date.getFullYear();
|
|
|
|
|
@ -166,10 +165,10 @@ function handlePareto() {
|
|
|
|
|
const day = String(date.getDate()).padStart(2, '0');
|
|
|
|
|
return `${year}-${month}-${day}`;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const startDateStr = formatDate(startDate);
|
|
|
|
|
const endDateStr = formatDate(endDate);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log(startDateStr, endDateStr);
|
|
|
|
|
// 调用质检API并显示结果
|
|
|
|
|
fetch(`${API_CONFIG.BASE_URL}${API_CONFIG.ENDPOINTS.PARETO_ANALYSIS}?start_date=${startDateStr}&end_date=${endDateStr}`)
|
|
|
|
|
|