From 8fc1138d2f2115121fd15b679ca1a20fc2ba838a Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 02 四月 2026 13:37:40 +0800
Subject: [PATCH] 绩效管理:工时汇总对接MES数据&人员考勤调整
---
src/api/performance/manHour.js | 10 +
/dev/null | 133 ----------------
src/views/performance/manHour/workTimeStatistics.vue | 67 +++++++-
src/views/performance/attendance/index.vue | 39 ----
src/views/performance/competency/index.vue | 8
src/utils/date.js | 59 ++++++
src/views/performance/class/index.vue | 4
src/views/business/inspectionTask/inspection.vue | 94 +++--------
src/views/performance/attendance/components/staffClockInRecord.vue | 37 +++-
9 files changed, 189 insertions(+), 262 deletions(-)
diff --git a/src/api/performance/manHour.js b/src/api/performance/manHour.js
index 2c9d05c..a2ce628 100644
--- a/src/api/performance/manHour.js
+++ b/src/api/performance/manHour.js
@@ -11,6 +11,16 @@
});
}
+// 瀵煎嚭宸ユ椂姹囨��
+export function exportWorkHoursTotal(query) {
+ return request({
+ url: "/auxiliaryOriginalHours/exportWorkHoursTotal",
+ method: "get",
+ params: query,
+ responseType : "blob",
+ });
+}
+
// 鏌ヨ杈呭姪宸ユ椂
export function selectAuxiliaryWorkingHoursDay(query) {
return request({
diff --git a/src/utils/connect.js b/src/utils/connect.js
deleted file mode 100644
index f5899fb..0000000
--- a/src/utils/connect.js
+++ /dev/null
@@ -1,133 +0,0 @@
-import request from '@/utils/request';
-// 鏂板锛氬瓨鍌ㄥ叏灞�涓插彛鍜岃鍙栧櫒瀹炰緥
- let port = null;
- let reader = null;
- let accumulatedData = ""; // 绉诲埌鍏ㄥ眬锛屼究浜庡叧闂椂閲嶇疆
- let weightList = []; // 鐢ㄤ簬瀛樺偍閲嶉噺鍊肩殑鍒楄〃
- export function sendWeightsToBackend(weights) {
- return request({
- url: "/weight/handleWeights",
- method: "POST",
- data: weights,
- });
- }
-
- async function connect() {
- try {
- port = await navigator.serial.requestPort(); // 淇敼涓哄叏灞�鍙橀噺
- await port.open({ baudRate: 9600 });
-
- reader = port.readable.getReader(); // 淇敼涓哄叏灞�鍙橀噺
- const decoder = new TextDecoder();
- accumulatedData = ""; // 閲嶇疆绱Н鏁版嵁
-
- console.log("涓插彛杩炴帴鎴愬姛锛屽紑濮嬫帴鏀舵暟鎹�...");
-
- while (true) {
- const { value, done } = await reader.read();
- if (done) break;
-
- const decodedChunk = decoder.decode(value, { stream: true });
- accumulatedData += decodedChunk;
- console.log("鎺ユ敹鍒版暟鎹潡:", decodedChunk);
-
- processAccumulatedData(accumulatedData);
- }
- } catch (error) {
- console.error("涓插彛閿欒:", error);
- }
- }
- function processAccumulatedData(data) {
-
- if (data.includes("\n")) {
- const messages = data.split("\n");
-
- for (let i = 0; i < messages.length - 1; i++) {
- const completeMessage = messages[i];
- console.log("瀹屾暣娑堟伅:", completeMessage);
- // 鎻愬彇鏁板��
- const weightValue = extractWeightValue(completeMessage);
- if (!isNaN(weightValue)) {
- console.log("鎻愬彇鐨勯噸閲忓��:", weightValue);
- // 灏嗘湁鏁堥噸閲忓�兼坊鍔犲埌鍒楄〃
- weightList.push(weightValue);
-
- // 褰撳垪琛ㄩ暱搴﹁揪鍒� 6 鏃讹紝鍙戦�佹暟鎹埌鍚庣骞舵竻绌哄垪琛�
- if (weightList.length === 6) {
- sendWeightsToBackend({
- weights: weightList
- })
- .then(() => {
- console.log('鏁版嵁鍙戦�佹垚鍔�');
- weightList = [];
- })
- .catch(() => {
- console.log('鍙戦�佸け璐ワ紝淇濈暀鏁版嵁寰呴噸璇�');
- });
- }
- }
- }
-
- accumulatedData = messages[messages.length - 1];
- }
-
- // 鍏朵粬娑堟伅鎷嗗垎绀轰緥淇濇寔涓嶅彉
- /*
- while (accumulatedData.length >= 32) {
- const message = accumulatedData.substring(0, 32);
- accumulatedData = accumulatedData.substring(32);
- handleMessage(message);
- }
- */
-
- /*
- let startIndex = 0;
- while (true) {
- const start = accumulatedData.indexOf(0xAA, startIndex);
- if (start === -1) break;
-
- const end = accumulatedData.indexOf(0x55, start + 1);
- if (end === -1) break;
-
- const message = accumulatedData.substring(start, end + 1);
- accumulatedData = accumulatedData.substring(end + 1);
- handleMessage(message);
- startIndex = start;
- }
- */
- }
-
- // 鏂板鎻愬彇閲嶉噺鏁板�肩殑鏂规硶
- function extractWeightValue(message) {
- // 鍖归厤鏁板�奸儴鍒嗭紝鍙鐞嗘璐熷彿
- const match = message.match(/-?\d+\.?\d*/);
- if (match) {
- return parseFloat(match[0]);
- }
- return NaN;
- }
-
- // 鏂板锛氬叧闂繛鎺ュ嚱鏁�
- async function disconnect() {
- if (!port || !reader) {
- console.log("鏈缓绔嬭繛鎺ワ紝鏃犻渶鍏抽棴");
- return;
- }
-
- try {
- // 鍏堝彇娑堣鍙栧櫒
- await reader.cancel();
- // 鍐嶅叧闂覆鍙�
- await port.close();
- console.log("涓插彛杩炴帴宸插叧闂�");
-
- // 閲嶇疆鍏ㄥ眬鍙橀噺
- port = null;
- reader = null;
- accumulatedData = "";
- } catch (error) {
- console.error("鍏抽棴杩炴帴澶辫触:", error);
- }
- }
-
- export { connect, disconnect,weightList };
\ No newline at end of file
diff --git a/src/utils/date.js b/src/utils/date.js
index 6d2c1a5..1b14b70 100644
--- a/src/utils/date.js
+++ b/src/utils/date.js
@@ -1,3 +1,4 @@
+import dayjs from 'dayjs';
/**
* 鑾峰彇骞存湀鏃�
*/
@@ -58,7 +59,7 @@
* @param date
* @returns {string}
*/
-export function getYearAndMonthAndDaysZTZB(date = new Date()) {
+export function getYearAndMonthAndDaysZTNS(date = new Date()) {
let year = date.getFullYear();
let month = date.getMonth();
let days = date.getDate();
@@ -71,11 +72,61 @@
year++;
}
}
-
month += 1;
month = month < 10 ? '0' + month + '-' : month + '-';
year = year + '-';
days = days < 10 ? '0' + days : days;
-
return (year + month + days);
-}
\ No newline at end of file
+}
+
+/**
+ * 鑾峰彇鏃堕棿鑼冨洿锛�26鍙�-25鍙�
+ * 鍒濆鍖栭粯璁ゆ棩鏈熻寖鍥达細杩戜竴涓湀锛堝綋鍓嶆棩鏈� - 30澶� 鑷� 褰撳墠鏃ユ湡锛�
+ * @param format
+ * @returns {*[]}
+ */
+export function getTimeRange(format = 'YYYY-MM-DD HH:mm:ss') {
+ // 鑾峰彇褰撳墠鏃堕棿
+ const now = dayjs();
+ // 鑾峰彇褰撳墠鏃ユ湡鐨勩�屾棩銆嶏紙1-31锛�
+ const currentDate = now.date();
+
+ let startTime, endTime;
+
+ // 鏍稿績閫昏緫锛氬垽鏂綋鍓嶆棩鏈熸槸鍚﹀ぇ浜�25鍙�
+ if (currentDate > 25) {
+ // 鉁� 鎯呭喌1锛氬綋鍓嶆棩>25 鈫� 褰撴湀26鍙� ~ 娆℃湀25鍙�
+ startTime = now.startOf('month').add(25, 'day'); // 褰撴湀1鍙� +25澶� = 26鍙�
+ endTime = startTime.add(1, 'month').date(25).hour(23)
+ .minute(59)
+ .second(59); // 娆℃湀25鍙凤紙dayjs鑷姩澶勭悊璺ㄥ勾锛�
+ } else {
+ // 鉁� 鎯呭喌2锛氬綋鍓嶆棩鈮�25 鈫� 涓婃湀26鍙� ~ 褰撴湀25鍙�
+ startTime = now.subtract(1, 'month').startOf('month').add(25, 'day'); // 涓婃湀26鍙�
+ endTime = now.date(25).hour(23)
+ .minute(59)
+ .second(59); // 褰撴湀25鍙�
+ }
+
+ // 杩斿洖鏍煎紡鍖栧悗鐨勬椂闂存暟缁�
+ return [startTime.format(format), endTime.format(format)];
+}
+
+/**
+ * 鑾峰彇鐝鏈堜唤
+ * @returns {*}
+ */
+export function getWorkMonth(){
+ // 鑾峰彇褰撳墠鏃堕棿
+ const now = dayjs();
+ // 鑾峰彇褰撳墠鏃ユ湡鐨勩�屾棩銆嶏紙1-31锛�
+ const currentDate = now.date();
+ let workMonth;
+ // 鏍稿績閫昏緫锛氬垽鏂綋鍓嶆棩鏈熸槸鍚﹀ぇ浜�25鍙�
+ if (currentDate > 25) {
+ workMonth = now.add(1, 'month')
+ }else{
+ workMonth = now
+ }
+ return workMonth
+}
diff --git a/src/views/business/inspectionTask/inspection.vue b/src/views/business/inspectionTask/inspection.vue
index 3a80c21..dd99387 100644
--- a/src/views/business/inspectionTask/inspection.vue
+++ b/src/views/business/inspectionTask/inspection.vue
@@ -188,7 +188,7 @@
<el-button :loading="dataAcquisitionLoading" v-if="state == 1" size="small" type="primary"
@click="getDataAcquisitionDevice">鏁版嵁閲囬泦</el-button>
<el-button :type="dataAcquisitionEidtAble ? '' : 'primary'" v-if="state == 1" size="small"
- @click="dataAcquisitionEidtAble = !dataAcquisitionEidtAble,disconnect()">{{ dataAcquisitionEidtAble ? "鍏抽棴缂栬緫" : "缂栬緫鏁伴噰"
+ @click="dataAcquisitionEidtAble = !dataAcquisitionEidtAble">{{ dataAcquisitionEidtAble ? "鍏抽棴缂栬緫" : "缂栬緫鏁伴噰"
}}</el-button>
</div>
</div>
@@ -650,7 +650,6 @@
import html2canvas from "html2canvas";
import { mapGetters } from "vuex";
import viewManHourDia from "@/views/business/inspectionTask/components/viewManHourDia.vue";
-import {connect,disconnect,weightList} from "@/utils/connect";
import {getOneByIfsId,saveOrUpdateProps} from "@/api/business/ifsPartProps.js";
import {getDicts} from "@/api/system/dict/data";
export default {
@@ -704,8 +703,6 @@
sampleName: null,
state: null,
},
- isSerialConnected: false, // 鏂板鐘舵�佸彉閲忥紝涓插彛杩炴帴鐘舵��
- serialPort: null, // 瀛樺偍涓插彛瀵硅薄
id: null,
changeType: null,
insOrder: {},
@@ -996,11 +993,6 @@
beforeDestroy() {
// 鍦ㄧ粍浠堕攢姣佸墠纭繚鍋滄 Worker锛岄伩鍏嶅唴瀛樻硠婕�
this.stopWorker();
- disconnect();
- // 璋冪敤鍓嶅厛鍒ゆ柇鏂规硶鏄惁瀛樺湪锛岄伩鍏嶆姤閿�
- if (this.closeSerialPort) {
- this.closeSerialPort();// 缁勪欢閿�姣佸墠鍏抽棴涓插彛
- }
},
methods: {
validateQuality(){
@@ -1084,9 +1076,6 @@
this.$nextTick(()=>{
this.ifsMaterialPropsVisible = true;
})
- },
- disconnect() {
- return disconnect
},
// 鏂囦欢绠$悊--寮�濮�
getList() {
@@ -1328,58 +1317,32 @@
// 鏁版嵁閲囬泦
getDataAcquisitionDevice() {
- (async () => {
- try {
- // 妫�鏌ラ〉闈腑妫�娴嬮」鏄惁鍖呭惈瀵嗗害
- const hasDensityItem = this.currentSample.insProduct.some(item => {
- // 鍋囪瀵嗗害鐩稿叧鐨勬娴嬮」鍚嶇О鍖呭惈 "瀵嗗害" 鍏抽敭瀛楋紝鍙寜闇�淇敼
- return item.inspectionItem && item.inspectionItem.includes('瀵嗗害');
- });
- if (hasDensityItem) {
- // 妫�鏌ユ槸鍚︽敮鎸� Web Serial API
- if ('serial' in navigator) {
- // 璇锋眰鍙敤涓插彛
- const ports = await navigator.serial.getPorts();
- if (ports.length > 0) {
- await connect();
- } else {
- console.log('娌℃湁鍙敤鐨勪覆鍙�');
- }
- } else {
- console.log('褰撳墠娴忚鍣ㄤ笉鏀寔 Web Serial API');
- }
- }
- } catch (error) {
- console.error('妫�娴嬩覆鍙f椂鍑洪敊:', error);
- }
- })().then(() => {
- let itemIds = [];
- this.currentSample.insProduct.forEach((item) => {
- if (item.inspectionItemType === "1") {
- itemIds.push(item.id);
- }
- });
- const params = {
- entrustCode: this.insOrder.entrustCode,
- lotBatchNo: this.insOrder.lotBatchNo,
- sampleCode: this.currentSample.sampleCode,
- id: this.currentSample.id,
- itemIds: itemIds,
- };
- this.dataAcquisitionLoading = true;
- dataCollection(params).then((res) => {
- this.dataAcquisitionLoading = false;
- if (res.code != 200) {
- return;
- }
- this.dataAcquisitionInfoNew = this.HaveJson(res.data);
- // 瀵规暟閲囧洖鏉ョ殑鍊艰繘琛屽鐞�
- this.handleDataAcquisition(res.data);
- }).catch(err => {
- this.dataAcquisitionLoading = false;
- });
- });
- },
+ let itemIds = [];
+ this.currentSample.insProduct.forEach((item) => {
+ if (item.inspectionItemType === "1") {
+ itemIds.push(item.id);
+ }
+ });
+ const params = {
+ entrustCode: this.insOrder.entrustCode,
+ lotBatchNo: this.insOrder.lotBatchNo,
+ sampleCode: this.currentSample.sampleCode,
+ id: this.currentSample.id,
+ itemIds: itemIds,
+ };
+ this.dataAcquisitionLoading = true;
+ dataCollection(params).then((res) => {
+ this.dataAcquisitionLoading = false;
+ if (res.code != 200) {
+ return;
+ }
+ this.dataAcquisitionInfoNew = this.HaveJson(res.data);
+ // 瀵规暟閲囧洖鏉ョ殑鍊艰繘琛屽鐞�
+ this.handleDataAcquisition(res.data);
+ }).catch(err => {
+ this.dataAcquisitionLoading = false;
+ });
+ },
objectOrder(obj) {
let newkey = Object.keys(obj).sort();
let newObj = {};
@@ -3155,9 +3118,6 @@
goback() {
this.$router.go(-1)
}
- },
- destroyed() {
- disconnect()
},
};
</script>
diff --git a/src/views/performance/attendance/components/staffClockInRecord.vue b/src/views/performance/attendance/components/staffClockInRecord.vue
index 7bdefbd..e2fdaa2 100644
--- a/src/views/performance/attendance/components/staffClockInRecord.vue
+++ b/src/views/performance/attendance/components/staffClockInRecord.vue
@@ -20,14 +20,20 @@
//杩涘嚭闂ㄧ被鍨嬪垪琛�
enterOrExitList:[
{
+ effect:'',
+ type:'success',
label:'杩涢棬',
value:1
},
{
+ effect:'',
+ type:'',
label:'鍑洪棬',
value:2
},
{
+ effect:'',
+ type:'info',
label:'杩�/鍑洪棬',
value:3
}
@@ -311,13 +317,18 @@
return label;
},
formatterEnterOrExitType(value){
- let label = "";
+ let type = {
+ effect:'plain',
+ type:'warning',
+ label:'鏈煡',
+ value:value
+ };
this.enterOrExitList.forEach(item=>{
if(item.value===value){
- label = item.label
+ type = item
}
})
- return label;
+ return type;
},
getDataSourceTypeTag(type) {
const tagMap = {
@@ -353,12 +364,12 @@
:data="tableData"
border
style="width: 100%"
- height="300"
+ max-height="900"
:header-cell-style="{textAlign:'center'}"
:cell-style="{textAlign:'center'}"
>
- <el-table-column type="index" label="搴忓彿" width="60"></el-table-column>
- <el-table-column label="鏄惁绾冲叆鑰冨嫟" prop="enableReport" width="120">
+ <el-table-column fixed="left" type="index" label="搴忓彿" width="60"></el-table-column>
+ <el-table-column fixed="left" label="鏄惁绾冲叆鑰冨嫟" prop="enableReport" width="120">
<template slot-scope="scope">
<el-switch
@change="changeEnableReport(scope.row)"
@@ -368,15 +379,19 @@
</el-switch>
</template>
</el-table-column>
- <el-table-column prop="personCode" label="宸ュ彿" min-width="150" width="150"></el-table-column>
- <el-table-column prop="personName" label="濮撳悕" min-width="150" width="150"></el-table-column>
- <el-table-column prop="deptName" label="閮ㄩ棬鍚嶇О" min-width="150" width="150"></el-table-column>
- <el-table-column prop="cardNumber" label="鍗″彿" min-width="150" width="150"></el-table-column>
+ <el-table-column fixed="left" prop="personCode" label="宸ュ彿" min-width="120" width="120"></el-table-column>
+ <el-table-column fixed="left" prop="personName" label="濮撳悕" min-width="120" width="120"></el-table-column>
+ <el-table-column prop="deptName" label="閮ㄩ棬鍚嶇О" min-width="100" width="100"></el-table-column>
+ <el-table-column prop="cardNumber" label="鍗″彿" min-width="120" width="120" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="enterOrExit" label="杩涘嚭闂ㄧ被鍨�" min-width="100" width="100" >
+ <template slot-scope="scope">
+ <el-tag :type="formatterEnterOrExitType(scope.row.enterOrExit).type" :effect="formatterEnterOrExitType(scope.row.enterOrExit).effect">{{formatterEnterOrExitType(scope.row.enterOrExit).label}}</el-tag>
+ </template>
+ </el-table-column>
<el-table-column prop="swingTime" label="鍒峰崱鏃堕棿" min-width="180" width="180"></el-table-column>
<el-table-column prop="channelName" label="鑰冨嫟鐐归�氶亾鍚嶇О" min-width="180" width="180"></el-table-column>
<el-table-column prop="deviceName" label="鑰冨嫟璁惧鍚嶇О" min-width="150" width="150"></el-table-column>
<el-table-column prop="deviceCode" label="鑰冨嫟璁惧缂栫爜" min-width="150" width="150"></el-table-column>
- <el-table-column prop="enterOrExit" label="杩涘嚭闂ㄧ被鍨�" min-width="150" width="150" :formatter="(row)=>formatterEnterOrExitType(row.enterOrExit)"></el-table-column>
<el-table-column prop="openType" label="寮�闂ㄧ被鍨�" min-width="150" width="150" :formatter="(row)=>formatterAttendanceType(row.openType)"></el-table-column>
<el-table-column prop="isSync" label="鏁版嵁鏉ユ簮" min-width="150" width="150">
<template slot-scope="scope">
diff --git a/src/views/performance/attendance/index.vue b/src/views/performance/attendance/index.vue
index d197b61..d8089c8 100644
--- a/src/views/performance/attendance/index.vue
+++ b/src/views/performance/attendance/index.vue
@@ -225,7 +225,7 @@
syncAttendanceRecord
} from '@/api/performance/attendance'
import {getDicts} from "@/api/system/dict/data";
-import dayjs from 'dayjs';
+import {getTimeRange} from "@/utils/date";
export default {
name: "Attendance",
components: {
@@ -299,7 +299,7 @@
this.selectEnumByCategory()
this.getUserList()
this.getTableHeight();
- this.dateRange = this.getTimeRange()
+ this.dateRange = getTimeRange()
this.resizeHandler = this.debounce(() => {
this.getTableHeight();
}, 200);
@@ -332,35 +332,7 @@
this.dailyTypeList = response.data;
});
},
- /**
- * 鍒濆鍖栭粯璁ゆ棩鏈熻寖鍥达細杩戜竴涓湀锛堝綋鍓嶆棩鏈� - 30澶� 鑷� 褰撳墠鏃ユ湡锛�
- */
- getTimeRange(format = 'YYYY-MM-DD HH:mm:ss') {
- // 鑾峰彇褰撳墠鏃堕棿
- const now = dayjs();
- // 鑾峰彇褰撳墠鏃ユ湡鐨勩�屾棩銆嶏紙1-31锛�
- const currentDate = now.date();
- let startTime, endTime;
-
- // 鏍稿績閫昏緫锛氬垽鏂綋鍓嶆棩鏈熸槸鍚﹀ぇ浜�25鍙�
- if (currentDate > 25) {
- // 鉁� 鎯呭喌1锛氬綋鍓嶆棩>25 鈫� 褰撴湀26鍙� ~ 娆℃湀25鍙�
- startTime = now.startOf('month').add(25, 'day'); // 褰撴湀1鍙� +25澶� = 26鍙�
- endTime = startTime.add(1, 'month').date(25).hour(23)
- .minute(59)
- .second(59); // 娆℃湀25鍙凤紙dayjs鑷姩澶勭悊璺ㄥ勾锛�
- } else {
- // 鉁� 鎯呭喌2锛氬綋鍓嶆棩鈮�25 鈫� 涓婃湀26鍙� ~ 褰撴湀25鍙�
- startTime = now.subtract(1, 'month').startOf('month').add(25, 'day'); // 涓婃湀26鍙�
- endTime = now.date(25).hour(23)
- .minute(59)
- .second(59); // 褰撴湀25鍙�
- }
-
- // 杩斿洖鏍煎紡鍖栧悗鐨勬椂闂存暟缁�
- return [startTime.format(format), endTime.format(format)];
- },
//鍚屾鑰冨嫟璁板綍
confirmSyncAttendance(){
if(!this.syncDateRange || this.syncDateRange.length<2){
@@ -384,7 +356,10 @@
},
//鎵撳紑鍚屾鑰冨嫟璁板綍寮规
openSyncAttendanceDialog(){
- this.syncAttendanceVisible = true
+ this.syncDateRange = getTimeRange()
+ this.$nextTick(()=>{
+ this.syncAttendanceVisible = true
+ })
},
//鍒犻櫎鑰冨嫟璁板綍
confirmRemoveRecord(row){
@@ -575,7 +550,7 @@
},
//閲嶇疆鎸夐挳
resetQuery() {
- this.dateRange = this.getTimeRange();
+ this.dateRange = getTimeRange();
this.queryParams = {
startDate: "",
endDate: "",
diff --git a/src/views/performance/class/index.vue b/src/views/performance/class/index.vue
index f6c52f0..0210486 100644
--- a/src/views/performance/class/index.vue
+++ b/src/views/performance/class/index.vue
@@ -324,6 +324,7 @@
editAnnotationText,
delAnnotationText
} from "@/api/performance/class";
+import {getWorkMonth} from "@/utils/date";
export default {
name: 'Class',
data() {
@@ -332,8 +333,7 @@
userName: "",
laboratory: "",
year: new Date(),
- month: new Date().getMonth() + 1,
- // month:''
+ month: getWorkMonth().month()+1,
},
monthOptions: [
{
diff --git a/src/views/performance/competency/index.vue b/src/views/performance/competency/index.vue
index 92e05bb..defb703 100644
--- a/src/views/performance/competency/index.vue
+++ b/src/views/performance/competency/index.vue
@@ -58,16 +58,18 @@
}"
border
>
- <el-table-column type="index" label="搴忓彿" width="80"></el-table-column>
+ <el-table-column type="index" label="搴忓彿" width="80" fixed="left"></el-table-column>
<el-table-column
prop="userName"
label="浜哄憳鍚嶇О"
min-width="120"
+ fixed="left"
width="120"
></el-table-column>
<el-table-column
prop="postName"
label="宀椾綅"
+ fixed="left"
min-width="120"
width="120"
></el-table-column>
@@ -132,8 +134,10 @@
this.getLevelDict()
this.getTableHeader();
this.getList();
- this.getTableHeight()
this.getPostList()
+ this.$nextTick(()=>{
+ this.getTableHeight()
+ })
},
mounted() {
window.addEventListener("resize", this.getTableHeight);
diff --git a/src/views/performance/manHour/workTimeStatistics.vue b/src/views/performance/manHour/workTimeStatistics.vue
index 422aa61..2bd920d 100644
--- a/src/views/performance/manHour/workTimeStatistics.vue
+++ b/src/views/performance/manHour/workTimeStatistics.vue
@@ -30,27 +30,59 @@
<el-form-item>
<el-button type="primary" size="mini" @click="refreshTable">鏌ヨ</el-button>
<el-button size="mini" @click="refresh">閲嶇疆</el-button>
+ <el-button :loading="downloadLoading" type="success" size="mini" @click="exportWorkHoursTotal">瀵煎嚭</el-button>
</el-form-item>
</el-form>
</div>
</div>
- <limsTable
- :column="tableColumn"
- :table-data="tableData"
- :table-loading="tableLoading"
- :page="page"
+<!-- <limsTable-->
+<!-- :column="tableColumn"-->
+<!-- :table-data="tableData"-->
+<!-- :table-loading="tableLoading"-->
+<!-- :page="page"-->
+<!-- :height="'calc(100vh - 290px)'"-->
+<!-- @pagination="pagination"-->
+<!-- >-->
+<!-- </limsTable>-->
+ <el-table
+ :data="tableData"
+ v-loading="tableLoading"
:height="'calc(100vh - 290px)'"
- @pagination="pagination"
+ :cell-style="{ textAlign: 'center' }"
+ :header-cell-style="{ background: '#f8f8f9', color: '#515a6e', textAlign: 'center' }"
+ border
>
- </limsTable>
+ <el-table-column type="index" label="搴忓彿"></el-table-column>
+ <el-table-column prop="userName" label="濮撳悕" min-width="120"></el-table-column>
+ <el-table-column prop="month" label="鏈堜唤" min-width="120"></el-table-column>
+ <el-table-column label="LIMS">
+ <el-table-column prop="yieldHour" label="浜ч噺宸ユ椂" min-width="120"></el-table-column>
+ <el-table-column prop="subsidiaryHour" label="杈呭姪宸ユ椂" min-width="120"></el-table-column>
+ <el-table-column prop="totalHour" label="鎬诲伐鏃�" min-width="120"></el-table-column>
+ </el-table-column>
+ <el-table-column label="鑰愪笣鍩烳ES">
+ <el-table-column prop="operationPerformanceByNS" label="宸ュ簭缁╂晥" min-width="120"></el-table-column>
+ <el-table-column prop="productPerformanceByNS" label="鎴愬搧缁╂晥" min-width="120"></el-table-column>
+ <el-table-column prop="onsiteInspWageByNS" label="宸℃缁╂晥" min-width="120"></el-table-column>
+ <el-table-column prop="handymanWageByNS" label="鏉傚伐宸ヨ祫" min-width="120"></el-table-column>
+ </el-table-column>
+ <el-table-column label="绉戞妧鍩烳ES">
+ <el-table-column prop="operationPerformanceByKJ" label="宸ュ簭缁╂晥" min-width="120"></el-table-column>
+ <el-table-column prop="productPerformanceByKJ" label="鎴愬搧缁╂晥" min-width="120"></el-table-column>
+ <el-table-column prop="onsiteInspWageByKJ" label="宸℃缁╂晥" min-width="120"></el-table-column>
+ <el-table-column prop="handymanWageByKJ" label="鏉傚伐宸ヨ祫" min-width="120"></el-table-column>
+ </el-table-column>
+ </el-table>
+
</div>
</div>
</template>
<script>
-import { getYearAndMonthAndDays, getYearAndMonthAndDaysZTZB } from "@/utils/date";
+import {transformExcel} from '@/utils/file'
+import { getYearAndMonthAndDays, getWorkMonth } from "@/utils/date";
import limsTable from "@/components/Table/lims-table.vue";
-import { selectAuxiliaryAllByMonth } from "@/api/performance/manHour";
+import { selectAuxiliaryAllByMonth,exportWorkHoursTotal } from "@/api/performance/manHour";
export default {
components: {
limsTable
@@ -58,7 +90,7 @@
data() {
return {
queryParams: {
- month: getYearAndMonthAndDaysZTZB().slice(0, 7),
+ month: getWorkMonth().format('YYYY-MM'),
name: "",
departLims: "",
},
@@ -96,12 +128,25 @@
size: 20,
current: 0,
},
+ downloadLoading: false,
};
},
mounted() {
this.refreshTable();
},
methods: {
+ exportWorkHoursTotal(){
+ this.downloadLoading = true
+ exportWorkHoursTotal(this.queryParams).then(res=>{
+ transformExcel(res, "涓ぉ鑰愪笣璐ㄩ噺閮ㄥ伐鏃舵眹鎬�.xlsx")
+ this.$message.success("瀵煎嚭鎴愬姛")
+ this.$nextTick(()=>{
+ this.downloadLoading = false
+ })
+ }).catch((error)=>{
+ console.error(error)
+ })
+ },
refreshTable() {
this.tableLoading = true;
selectAuxiliaryAllByMonth(this.queryParams)
@@ -115,7 +160,7 @@
},
refresh() {
this.queryParams = {
- month: getYearAndMonthAndDaysZTZB().slice(0, 7),
+ month: getWorkMonth().format('YYYY-MM'),
name: "",
departLims: "",
};
--
Gitblit v1.9.3