统计数据
This commit is contained in:
parent
eb113f4b7d
commit
78e658d816
10
src/api/yh/dashboard.js
Normal file
10
src/api/yh/dashboard.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import request from '@/utils/request.js'
|
||||||
|
|
||||||
|
// 获取员工产量统计
|
||||||
|
export function dashboardUserProd(params) {
|
||||||
|
return request({
|
||||||
|
url: "/yh/dashboard/userProd",
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
|
@ -51,7 +51,7 @@
|
||||||
<div class="search-area">
|
<div class="search-area">
|
||||||
<div class="search-wrapper">
|
<div class="search-wrapper">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.priceName"
|
v-model="queryParams.name"
|
||||||
placeholder="搜索工序名称"
|
placeholder="搜索工序名称"
|
||||||
clearable
|
clearable
|
||||||
prefix-icon="el-icon-search"
|
prefix-icon="el-icon-search"
|
||||||
|
@ -183,7 +183,7 @@ export default {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
priceName: null,
|
name: null,
|
||||||
category: null,
|
category: null,
|
||||||
size: null,
|
size: null,
|
||||||
surface: null,
|
surface: null,
|
||||||
|
@ -345,7 +345,8 @@ export default {
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
.condition-box {
|
.condition-box {
|
||||||
height: 100%;
|
position: relative;
|
||||||
|
height: calc(100vh - 32px);
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
.condition-title {
|
.condition-title {
|
||||||
|
|
|
@ -2,6 +2,44 @@
|
||||||
<div :class="listConfig.containerClass">
|
<div :class="listConfig.containerClass">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<!-- 报表日期 -->
|
<!-- 报表日期 -->
|
||||||
|
|
||||||
|
<el-form-item label="部门" prop="deptId">
|
||||||
|
<dept-tree-select v-model="queryParams.deptId" placeholder="请选择部门" class="small-tree-select" @change="handleQuery"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="报表状态" prop="reportStatus">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.reportStatus"
|
||||||
|
placeholder="请选择报表状态"
|
||||||
|
clearable
|
||||||
|
@change="handleQuery"
|
||||||
|
>
|
||||||
|
<el-option v-for="item in dict.type.report_status" :key="item.value" :label="item.label" :value="item.value"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="员工名称" prop="userName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.userName"
|
||||||
|
placeholder="请输入员工名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="工序名称" prop="priceName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.priceName"
|
||||||
|
placeholder="请输入工序名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="工序代码" prop="priceCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.priceCode"
|
||||||
|
placeholder="请输入工序代码"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="报表日期" prop="reportDateRange">
|
<el-form-item label="报表日期" prop="reportDateRange">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="queryParams.reportDateRange"
|
v-model="queryParams.reportDateRange"
|
||||||
|
@ -14,14 +52,6 @@
|
||||||
@change="handleQuery"
|
@change="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="员工名称" prop="userName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.userName"
|
|
||||||
placeholder="请输入员工名称"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
@ -65,6 +95,18 @@
|
||||||
<right-toolbar :show-refresh="listConfig.showRefresh" :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"/>
|
<right-toolbar :show-refresh="listConfig.showRefresh" :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"/>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
<!-- TODO 统计数据 -->
|
||||||
|
<el-row class="statistics-row">
|
||||||
|
<div class="statistics-item">
|
||||||
|
<span class="statistics-label">总产量:</span>
|
||||||
|
<span class="statistics-value">{{ statistics.totalNum || 0 }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="statistics-item">
|
||||||
|
<span class="statistics-label">总工资:</span>
|
||||||
|
<span class="statistics-value">{{ statistics.totalPrice || 0 }} 元</span>
|
||||||
|
</div>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="reportUserProdList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
|
<el-table v-loading="loading" :data="reportUserProdList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<template v-for="column of showColumns">
|
<template v-for="column of showColumns">
|
||||||
|
@ -162,6 +204,8 @@ import {
|
||||||
} from "@/api/yh/reportUserProd";
|
} from "@/api/yh/reportUserProd";
|
||||||
import {$listConfig, $showColumns, $showSearch} from '@/utils/mixins';
|
import {$listConfig, $showColumns, $showSearch} from '@/utils/mixins';
|
||||||
import FormCol from "@/components/FormCol/index.vue";
|
import FormCol from "@/components/FormCol/index.vue";
|
||||||
|
import DeptTreeSelect from '@/components/Business/Dept/DeptTreeSelect.vue';
|
||||||
|
import {dashboardUserProd} from '@/api/yh/dashboard.js';
|
||||||
|
|
||||||
// 默认排序字段
|
// 默认排序字段
|
||||||
const defaultSort = {
|
const defaultSort = {
|
||||||
|
@ -173,7 +217,7 @@ export default {
|
||||||
name: "ReportUserProd",
|
name: "ReportUserProd",
|
||||||
mixins: [$showColumns, $listConfig, $showSearch],
|
mixins: [$showColumns, $listConfig, $showSearch],
|
||||||
dicts: ['report_status'],
|
dicts: ['report_status'],
|
||||||
components: {FormCol},
|
components: {FormCol, DeptTreeSelect},
|
||||||
props: {
|
props: {
|
||||||
query: {
|
query: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
@ -247,7 +291,9 @@ export default {
|
||||||
num: [
|
num: [
|
||||||
{ required: true, message: "产量不能为空", trigger: "blur" }
|
{ required: true, message: "产量不能为空", trigger: "blur" }
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
// 统计数据
|
||||||
|
statistics: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -259,8 +305,14 @@ export default {
|
||||||
this.initSearchColumns();
|
this.initSearchColumns();
|
||||||
this.initColumns();
|
this.initColumns();
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.getStatistics();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getStatistics() {
|
||||||
|
dashboardUserProd(this.queryParams).then(res => {
|
||||||
|
this.statistics = res.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
/** 当排序按钮被点击时触发 **/
|
/** 当排序按钮被点击时触发 **/
|
||||||
onSortChange(column) {
|
onSortChange(column) {
|
||||||
if (column.order == null) {
|
if (column.order == null) {
|
||||||
|
@ -300,6 +352,7 @@ export default {
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.getStatistics();
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
|
@ -367,3 +420,37 @@ export default {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.box-card {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
.card-content {
|
||||||
|
text-align: center;
|
||||||
|
padding: 20px 0;
|
||||||
|
}
|
||||||
|
.statistics-row {
|
||||||
|
background: #f5f7fa;
|
||||||
|
padding: 15px;
|
||||||
|
margin: 10px 0;
|
||||||
|
border-radius: 4px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.statistics-item {
|
||||||
|
margin-right: 40px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.statistics-label {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #606266;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
.statistics-value {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #409EFF;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -127,5 +127,10 @@ module.exports = {
|
||||||
})
|
})
|
||||||
config.optimization.runtimeChunk('single')
|
config.optimization.runtimeChunk('single')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
config.plugin('html').tap(args => {
|
||||||
|
args[0].version = new Date().getTime()
|
||||||
|
return args
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user