From 0e5553e2390bb336e589e5b7f0fa890d59aed735 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期二, 27 十月 2026 01:09:44 +0800
Subject: [PATCH] 统计、绩效模块
---
src/views/project/statistics/performanceStaristics/index.vue | 263 ++++++++++++++++++++++------------------------------
1 files changed, 113 insertions(+), 150 deletions(-)
diff --git a/src/views/project/statistics/performanceStaristics/index.vue b/src/views/project/statistics/performanceStaristics/index.vue
index f31ebae..f2b1ac5 100644
--- a/src/views/project/statistics/performanceStaristics/index.vue
+++ b/src/views/project/statistics/performanceStaristics/index.vue
@@ -1,29 +1,13 @@
<!-- -->
<template>
<div class="app-container">
- <el-form
- :model="queryParams"
- ref="queryForm"
- :inline="true"
- label-width="70px"
- >
- <el-row :gutter="8">
- <el-col :span="6">
- <el-form-item label="涓氬姟浜哄憳" prop="pauserno">
- <el-input
- v-model="queryParams.pauserno"
- placeholder="璇疯緭鍏ュ鍚�"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- </el-col>
- <el-col :span="6">
+ <el-form class="opo-query-form" :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px">
+ <el-row :gutter="4">
+ <!-- <el-col :span="6">
<el-form-item align="left" label="涓氬姟缁�" prop="padeptno">
<el-select
v-model="queryParams.padeptno"
- placeholder="璇烽�夋嫨妗堜緥鐘舵��"
+ placeholder="璇烽�夋嫨閮ㄩ棬銆佷笟鍔$粍"
>
<el-option
v-for="item in deptList"
@@ -33,93 +17,58 @@
</el-option>
</el-select>
</el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="缁╂晥绫诲瀷">
- <el-select
- v-model="queryParams.pabonustype"
- placeholder="璇烽�夋嫨妗堜緥鐘舵��"
- >
- <el-option
- v-for="item in reportlist"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="8">
- <el-col :span="12">
+ </el-col> -->
+ <el-col :span="8">
<el-form-item label="缁熻鏃ユ湡">
- <el-date-picker
- style="width: 100%"
- v-model="selecttime"
- type="monthrange"
- range-separator="鑷�"
- start-placeholder="寮�濮嬫湀浠�"
- end-placeholder="缁撴潫鏈堜唤"
- value-format="yyyy-MM-dd"
- @change="getTimeList"
- >
+ <el-date-picker style="width: 100%" v-model="selecttime" type="monthrange" range-separator="鑷�"
+ start-placeholder="寮�濮嬫湀浠�" end-placeholder="缁撴潫鏈堜唤" value-format="yyyy-MM-dd" @change="getTimeList">
</el-date-picker>
</el-form-item>
</el-col>
-
+ <el-col :span="5">
+ <el-form-item label="缁╂晥绫诲瀷">
+ <el-radio-group v-model="queryParams.pabonustype">
+ <el-radio v-for="item in reporttype" :key="item.value" :label="item.value">{{ item.label }}</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="5">
+ <el-form-item label="缁╂晥浜哄憳" prop="pauserno">
+ <el-input v-model="queryParams.pausername" placeholder="璇疯緭鍏ュ鍚�" clearable size="small"
+ @keyup.enter.native="handleQuery" />
+ </el-form-item>
+ </el-col>
<el-col :span="6">
<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
- >
+ <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-form-item>
</el-col>
</el-row>
</el-form>
+ <el-row :gutter="10" class="mb8">
+ <el-col :span="1.5">
+ <el-button type="warning" plain icon="el-icon-download" size="mini" :loading="exportLoading"
+ @click="handleExport">瀵煎嚭</el-button>
+ </el-col>
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+ </el-row>
+
<!--<el-table v-loading="loading" border :data="donatebaseinfoList"> -->
- <el-table
- v-loading="loading"
- :data="jxidata"
- ref="table"
- border
- max-height="700"
- highlight-current-row
- :summary-method="getSummaries"
- show-summary
- >
+ <el-table v-loading="loading" :data="jxidata" ref="table" border max-height="700" highlight-current-row
+ :summary-method="getSummaries" show-summary>
<el-table-column label="搴忓彿" align="center" prop="id" width="100">
</el-table-column>
-
<el-table-column label="缁熻鏈堜唤" align="center" prop="bonusmonth" />
-
- <el-table-column label="涓氬姟缁�" align="center" prop="deptName">
- </el-table-column>
- <el-table-column label="涓撹亴浜哄憳" align="center" prop="beneficiaryname" />
-
- <el-table-column label="閲戦" align="center" prop="amount" />
-
- <el-table-column
- label="鎿嶄綔"
- align="center"
- class-name="small-padding fixed-width"
- fixed="right"
- >
+ <el-table-column label="绉戝涓氬姟缁�" align="center" prop="deptName"> </el-table-column>
+ <el-table-column label="缁╂晥浜哄憳/鍖婚櫌" align="center" prop="beneficiaryname" />
+ <el-table-column label="缁╂晥閲戦" align="center" prop="amount" :formatter="amountFormatter" />
+ <!-- <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
- <!-- v-if="scope.row.recordstate==2"
- -->
- <el-button size="mini" type="text" icon="el-icon-edit"
- >鏄庣粏</el-button
- >
+ <el-button size="mini" type="text" icon="el-icon-edit">鏄庣粏</el-button>
</template>
- </el-table-column>
+ </el-table-column> -->
</el-table>
<div style="margin: 10px;text-align: right;">
<div>
@@ -140,7 +89,8 @@
listsfeistatistics,
listbxiaostatistics,
listjixstatistics,
- listanlstatistics
+ listanlstatistics,
+ exportPerformanceStatistics
} from "@/api/project/statistics";
import { listUser } from "@/api/project/organization";
@@ -170,10 +120,11 @@
selecttime: "",
reportervalue: "",
- reportlist: [
- { label: "鏈堝害", value: 1 },
- { label: "瀛e害", value: 2 },
- { label: "骞村害", value: 3 }
+ reporttype: [
+ { label: "鍏ㄩ儴", value: "0" },
+ { label: "鏈堝害", value: "68" },
+ { label: "瀛e害", value: "69" },
+ { label: "骞村害", value: "70" }
],
//鐪佸競鍖�
//榛樿鍊艰缃紝鍙负绌�
@@ -212,7 +163,7 @@
shi: "",
qu: ""
},
- deptList:[],
+ deptList: [],
// 閬僵灞�
loading: false,
// 瀵煎嚭閬僵灞�
@@ -239,10 +190,10 @@
daterangeReporttime: [],
// 鏌ヨ鍙傛暟
queryParams: {
- pabonustype:'',
+ pabonustype: "0",
pabegtime: null,
paendtime: null,
- pauserno: null,
+ pausername: "",
padeptno: null,
},
@@ -265,8 +216,8 @@
},
//鐩戝惉灞炴�� 绫讳技浜巇ata姒傚康
computed: {},
- activated() {},
- mounted() {},
+ activated() { },
+ mounted() { },
//鐩戞帶data涓殑鏁版嵁鍙樺寲
watch: {},
@@ -277,48 +228,14 @@
this.queryParams.pabegtime = this.selecttime[0];
this.queryParams.paendtime = this.selecttime[1];
// if (this.queryParams.paendtime == this.queryParams.pabegtime) {
- let num = Number(this.queryParams.paendtime.slice(5, 7));
- if (num < 9) {
- let mon = Number(this.queryParams.paendtime.slice(6, 7));
- this.queryParams.paendtime =
- this.queryParams.paendtime.slice(0, 5) +
- "0" +
- (mon + 1) +
- "-" +
- "01" +
- " " +
- "00" +
- ":" +
- "00" +
- ":" +
- "00";
- }
- // this.queryParams.paendtime=this.queryParams.paendtime.slice(0,5)骞�
- else if (num >= 10) {
- this.queryParams.paendtime =
- this.queryParams.paendtime.slice(0, 5) +
- (num + 1) +
- "-" +
- "01" +
- " " +
- "00" +
- ":" +
- "00" +
- ":" +
- "00";
- } else {
- this.queryParams.paendtime =
- this.queryParams.paendtime.slice(0, 5) +
- "10" +
- "-" +
- "01" +
- " " +
- "00" +
- ":" +
- "00" +
- ":" +
- "00";
- }
+ // 缁撴潫鏃堕棿鍙�"鎵�閫夌粨鏉熸湀鐨勬鏈� 1 鍙�"锛屼互鍖呭惈鏁翠釜缁撴潫鏈堛��
+ // 鍘熷疄鐜版妸鏈堜唤 +1 鍚庣洿鎺ユ嫾瀛楃涓诧紝12 鏈堜細寰楀埌 13 鏈堬紙2026-13-01锛夛紝
+ // MySQL 鎶� Incorrect datetime value锛屽瓨鍌ㄨ繃绋嬬洿鎺� 500銆�
+ this.queryParams.paendtime = this.$moment(this.queryParams.paendtime)
+ .startOf("month")
+ .add(1, "month")
+ .format("YYYY-MM")
+ .concat("-01 00:00:00");
this.queryParams.pabegtime =
this.queryParams.pabegtime + " " + "00" + ":" + "00" + ":" + "00";
// }
@@ -330,7 +247,7 @@
resetArr(Arr) {
var hash = {};
- Arr = Arr.reduce(function(arr, current) {
+ Arr = Arr.reduce(function (arr, current) {
hash[current.reporterno]
? ""
: (hash[current.reporterno] = true && arr.push(current));
@@ -339,15 +256,46 @@
return Arr;
},
+ /** 缁勮鏌ヨ鍙傛暟锛氭湭閫夋嫨缁熻鏃ユ湡鏃舵煡鍏ㄩ儴锛岀哗鏁堢被鍨嬩负绌烘寜鍏ㄩ儴 */
+ buildQueryParams() {
+ const query = { ...this.queryParams };
+ if (!query.pabegtime || !query.paendtime) {
+ // 鏂� SP 榛樿鍙栬繎 6 涓湀锛岃�岀哗鏁� jxrq 鏁版嵁闆嗕腑鍦� 2023-08~2024-01锛岄粯璁や細鏌ヤ笉鍒�
+ query.pabegtime = "2000-01-01 00:00:00";
+ query.paendtime = "2999-12-31 23:59:59";
+ }
+ if (!query.pabonustype) {
+ query.pabonustype = "0";
+ }
+ return query;
+ },
+
/** 鏌ヨ鎹愮尞鍩虹鍒楄〃 */
getList() {
- listjixstatistics(this.queryParams).then(res => {
+ listjixstatistics(this.buildQueryParams()).then(res => {
this.jxidata = res.rows;
this.jxidata.forEach(($obj, $index) => {
$obj.id = $index + 1;
});
- this.total=res.total;
+ this.total = res.total;
});
+ },
+ /** 瀵煎嚭鎸夐挳鎿嶄綔 */
+ handleExport() {
+ const queryParams = this.buildQueryParams();
+ this.$modal
+ .confirm("鏄惁纭瀵煎嚭褰撳墠绛涢�夋潯浠朵笅鐨勭哗鏁堢粺璁℃暟鎹紵")
+ .then(() => {
+ this.exportLoading = true;
+ return exportPerformanceStatistics(queryParams);
+ })
+ .then(response => {
+ this.$download.name(response.msg);
+ this.exportLoading = false;
+ })
+ .catch(() => {
+ this.exportLoading = false;
+ });
},
listDept() {
listDept({}).then(response => {
@@ -372,10 +320,10 @@
this.queryParams = {
- pabonustype:'',
+ pabonustype: "0",
pabegtime: null,
paendtime: null,
- pauserno: null,
+ pausername: "",
padeptno: null
};
this.selecttime = [];
@@ -390,10 +338,24 @@
this.resetForm("queryForm");
this.handleQuery();
},
+ /** 閲戦鏄剧ず锛氫繚鐣欎袱浣嶅皬鏁帮紝0.00 涓嶆樉绀� */
+ formatAmount(value) {
+ if (value === null || value === undefined || value === "") {
+ return "";
+ }
+ const num = Number(value);
+ if (!Number.isFinite(num) || num === 0) {
+ return "";
+ }
+ return num.toFixed(2);
+ },
+ amountFormatter(row, column, cellValue) {
+ return this.formatAmount(cellValue);
+ },
getSummaries(param) {
const { columns, data } = param;
const sums = [];
- var columnnames = ["applymonth", "deptmentName", "username",'deptName'];
+ var columnnames = ["applymonth", "deptmentName", "username", "deptName", "beneficiaryname"];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = "鍚堣";
@@ -406,7 +368,7 @@
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
- sums[index] = values.reduce((prev, curr) => {
+ const total = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
@@ -414,7 +376,8 @@
return prev;
}
}, 0);
- sums[index] = sums[index].toFixed(2); // 淇濈暀2浣嶅皬鏁帮紝瑙e喅灏忔暟鍚堣鍒�;
+ // 鍚堣淇濈暀 2 浣嶅皬鏁帮紱0.00 涓嶆樉绀�
+ sums[index] = total === 0 ? "" : Number(total).toFixed(2);
} else {
sums[index] = "";
}
--
Gitblit v1.9.3