fix:合格数统计工段展开
This commit is contained in:
parent
3e146f7d26
commit
eb56c827ef
|
@ -2,7 +2,7 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="right-panel">
|
||||
<el-select v-model="query.mgroup_name"
|
||||
<!-- <el-select v-model="query.mgroup_name"
|
||||
placeholder="请选择工段">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
|
@ -11,7 +11,7 @@
|
|||
:value="item"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-select> -->
|
||||
<el-date-picker
|
||||
v-model="queryDate"
|
||||
type="date"
|
||||
|
@ -28,42 +28,34 @@
|
|||
</div>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<!-- 0 -->
|
||||
<el-card shadow="never" style="margin-bottom: 8px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<div id="bachart1"></div>
|
||||
<div id="bachart0"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never" style="position: relative">
|
||||
<el-button
|
||||
@click="handleExport()"
|
||||
@click="handleExport(0)"
|
||||
class="tables"
|
||||
type="primary"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
id="exportDiv"
|
||||
:data="tableData0"
|
||||
id="exportDiv0"
|
||||
:height="300"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column
|
||||
label="物料名"
|
||||
prop="物料名"
|
||||
min-width="100"
|
||||
>
|
||||
<el-table-column label="物料名" prop="物料名" min-width="100">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="月份"
|
||||
prop="月"
|
||||
width="50"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="型号" prop="型号">
|
||||
</el-table-column>
|
||||
<el-table-column label="规格" prop="规格">
|
||||
<el-table-column label="日期">
|
||||
<template #default="scope">
|
||||
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务数" prop="任务数">
|
||||
</el-table-column>
|
||||
|
@ -71,10 +63,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="合格数" prop="合格数">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="不合格数"
|
||||
prop="不合格数"
|
||||
>
|
||||
<el-table-column label="不合格数" prop="不合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" prop="合格率">
|
||||
<template #default="scope">
|
||||
|
@ -86,6 +75,712 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<!-- 1 -->
|
||||
<el-card shadow="never" style="margin-bottom: 8px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<div id="bachart1"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never" style="position: relative">
|
||||
<el-button
|
||||
@click="handleExport(1)"
|
||||
class="tables"
|
||||
type="primary"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-table
|
||||
:data="tableData1"
|
||||
id="exportDiv1"
|
||||
:height="300"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料名" prop="物料名" min-width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="日期">
|
||||
<template #default="scope">
|
||||
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务数" prop="任务数">
|
||||
</el-table-column>
|
||||
<el-table-column label="生产数" prop="生产数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" prop="合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" prop="不合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" prop="合格率">
|
||||
<template #default="scope">
|
||||
{{ Math.round(scope.row.合格率) }}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<!-- 2 -->
|
||||
<el-card shadow="never" style="margin-bottom: 8px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<div id="bachart2"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never" style="position: relative">
|
||||
<el-button
|
||||
@click="handleExport(2)"
|
||||
class="tables"
|
||||
type="primary"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-table
|
||||
:data="tableData2"
|
||||
id="2"
|
||||
:height="300"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料名" prop="物料名" min-width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="日期">
|
||||
<template #default="scope">
|
||||
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务数" prop="任务数">
|
||||
</el-table-column>
|
||||
<el-table-column label="生产数" prop="生产数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" prop="合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" prop="不合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" prop="合格率">
|
||||
<template #default="scope">
|
||||
{{ Math.round(scope.row.合格率) }}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<!-- 3 -->
|
||||
<el-card shadow="never" style="margin-bottom: 8px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<div id="bachart3"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never" style="position: relative">
|
||||
<el-button
|
||||
@click="handleExport(3)"
|
||||
class="tables"
|
||||
type="primary"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-table
|
||||
:data="tableData3"
|
||||
id="exportDiv3"
|
||||
:height="300"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料名" prop="物料名" min-width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="日期">
|
||||
<template #default="scope">
|
||||
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务数" prop="任务数">
|
||||
</el-table-column>
|
||||
<el-table-column label="生产数" prop="生产数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" prop="合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" prop="不合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" prop="合格率">
|
||||
<template #default="scope">
|
||||
{{ Math.round(scope.row.合格率) }}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<!-- 4 -->
|
||||
<el-card shadow="never" style="margin-bottom: 8px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<div id="bachart4"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never" style="position: relative">
|
||||
<el-button
|
||||
@click="handleExport(4)"
|
||||
class="tables"
|
||||
type="primary"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-table
|
||||
:data="tableData4"
|
||||
id="exportDiv4"
|
||||
:height="300"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料名" prop="物料名" min-width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="日期">
|
||||
<template #default="scope">
|
||||
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务数" prop="任务数">
|
||||
</el-table-column>
|
||||
<el-table-column label="生产数" prop="生产数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" prop="合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" prop="不合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" prop="合格率">
|
||||
<template #default="scope">
|
||||
{{ Math.round(scope.row.合格率) }}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<!-- 5 -->
|
||||
<el-card shadow="never" style="margin-bottom: 8px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<div id="bachart5"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never" style="position: relative">
|
||||
<el-button
|
||||
@click="handleExport(5)"
|
||||
class="tables"
|
||||
type="primary"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-table
|
||||
:data="tableData5"
|
||||
id="exportDiv5"
|
||||
:height="300"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料名" prop="物料名" min-width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="日期">
|
||||
<template #default="scope">
|
||||
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务数" prop="任务数">
|
||||
</el-table-column>
|
||||
<el-table-column label="生产数" prop="生产数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" prop="合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" prop="不合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" prop="合格率">
|
||||
<template #default="scope">
|
||||
{{ Math.round(scope.row.合格率) }}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<!-- 6 -->
|
||||
<el-card shadow="never" style="margin-bottom: 8px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<div id="bachart6"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never" style="position: relative">
|
||||
<el-button
|
||||
@click="handleExport(6)"
|
||||
class="tables"
|
||||
type="primary"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-table
|
||||
:data="tableData6"
|
||||
id="exportDiv6"
|
||||
:height="300"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料名" prop="物料名" min-width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="日期">
|
||||
<template #default="scope">
|
||||
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务数" prop="任务数">
|
||||
</el-table-column>
|
||||
<el-table-column label="生产数" prop="生产数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" prop="合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" prop="不合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" prop="合格率">
|
||||
<template #default="scope">
|
||||
{{ Math.round(scope.row.合格率) }}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<!-- 7 -->
|
||||
<el-card shadow="never" style="margin-bottom: 8px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<div id="bachart7"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never" style="position: relative">
|
||||
<el-button
|
||||
@click="handleExport(7)"
|
||||
class="tables"
|
||||
type="primary"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-table
|
||||
:data="tableData7"
|
||||
id="exportDiv7"
|
||||
:height="300"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料名" prop="物料名" min-width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="日期">
|
||||
<template #default="scope">
|
||||
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务数" prop="任务数">
|
||||
</el-table-column>
|
||||
<el-table-column label="生产数" prop="生产数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" prop="合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" prop="不合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" prop="合格率">
|
||||
<template #default="scope">
|
||||
{{ Math.round(scope.row.合格率) }}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<!-- 8 -->
|
||||
<el-card shadow="never" style="margin-bottom: 8px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<div id="bachart8"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never" style="position: relative">
|
||||
<el-button
|
||||
@click="handleExport(8)"
|
||||
class="tables"
|
||||
type="primary"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-table
|
||||
:data="tableData8"
|
||||
id="exportDiv8"
|
||||
:height="300"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料名" prop="物料名" min-width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="日期">
|
||||
<template #default="scope">
|
||||
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务数" prop="任务数">
|
||||
</el-table-column>
|
||||
<el-table-column label="生产数" prop="生产数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" prop="合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" prop="不合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" prop="合格率">
|
||||
<template #default="scope">
|
||||
{{ Math.round(scope.row.合格率) }}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<!-- 9 -->
|
||||
<el-card shadow="never" style="margin-bottom: 8px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<div id="bachart9"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never" style="position: relative">
|
||||
<el-button
|
||||
@click="handleExport(9)"
|
||||
class="tables"
|
||||
type="primary"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-table
|
||||
:data="tableData9"
|
||||
id="exportDiv9"
|
||||
:height="300"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料名" prop="物料名" min-width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="日期">
|
||||
<template #default="scope">
|
||||
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务数" prop="任务数">
|
||||
</el-table-column>
|
||||
<el-table-column label="生产数" prop="生产数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" prop="合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" prop="不合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" prop="合格率">
|
||||
<template #default="scope">
|
||||
{{ Math.round(scope.row.合格率) }}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<!-- 10 -->
|
||||
<el-card shadow="never" style="margin-bottom: 8px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<div id="bachart10"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never" style="position: relative">
|
||||
<el-button
|
||||
@click="handleExport(10)"
|
||||
class="tables"
|
||||
type="primary"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-table
|
||||
:data="tableData10"
|
||||
id="exportDiv10"
|
||||
:height="300"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料名" prop="物料名" min-width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="日期">
|
||||
<template #default="scope">
|
||||
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务数" prop="任务数">
|
||||
</el-table-column>
|
||||
<el-table-column label="生产数" prop="生产数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" prop="合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" prop="不合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" prop="合格率">
|
||||
<template #default="scope">
|
||||
{{ Math.round(scope.row.合格率) }}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<!-- 11 -->
|
||||
<el-card shadow="never" style="margin-bottom: 8px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<div id="bachart11"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never" style="position: relative">
|
||||
<el-button
|
||||
@click="handleExport(11)"
|
||||
class="tables"
|
||||
type="primary"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-table
|
||||
:data="tableData11"
|
||||
id="exportDiv11"
|
||||
:height="300"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料名" prop="物料名" min-width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="日期">
|
||||
<template #default="scope">
|
||||
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务数" prop="任务数">
|
||||
</el-table-column>
|
||||
<el-table-column label="生产数" prop="生产数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" prop="合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" prop="不合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" prop="合格率">
|
||||
<template #default="scope">
|
||||
{{ Math.round(scope.row.合格率) }}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<!-- 12 -->
|
||||
<el-card shadow="never" style="margin-bottom: 8px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<div id="bachart12"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never" style="position: relative">
|
||||
<el-button
|
||||
@click="handleExport(12)"
|
||||
class="tables"
|
||||
type="primary"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-table
|
||||
:data="tableData12"
|
||||
id="exportDiv12"
|
||||
:height="300"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料名" prop="物料名" min-width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="日期">
|
||||
<template #default="scope">
|
||||
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务数" prop="任务数">
|
||||
</el-table-column>
|
||||
<el-table-column label="生产数" prop="生产数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" prop="合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" prop="不合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" prop="合格率">
|
||||
<template #default="scope">
|
||||
{{ Math.round(scope.row.合格率) }}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<!-- 13 -->
|
||||
<el-card shadow="never" style="margin-bottom: 8px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<div id="bachart13"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never" style="position: relative">
|
||||
<el-button
|
||||
@click="handleExport(13)"
|
||||
class="tables"
|
||||
type="primary"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-table
|
||||
:data="tableData13"
|
||||
id="exportDiv13"
|
||||
:height="300"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料名" prop="物料名" min-width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="日期">
|
||||
<template #default="scope">
|
||||
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务数" prop="任务数">
|
||||
</el-table-column>
|
||||
<el-table-column label="生产数" prop="生产数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" prop="合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" prop="不合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" prop="合格率">
|
||||
<template #default="scope">
|
||||
{{ Math.round(scope.row.合格率) }}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<!-- 14 -->
|
||||
<el-card shadow="never" style="margin-bottom: 8px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<div id="bachart14"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never" style="position: relative">
|
||||
<el-button
|
||||
@click="handleExport(14)"
|
||||
class="tables"
|
||||
type="primary"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-table
|
||||
:data="tableData14"
|
||||
id="exportDiv14"
|
||||
:height="300"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料名" prop="物料名" min-width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="日期">
|
||||
<template #default="scope">
|
||||
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务数" prop="任务数">
|
||||
</el-table-column>
|
||||
<el-table-column label="生产数" prop="生产数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" prop="合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" prop="不合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" prop="合格率">
|
||||
<template #default="scope">
|
||||
{{ Math.round(scope.row.合格率) }}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<!-- 15 -->
|
||||
<el-card shadow="never" style="margin-bottom: 8px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<div id="bachart15"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never" style="position: relative">
|
||||
<el-button
|
||||
@click="handleExport(15)"
|
||||
class="tables"
|
||||
type="primary"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-table
|
||||
:data="tableData15"
|
||||
id="exportDiv15"
|
||||
:height="300"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料名" prop="物料名" min-width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="日期">
|
||||
<template #default="scope">
|
||||
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务数" prop="任务数">
|
||||
</el-table-column>
|
||||
<el-table-column label="生产数" prop="生产数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" prop="合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" prop="不合格数">
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" prop="合格率">
|
||||
<template #default="scope">
|
||||
{{ Math.round(scope.row.合格率) }}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
@ -116,11 +811,11 @@ export default {
|
|||
queryDate:'',
|
||||
currentYear: "",
|
||||
currentMonth: "",
|
||||
xAxisData: [],
|
||||
nameList: [],
|
||||
basicOption: {
|
||||
backgroundColor: "transparent",
|
||||
title: {
|
||||
text: "",
|
||||
text: "合格数统计",
|
||||
},
|
||||
grid: {
|
||||
top: "80px",
|
||||
|
@ -136,16 +831,24 @@ export default {
|
|||
type: "value",
|
||||
},
|
||||
lenged: [],
|
||||
series: [
|
||||
{
|
||||
data: [],
|
||||
stack: "Ad",
|
||||
type: "bar",
|
||||
barWidth: "15px",
|
||||
},
|
||||
],
|
||||
series: [],
|
||||
},
|
||||
tableData: [],
|
||||
tableData0: [],
|
||||
tableData1: [],
|
||||
tableData2: [],
|
||||
tableData3: [],
|
||||
tableData4: [],
|
||||
tableData5: [],
|
||||
tableData6: [],
|
||||
tableData7: [],
|
||||
tableData8: [],
|
||||
tableData9: [],
|
||||
tableData10: [],
|
||||
tableData11: [],
|
||||
tableData12: [],
|
||||
tableData13: [],
|
||||
tableData14: [],
|
||||
tableData15: [],
|
||||
options:[],
|
||||
};
|
||||
},
|
||||
|
@ -153,7 +856,7 @@ export default {
|
|||
let that = this;
|
||||
let nowDate = new Date();
|
||||
that.getMgroup();
|
||||
that.getWeekDate(nowDate);
|
||||
// that.getWeekDate(nowDate);
|
||||
},
|
||||
methods: {
|
||||
getWeekDate(dates){
|
||||
|
@ -180,7 +883,10 @@ export default {
|
|||
console.log('dateArr',dateArr);
|
||||
that.query.start_date =first.getFullYear() +"-" +(first.getMonth() + 1) +"-" +first.getDate();
|
||||
that.query.end_date =last.getFullYear() +"-" +(last.getMonth() + 1) +"-" +last.getDate();
|
||||
that.getData();
|
||||
that.options.forEach((item,index)=>{
|
||||
that.getData(item,index);
|
||||
})
|
||||
|
||||
},
|
||||
setChart(name, option = null) {
|
||||
// 根据name 渲染数据, option需填写,否则option为模拟数据
|
||||
|
@ -208,50 +914,62 @@ export default {
|
|||
})
|
||||
that.query.mgroup_name = arr[0];
|
||||
that.options = arr;
|
||||
let nowDate = new Date();
|
||||
that.getWeekDate(nowDate);
|
||||
});
|
||||
},
|
||||
getData() {
|
||||
getData(mgroup_name,mgroup_index) {
|
||||
let that = this;
|
||||
let option = deepCopy(that.basicOption);
|
||||
let query = deepCopy(that.query);
|
||||
query.mgroup_name = mgroup_name;
|
||||
let obj = {};
|
||||
obj.query = that.query;
|
||||
obj.query = query;
|
||||
that.$API.bi.dataset.exec.req('lineDay_m', obj).then((res) => {
|
||||
let tableData = res.data2.ds0 ? res.data2.ds0 : [];
|
||||
that.tableData = tableData;
|
||||
let names = 'tableData'+mgroup_index;
|
||||
that[names] = tableData;
|
||||
if (tableData.length > 0) {
|
||||
let dataList = [],
|
||||
nameList = [],
|
||||
datas = [];
|
||||
let dataList = [],nameList = [],datas = [];
|
||||
tableData.forEach((ite) => {
|
||||
if (nameList.indexOf(ite.物料名) > -1) {} else {
|
||||
nameList.push(ite.物料名);
|
||||
|
||||
dataList.push([])
|
||||
datas.push([0,0,0,0,0,0,0]);
|
||||
let obj = {
|
||||
name:ite.物料名,
|
||||
data: [],
|
||||
stack: "Ad",
|
||||
type: "bar",
|
||||
barWidth: "15px",
|
||||
};
|
||||
option.series.push(obj)
|
||||
}
|
||||
});
|
||||
that.xAxisData = nameList;
|
||||
console.log('nameList',nameList);
|
||||
that.nameList = nameList;
|
||||
tableData.forEach((item) => {
|
||||
let indexX = nameList.indexOf(item.物料名);
|
||||
dataList[indexX].push(item);
|
||||
});
|
||||
console.log('dataList',dataList)
|
||||
for(let i = 0;i<dataList.length;i++){
|
||||
for(let j = 0;j<dataList[i].length;j++){
|
||||
let index = that.weekDateList.indexOf(dataList[i][j].日);
|
||||
datas[i][index].push(dataList[i][j].合格数); //将当前日期对应的合格数添加到datas中
|
||||
datas[i][index] = dataList[i][j].合格数; //将当前日期对应的合格数添加到datas中
|
||||
}
|
||||
}
|
||||
ption.xAxis.data = nameList;
|
||||
nameList.forEach((index,item) => {
|
||||
let obj = {
|
||||
data: datas[index],
|
||||
stack: "Ad",
|
||||
type: "bar",
|
||||
barWidth: "15px",
|
||||
};
|
||||
ption.series[index].data = serisData;
|
||||
});
|
||||
that.setChart("bachart1", option);
|
||||
console.log('datas',datas);
|
||||
for(let n=0;n<nameList.length;n++){
|
||||
option.series[n].data = datas[n];
|
||||
}
|
||||
console.log('option',option);
|
||||
let chartId = 'bachart'+mgroup_index;
|
||||
that.setChart(chartId, option);
|
||||
} else {
|
||||
that.setChart("bachart1", option);
|
||||
let chartId = 'bachart'+mgroup_index;
|
||||
that.setChart(chartId, option);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -261,8 +979,7 @@ export default {
|
|||
handleExport(val) {
|
||||
this.exportLoading = true;
|
||||
let id = "#exportDiv" + val;
|
||||
let name =
|
||||
val == "AVG" ? val + "合格数统计" : val + "车间合格数统计";
|
||||
let name = "合格数统计";
|
||||
this.$XLSX(id, name);
|
||||
this.exportLoading = false;
|
||||
},
|
||||
|
@ -271,7 +988,10 @@ export default {
|
|||
</script>
|
||||
|
||||
<style scoped>
|
||||
#bachart1{
|
||||
#bachart1,#bachart2,#bachart3,#bachart4,
|
||||
#bachart5,#bachart6,#bachart7,#bachart8,
|
||||
#bachart9,#bachart10,#bachart11,#bachart12,
|
||||
#bachart13,#bachart14,#bachart15,#bachart0{
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue