From 78e658d8167bafee2b658dfbf7f621d2da8b8fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=B7=E5=8F=B6?= <14103883+leaf-phos@user.noreply.gitee.com> Date: Tue, 14 Jan 2025 11:03:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/yh/dashboard.js | 10 ++ .../Business/Price/PriceNewDrawer.vue | 7 +- src/views/yh/reportUserProd/index.vue | 107 ++++++++++++++++-- vue.config.js | 5 + 4 files changed, 116 insertions(+), 13 deletions(-) create mode 100644 src/api/yh/dashboard.js diff --git a/src/api/yh/dashboard.js b/src/api/yh/dashboard.js new file mode 100644 index 0000000..3dbe699 --- /dev/null +++ b/src/api/yh/dashboard.js @@ -0,0 +1,10 @@ +import request from '@/utils/request.js' + +// 获取员工产量统计 +export function dashboardUserProd(params) { + return request({ + url: "/yh/dashboard/userProd", + method: 'get', + params + }) +} \ No newline at end of file diff --git a/src/components/Business/Price/PriceNewDrawer.vue b/src/components/Business/Price/PriceNewDrawer.vue index c08b77c..d9fcf72 100644 --- a/src/components/Business/Price/PriceNewDrawer.vue +++ b/src/components/Business/Price/PriceNewDrawer.vue @@ -51,7 +51,7 @@ <div class="search-area"> <div class="search-wrapper"> <el-input - v-model="queryParams.priceName" + v-model="queryParams.name" placeholder="搜索工序名称" clearable prefix-icon="el-icon-search" @@ -183,7 +183,7 @@ export default { queryParams: { pageNum: 1, pageSize: 10, - priceName: null, + name: null, category: null, size: null, surface: null, @@ -345,7 +345,8 @@ export default { display: block; position: relative; .condition-box { - height: 100%; + position: relative; + height: calc(100vh - 32px); overflow: auto; padding: 1em; .condition-title { diff --git a/src/views/yh/reportUserProd/index.vue b/src/views/yh/reportUserProd/index.vue index b670834..993ac5e 100644 --- a/src/views/yh/reportUserProd/index.vue +++ b/src/views/yh/reportUserProd/index.vue @@ -2,6 +2,44 @@ <div :class="listConfig.containerClass"> <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-date-picker v-model="queryParams.reportDateRange" @@ -14,14 +52,6 @@ @change="handleQuery" /> </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-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> @@ -65,6 +95,18 @@ <right-toolbar :show-refresh="listConfig.showRefresh" :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"/> </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-column type="selection" width="55" align="center" /> <template v-for="column of showColumns"> @@ -162,6 +204,8 @@ import { } from "@/api/yh/reportUserProd"; import {$listConfig, $showColumns, $showSearch} from '@/utils/mixins'; import FormCol from "@/components/FormCol/index.vue"; +import DeptTreeSelect from '@/components/Business/Dept/DeptTreeSelect.vue'; +import {dashboardUserProd} from '@/api/yh/dashboard.js'; // 默认排序字段 const defaultSort = { @@ -173,7 +217,7 @@ export default { name: "ReportUserProd", mixins: [$showColumns, $listConfig, $showSearch], dicts: ['report_status'], - components: {FormCol}, + components: {FormCol, DeptTreeSelect}, props: { query: { type: Object, @@ -247,7 +291,9 @@ export default { num: [ { required: true, message: "产量不能为空", trigger: "blur" } ] - } + }, + // 统计数据 + statistics: {}, }; }, created() { @@ -259,8 +305,14 @@ export default { this.initSearchColumns(); this.initColumns(); this.getList(); + this.getStatistics(); }, methods: { + getStatistics() { + dashboardUserProd(this.queryParams).then(res => { + this.statistics = res.data; + }) + }, /** 当排序按钮被点击时触发 **/ onSortChange(column) { if (column.order == null) { @@ -300,6 +352,7 @@ export default { handleQuery() { this.queryParams.pageNum = 1; this.getList(); + this.getStatistics(); }, /** 重置按钮操作 */ resetQuery() { @@ -367,3 +420,37 @@ export default { } }; </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> diff --git a/vue.config.js b/vue.config.js index 1ad2881..8d3b276 100644 --- a/vue.config.js +++ b/vue.config.js @@ -127,5 +127,10 @@ module.exports = { }) config.optimization.runtimeChunk('single') }) + + config.plugin('html').tap(args => { + args[0].version = new Date().getTime() + return args + }) } }