From 9c91c96c4c1dca21670abfa7a0c879a734a888de Mon Sep 17 00:00:00 2001
From: lxp <1928192722@qq.com>
Date: 星期五, 14 三月 2025 20:09:37 +0800
Subject: [PATCH] 工时管理
---
src/api/business/reportPreparation.js | 26
src/components/Table/lims-table.vue | 10
src/utils/request.js | 1
/dev/null | 176 ---
src/views/business/reportPreparation/index.vue | 116 -
src/views/performance/manHour/index.vue | 56
src/views/performance/manHour/work-time-management.vue | 1285 ++++++++++++++++++++++++++
src/views/business/inspectionOrder/index.vue | 1
src/views/performance/manHour/work-time-statistics.vue | 589 ++++++++++++
src/api/business/manHour.js | 150 +++
src/views/performance/manHour/work-time-config.vue | 469 +++++++++
11 files changed, 2,577 insertions(+), 302 deletions(-)
diff --git a/src/api/business/manHour.js b/src/api/business/manHour.js
new file mode 100644
index 0000000..2650a3d
--- /dev/null
+++ b/src/api/business/manHour.js
@@ -0,0 +1,150 @@
+import resquest from '@/utils/request'
+
+export function obtainItemParameterList(params) {
+ return resquest({
+ url: '/laboratoryScope/obtainItemParameterList',
+ method: 'get',
+ params: params
+ })
+}
+
+export function selectAuxiliaryWorkingHours(params) {
+ return resquest({
+ url: '/auxiliaryWorkingHours/selectAuxiliaryWorkingHours',
+ method: 'get',
+ params: params
+ })
+}
+
+
+export function exportOriginalHours(data) {
+ return resquest({
+ url: '/auxiliaryOriginalHours/exportOriginalHours',
+ method: 'post',
+ responseType: 'blob',
+ params: data
+ })
+}
+
+export function selectAuxiliaryCorrectionHours(params) {
+ return resquest({
+ url: '/auxiliaryCorrectionHours/selectAuxiliaryCorrectionHours',
+ method: 'get',
+ params: params
+ })
+}
+
+export function selectAuxiliaryOriginalHours(params) {
+ return resquest({
+ url: '/auxiliaryOriginalHours/selectAuxiliaryOriginalHours',
+ method: 'get',
+ params: params
+ })
+}
+
+export function selectAuxiliaryWorkingHoursDay(params) {
+ return resquest({
+ url: '/auxiliaryWorkingHoursDay/selectAuxiliaryWorkingHoursDay',
+ method: 'get',
+ params: params
+ })
+}
+
+export function selectAuxiliaryOutputWorkingHours(params) {
+ return resquest({
+ url: '/auxiliaryOutputWorkingHours/selectAuxiliaryOutputWorkingHours',
+ method: 'get',
+ params: params
+ })
+}
+
+export function insertAuxiliaryWorkingHoursDay(data) {
+ return resquest({
+ url: '/auxiliaryWorkingHoursDay/insertAuxiliaryWorkingHoursDay',
+ method: 'post',
+ data: data
+ })
+}
+
+
+export function updateAuxiliaryWorkingHoursDay(data) {
+ return resquest({
+ url: '/auxiliaryWorkingHoursDay/updateAuxiliaryWorkingHoursDay',
+ method: 'post',
+ data: data
+ })
+}
+
+export function check(data) {
+ return resquest({
+ url: '/auxiliaryWorkingHoursDay/check',
+ method: 'post',
+ data: data
+ })
+}
+
+export function approve(data) {
+ return resquest({
+ url: '/auxiliaryWorkingHoursDay/approve',
+ method: 'post',
+ data: data
+ })
+}
+
+export function collectWorkingHours(data) {
+ return resquest({
+ url: '/auxiliaryOutputWorkingHours/collectWorkingHours',
+ method: 'post',
+ data: data
+ })
+}
+
+export function selectshiftByUser(params) {
+ return resquest({
+ url: '/auxiliaryWorkingHoursDay/selectshiftByUser',
+ method: 'get',
+ params: params
+ })
+}
+
+export function selectAuxiliaryWorkingHoursByNumber(params) {
+ return resquest({
+ url: '/auxiliaryWorkingHoursDay/selectAuxiliaryWorkingHoursByNumber',
+ method: 'get',
+ params: params
+ })
+}
+
+export function exportWorkingHours(params) {
+ return resquest({
+ url: '/auxiliaryOutputWorkingHours/exportWorkingHours',
+ method: 'get',
+ responseType: 'blob',
+ params: params
+ })
+}
+
+export function deleteAuxiliaryWorkingHours(params) {
+ return resquest({
+ url: '/auxiliaryWorkingHours/deleteAuxiliaryWorkingHours',
+ method: 'post',
+ params: params
+ })
+}
+
+export function upAuxiliaryWorkingHours(data) {
+ return resquest({
+ url: '/auxiliaryWorkingHours/upAuxiliaryWorkingHours',
+ method: 'post',
+ data: data
+ })
+}
+
+
+export function insertAuxiliaryWorkingHours(data) {
+ return resquest({
+ url: '/auxiliaryWorkingHours/insertAuxiliaryWorkingHours',
+ method: 'post',
+ data: data
+ })
+}
diff --git a/src/api/business/reportPreparation.js b/src/api/business/reportPreparation.js
index 7bbc9f3..4537467 100644
--- a/src/api/business/reportPreparation.js
+++ b/src/api/business/reportPreparation.js
@@ -51,7 +51,7 @@
export function getUserList(params) {
return resquest({
- url: '/approveConfig/getUserList',
+ url: '/performanceShift/getUserList',
method: 'get',
params: params
})
@@ -97,14 +97,6 @@
})
}
-export function downReport(params) {
- return resquest({
- url: '/insReport/downReport',
- method: 'get',
- params: params
- })
-}
-
export function upReportUrl(data) {
return resquest({
url: '/insReport/upReportUrl',
@@ -117,7 +109,7 @@
return resquest({
url: '/insReport/examineReport',
method: 'post',
- data: data
+ params: data
})
}
@@ -125,7 +117,7 @@
return resquest({
url: '/insReport/ratifyReport',
method: 'post',
- data: data
+ params: data
})
}
@@ -162,4 +154,14 @@
method: 'get',
params: params
})
-}
\ No newline at end of file
+}
+
+
+ export function downReport(params) {
+ return resquest({
+ url: '/insReport/downReport',
+ method: 'get',
+ params: params,
+ responseType: 'blob'
+ })
+ }
\ No newline at end of file
diff --git a/src/components/Table/lims-table.vue b/src/components/Table/lims-table.vue
index 198e6ee..999ce8b 100644
--- a/src/components/Table/lims-table.vue
+++ b/src/components/Table/lims-table.vue
@@ -319,7 +319,7 @@
props: {
isSelection: {
type: Boolean,
- default: false,
+ default: undefined,
},
height: {
type: String,
@@ -387,7 +387,7 @@
},
rowKey: {
type: String,
- default: undefined,
+ default: "id",
},
page: {
type: Object,
@@ -408,9 +408,9 @@
};
},
watch: {
- column(val) {
- this.doLayout();
- },
+ // column(val) {
+ // this.doLayout();
+ // },
},
mounted() {
this.calculateSpanInfo();
diff --git a/src/utils/request.js b/src/utils/request.js
index 1a89ee8..f35c0ba 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -76,6 +76,7 @@
s_url === requestObj.url
) {
const message = "鏁版嵁姝e湪澶勭悊锛岃鍕块噸澶嶆彁浜�";
+ console.log('閲嶅鐨勮姹�',sessionObj.url);
console.warn(`[${s_url}]: ` + message);
return Promise.reject(new Error(message));
} else {
diff --git a/src/views/business/inspectionOrder/index.vue b/src/views/business/inspectionOrder/index.vue
index 435168b..52e18dc 100644
--- a/src/views/business/inspectionOrder/index.vue
+++ b/src/views/business/inspectionOrder/index.vue
@@ -1428,6 +1428,7 @@
insSampleId: row.insSampleId,
entrustCode: row.entrustCode,
sampleCode: row.sampleCode,
+ inspectionItemSubclass: row.inspectionItemSubclass,
};
this.$axios
.post(this.$api.insOrder.viewDetails, data, {
diff --git a/src/views/business/reportPreparation/index.vue b/src/views/business/reportPreparation/index.vue
index 1512399..ecb205b 100644
--- a/src/views/business/reportPreparation/index.vue
+++ b/src/views/business/reportPreparation/index.vue
@@ -244,37 +244,6 @@
</el-dropdown-menu>
</el-dropdown>
</template>
- <template>
- <el-button
- size="small"
- type="primary"
- @click="handleDowns"
- :loading="outLoading"
- style="margin-right: 6px"
- >鎵归噺涓嬭浇</el-button
- >
- <el-button
- size="small"
- type="primary"
- @click="openBatchUploadDia()"
- :loading="inLoading"
- >鎵归噺涓婁紶</el-button
- >
- <el-button
- size="small"
- type="primary"
- @click="oneClickApproval()"
- :loading="approvalLoading"
- >涓�閿鎵�</el-button
- >
- <el-button
- size="small"
- type="primary"
- @click="openApprovalConfig()"
- :loading="approvalConfigLoading"
- >瀹℃壒绛惧悕閰嶇疆</el-button
- >
- </template>
</div>
<!-- <div class="btns">
<el-button size="small" type="primary" @click="handleDowns" :loading="outLoading" style="margin-right: 16px;">鎵归噺涓嬭浇</el-button>
@@ -316,6 +285,8 @@
</p>
</div>
<lims-table
+ :handleSelectionChange="handleSelectionChange"
+ isSelection
:tableData="tableData"
:column="column"
:tableLoading="tableLoading"
@@ -850,15 +821,18 @@
downAll,
getBatchApprovalProgress,
getReportCountInfo,
- downReport,
upReportUrl,
ratifyReport,
writeReport,
examineReport,
downLoad,
getReportInfo,
- getURL
+ getURL,
+ batchApprovalReport,
+ downReport,
} from "../../../api/business/reportPreparation";
+
+import { getToken } from "@/utils/auth";
export default {
components: {
@@ -1129,11 +1103,10 @@
{
name: "涓婁紶",
type: "upload",
- url: "/file/attachmentType/upload",
+ url: "/insReport/inReport",
data: (row) => {
return {
id: row.id,
- type: 1,
};
},
uploadIdFun: (row) => {
@@ -1238,12 +1211,13 @@
},
computed: {
headers() {
+ let token = getToken();
return {
- token: sessionStorage.getItem("token"),
+ authorization: token,
};
},
action() {
- return "";
+ return this.javaApi + "/insReport/upAll";
},
},
created() {
@@ -1332,7 +1306,7 @@
},
// 鎾ゅ洖 寮规
withdraw(row) {
- getLaboratoryByReportId(row.id).then((res) => {
+ getLaboratoryByReportId({ id: row.id }).then((res) => {
this.laboratorys = res.data;
this.reportId = row.id;
this.withdrawDialogVisible = true;
@@ -1350,6 +1324,7 @@
withdraw(data).then((res) => {
if (res.code == 200) {
this.$message.success("鎾ゅ洖鎴愬姛");
+ this.laboratory = [];
this.withdrawDialogVisible = false;
this.refresh();
}
@@ -1400,6 +1375,7 @@
getAuthorizedPerson() {
getUserList()
.then((res) => {
+ console.log('res',res);
this.personList = res.data;
})
.catch((error) => {
@@ -1540,6 +1516,10 @@
handleChange(arr) {
this.mutiList = arr;
},
+ handleSelectionChange(val) {
+ this.mutiList = val;
+ console.log(`output->val`, val);
+ },
handleDowns() {
if (this.mutiList.length == 0) {
this.$message.error("璇烽�夋嫨鎶ュ憡");
@@ -1583,14 +1563,8 @@
downAll({ ids: str }).then((res) => {
this.outLoading = false;
this.$message.success("瀵煎嚭鎴愬姛");
- // const blob = new Blob([res],{ type: 'application/octet-stream' });
- // const url = URL.createObjectURL(blob);
- // const link = document.createElement('a');
- // link.href = url;
- // link.download = '鎶ュ憡.zip';
- // link.click();
const link = document.createElement("a");
- link.href = this.javaApi + res.message;
+ link.href = this.javaApi + res.data;
link.target = "_blank";
document.body.appendChild(link);
link.click();
@@ -1719,27 +1693,21 @@
console.log(`output->row`, row);
},
download(row) {
- getReportInfo({ id: row.id, type: 1,suffix:'.docx' }).then((response) => {
- if (response.data && response.data.contentType) {
- downLoad({ id: row.id, type: 1, code: row.code,suffix: '.docx' })
- .then((res) => {
- // 鑾峰彇鏂囦欢鍚�
- const blob = new Blob([res], { type: response.data.contentType });
- const url = URL.createObjectURL(blob);
- let link = document.createElement("a");
- link.href = url;
- link.download = row.code;
- document.body.appendChild(link);
- link.click();
- document.body.removeChild(link);
- URL.revokeObjectURL(url);
- })
- .catch((error) => {
- this.$message.error(error);
- });
- } else {
- this.$message.error("鏈壘鍒版枃浠�");
- }
+ downReport({ id: row.id, type: 0 }).then((res) => {
+ let rowUrl = row.urlS ? row.urlS : row.url;
+ let fileName =
+ rowUrl.indexOf("_") == -1
+ ? rowUrl.split("/")[2]
+ : rowUrl.split("_")[1];
+ console.log(fileName);
+ const blod = new Blob([res], { type: "application/octet-stream" });
+ const url = URL.createObjectURL(blod);
+ const link = document.createElement("a");
+ link.href = url;
+ link.target = "_blank";
+ link.download = fileName;
+ document.body.appendChild(link);
+ link.click();
});
},
// 杩樺師鎿嶄綔
@@ -1750,7 +1718,7 @@
type: "warning",
})
.then(() => {
- upReportUrl({ id: row.id,type:1 }).then((res) => {
+ upReportUrl({ id: row.id, type: 1 }).then((res) => {
if (res.code === 200) {
this.$message.success("鎿嶄綔鎴愬姛");
this.refreshTable("page");
@@ -1763,7 +1731,7 @@
this.currentInfo = row;
let fileName = row.urlS === null || row.urlS === "" ? row.url : row.urlS;
fileName = fileName.replace("/word/", "");
- const userName = JSON.parse(localStorage.getItem("user")).name;
+ const userName = this.$store.state.user.name;
this.option = {
url: this.javaApi + "/word/" + fileName,
isEdit: false,
@@ -1799,17 +1767,11 @@
},
handleApprove(row) {
this.currentInfo = row;
- getURL().then(res => {
-
- })
-
-
-
let fileName = row.urlS === null || row.urlS === "" ? row.url : row.urlS;
fileName = fileName.replace("/word/", "");
const userName = this.$store.state.user.name;
this.option = {
- url: javaApi + "/word/" + fileName,
+ url: this.javaApi + "/word/" + fileName,
isEdit: false,
fileType: "docx",
title: fileName,
@@ -1895,8 +1857,8 @@
this.loadingApproveReason = true;
examineReport({
id: this.currentInfo.id,
- isRatify: 0,
- ratifyTell: this.reason,
+ isExamine: 0,
+ examineTell: this.reason,
})
.then((res) => {
this.loadingApproveReason = false;
diff --git a/src/views/performance/manHour/index.vue b/src/views/performance/manHour/index.vue
index 9955ba5..f7face2 100644
--- a/src/views/performance/manHour/index.vue
+++ b/src/views/performance/manHour/index.vue
@@ -1,27 +1,14 @@
<template>
- <div class="work-time-management">
+ <div class="work-time-management bg-1">
<div style="text-align: left">
- <el-radio-group
- v-model="currentComponent"
- size="small"
- style="margin-top: 16px; margin-left: 16px"
- >
- <el-radio-button
- v-if="checkPermi(['performance:manHour:workTimeStatistics'])"
- label="workTimeStatistics"
- >
- 宸ユ椂姹囨��
+ <el-radio-group v-model="currentComponent" size="small" style="margin-top: 16px;margin-bottom: 16px;">
+ <el-radio-button label="workTimeStatistics">
+ 宸ユ椂缁熻
</el-radio-button>
- <el-radio-button
- v-if="checkPermi(['performance:manHour:workTimeManagement'])"
- label="workTimeManagement"
- >
+ <el-radio-button label="workTimeManagement" >
鏃ュ伐鏃剁鐞�
</el-radio-button>
- <el-radio-button
- v-if="checkPermi(['performance:manHour:workTimeConfig'])"
- label="workTimeConfig"
- >
+ <el-radio-button label="workTimeConfig">
杈呭姪宸ユ椂閰嶇疆
</el-radio-button>
</el-radio-group>
@@ -31,26 +18,31 @@
</template>
<script>
-import workTimeStatistics from "./workTimeStatistics.vue";
-import workTimeManagement from "./workTimeManagement.vue";
-import workTimeConfig from "./workTimeConfig.vue";
-import { checkPermi } from "@/utils/permission"; // 鏉冮檺鍒ゆ柇鍑芥暟
+import workTimeStatistics from '../manHour/work-time-statistics.vue'
+import workTimeManagement from '../manHour/work-time-management.vue'
+import workTimeConfig from '../manHour/work-time-config.vue'
export default {
components: {
workTimeStatistics,
workTimeManagement,
- workTimeConfig,
+ workTimeConfig
},
- created() {},
+ created() {
+ this.currentComponent = 'workTimeStatistics'
+ },
data() {
- return {
- currentComponent: "workTimeStatistics",
- };
+ return{
+ currentComponent:'workTimeStatistics',
+ selectAuxiliaryOriginalHours:false,
+ selectAuxiliaryOutputWorkingHours:false,
+ insertAuxiliaryWorkingHours:false
+ }
},
methods: {
- checkPermi,
- },
-};
+ }
+}
</script>
-<style scoped></style>
+<style scoped>
+
+</style>
diff --git a/src/views/performance/manHour/work-time-config.vue b/src/views/performance/manHour/work-time-config.vue
new file mode 100644
index 0000000..abe1b42
--- /dev/null
+++ b/src/views/performance/manHour/work-time-config.vue
@@ -0,0 +1,469 @@
+<template>
+ <div class="work-time-config bg-1">
+ <div class="search">
+ <div class="search_thing">
+ <div class="search_label">缂栧彿锛�</div>
+ <div class="search_input">
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="entity.number"
+ @keyup.enter.native="refreshTable()"
+ ></el-input>
+ </div>
+ </div>
+ <div class="search_thing">
+ <div class="search_label">瀹為獙瀹わ細</div>
+ <el-select
+ v-model="entity.laboratory"
+ placeholder="鍏ㄩ儴"
+ size="small"
+ @change="refreshTable()"
+ clearable
+ >
+ <el-option
+ v-for="item in laboratoryList"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </div>
+ <div class="search_thing">
+ <div class="search_label">閮ㄩ棬锛�</div>
+ <div class="search_input">
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="entity.department"
+ @keyup.enter.native="refreshTable()"
+ ></el-input>
+ </div>
+ </div>
+ <div class="search_thing" style="padding-left: 30px">
+ <el-button size="small" @click="refresh()">閲� 缃�</el-button>
+ <el-button size="small" type="primary" @click="refreshTable()"
+ >鏌� 璇�</el-button
+ >
+ </div>
+ <el-button
+ size="small"
+ type="primary"
+ style="position: absolute; right: 50px"
+ @click="openAdd()"
+ >鏂� 澧�</el-button
+ >
+ </div>
+ <div class="table">
+ <!-- <ValueTable ref="ValueTable0"
+ :url="$api.auxiliaryWorkingHours.selectAuxiliaryWorkingHours" :upUrl="$api.auxiliaryWorkingHours.upAuxiliaryWorkingHours"
+ :delUrl="$api.auxiliaryWorkingHours.deleteAuxiliaryWorkingHours" :componentData="componentData" :key="upIndex" /> -->
+ <lims-table
+ :tableData="tableData"
+ :column="column"
+ :tableLoading="tableLoading"
+ :height="'calc(100vh - 270px)'"
+ :page="page"
+ @pagination="pagination"
+ ></lims-table>
+ </div>
+
+ <!-- 鏂板 缂栬緫-->
+ <el-dialog
+ :title="title"
+ :visible.sync="dialogVisible"
+ width="30%"
+ :before-close="handleClose"
+ >
+ <el-form
+ :model="formData"
+ label-position="right"
+ :rules="rules"
+ ref="form"
+ label-width="120px"
+ class="demo-form"
+ >
+ <el-form-item label="缂栧彿" prop="number">
+ <el-input
+ v-model="formData.number"
+ size="mini"
+ style="width: 100%"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="杈呭姪椤圭洰鍚嶇О" prop="auxiliaryProject">
+ <el-input
+ v-model="formData.auxiliaryProject"
+ size="mini"
+ style="width: 100%"
+ ></el-input>
+ </el-form-item>
+
+ <el-form-item label="瀹為獙瀹�" prop="laboratory">
+ <el-select
+ v-model="formData.laboratory"
+ clearable
+ placeholder="璇烽�夋嫨"
+ size="mini"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="item in laboratoryList"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value+''"
+ ></el-option>
+ </el-select>
+ </el-form-item>
+
+ <el-form-item label="鍗曚綅" prop="unit">
+ <el-select
+ v-model="formData.unit"
+ clearable
+ placeholder="璇烽�夋嫨"
+ size="mini"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="item in utilList"
+ :key="item.dictValue"
+ :label="item.dictLabel"
+ :value="item.dictValue"
+ ></el-option>
+ </el-select>
+ </el-form-item>
+
+ <el-form-item label="鏍稿噯宸ユ椂" prop="approvedWorkingHour">
+ <el-input
+ v-model="formData.approvedWorkingHour"
+ size="mini"
+ style="width: 100%"
+ ></el-input>
+ </el-form-item>
+
+ <el-form-item label="澶囨敞">
+ <el-input
+ v-model="formData.remarks"
+ size="mini"
+ style="width: 100%"
+ ></el-input>
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" @click="submitForm('form')"
+ >鎻愪氦</el-button
+ >
+ <el-button @click="handleClose">鍙栨秷</el-button>
+ </el-form-item>
+ </el-form>
+ </el-dialog>
+ </div>
+</template>
+
+ <script>
+import limsTable from "@/components/Table/lims-table.vue";
+import {
+ selectAuxiliaryWorkingHours,
+ obtainItemParameterList,
+ deleteAuxiliaryWorkingHours,
+ upAuxiliaryWorkingHours,
+ insertAuxiliaryWorkingHours
+} from "../../../api/business/manHour";
+import { getYearAndMonthAndDays } from "../../../utils/date";
+
+import { getDicts } from "@/api/system/dict/data";
+import { number } from "echarts";
+export default {
+ components: {
+ limsTable,
+ },
+ data() {
+ return {
+ rules: {
+ number: [{ required: true, message: "璇疯緭鍏ョ紪鍙�", trigger: "blur" }],
+ auxiliaryProject: [
+ { required: true, message: "璇疯緭鍏ヨ緟鍔╅」鐩悕绉�", trigger: "blur" },
+ ],
+ laboratory: [
+ { required: true, message: "璇烽�夋嫨瀹為獙瀹�", trigger: "change" },
+ ],
+ unit: [{ required: true, message: "璇烽�夋嫨鍗曚綅", trigger: "change" }],
+
+ approvedWorkingHour: [
+ { required: true, message: "璇疯緭鍏ユ牳鍑嗗伐鏃�", trigger: "blur" },
+ ],
+ },
+ dialogVisible: false,
+ formData: {
+ id: null,
+ number: null,
+ auxiliaryProject: null,
+ laboratory: '',
+ unit: '',
+ approvedWorkingHour: null,
+ remarks: null,
+ },
+ title: "",
+ utilList: [],
+ tableData: [],
+ column: [
+ {
+ label: "缂栧彿",
+ prop: "number",
+ },
+ {
+ label: "杈呭姪椤圭洰鍚嶇О",
+ prop: "auxiliaryProject",
+ },
+ {
+ dataType: "tag",
+ label: "瀹為獙瀹�",
+ prop: "laboratory",
+ formatData: (params) => {
+ let farmat = "";
+ let list = this.laboratoryList.filter(
+ (item) => item.value == Number(params)
+ );
+ if (list.length > 0) {
+ farmat = list[0].label;
+ }
+ return farmat;
+ },
+ formatType: () => {
+ return "success";
+ },
+ },
+ {
+ label: "鍗曚綅",
+ prop: "unit",
+ dataType: "tag",
+ formatData: (params) => {
+ let farmat = "";
+ let list = this.utilList.filter((item) => item.dictValue == params);
+ if (list.length > 0) {
+ farmat = list[0].dictLabel;
+ }
+ return farmat;
+ },
+ formatType: () => {
+ return "primary";
+ },
+ },
+ {
+ label: "鏍稿噯宸ユ椂",
+ prop: "approvedWorkingHour",
+ },
+ {
+ label: "閮ㄩ棬",
+ prop: "department",
+ },
+ {
+ label: "澶囨敞",
+ prop: "remarks",
+ },
+ {
+ dataType: "action",
+ fixed: "right",
+ label: "鎿嶄綔",
+ operation: [
+ {
+ name: "缂栬緫",
+ type: "text",
+ clickFun: (row) => {
+ this.openAdd(row);
+ },
+ },
+ {
+ name: "鍒犻櫎",
+ type: "text",
+ clickFun: (row) => {
+ this.del(row);
+ },
+ },
+ ],
+ },
+ ],
+ tableLoading: false,
+ page: {
+ current: 1,
+ size: 20,
+ total: 0,
+ },
+ entity: {
+ number: null,
+ department: null,
+ laboratory: null,
+ },
+ entityCopy: {},
+ upIndex: 0,
+ laboratoryList: [],
+ partList: [],
+ addPower: true,
+ };
+ },
+ created() {},
+ mounted() {
+ this.entityCopy = this.HaveJson(this.entity);
+ this.obtainItemParameterList();
+ this.selectEnumByCategoryForUnit();
+ this.getData();
+ },
+ methods: {
+ getData() {
+ this.tableLoading = true;
+ this.page.total = 0;
+ selectAuxiliaryWorkingHours({ ...this.page, ...this.entity }).then(
+ (res) => {
+ this.tableData = res.data.records;
+ this.page.total = res.data.total;
+ this.tableLoading = false;
+ }
+ );
+ },
+ submitForm(formName) {
+ this.$refs[formName].validate((valid) => {
+ if (valid) {
+ if (this.formData.id) {
+ upAuxiliaryWorkingHours(this.formData).then((res) => {
+ this.$message({
+ type: "success",
+ message: "鎿嶄綔鎴愬姛!",
+ });
+ this.refreshTable();
+ this.dialogVisible = false;
+ });
+ this.dialogVisible = false;
+ } else {
+ insertAuxiliaryWorkingHours(this.formData).then((res) => {
+ this.$message({
+ type: "success",
+ message: "鎿嶄綔鎴愬姛!",
+ });
+ this.refreshTable();
+ this.dialogVisible = false;
+ });
+ }
+ } else {
+ return false;
+ }
+ });
+ },
+ resetForm(formName) {
+ this.$refs[formName].resetFields();
+ },
+ del(row) {
+ console.log(row);
+ this.$confirm("姝ゆ搷浣滃皢姘镐箙鍒犻櫎, 鏄惁缁х画?", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ }).then(() => {
+ deleteAuxiliaryWorkingHours({id:row.id}).then((res) => {
+ this.$message({
+ type: "success",
+ message: "鍒犻櫎鎴愬姛!",
+ });
+ this.refreshTable();
+ });
+ });
+ },
+ refresh() {
+ this.entity = this.HaveJson(this.entityCopy);
+ this.upIndex++;
+ },
+ refreshTable() {
+ this.getData();
+ },
+ pagination({ page, limit }) {
+ this.page.current = page;
+ this.page.size = limit;
+ this.refreshTable();
+ },
+ openAdd(row) {
+ console.log(row);
+ console.log(this.laboratoryList);
+ if (row) {
+ this.title = "缂栬緫";
+ this.formData.id = row.id;
+ this.formData.number = row.number;
+ this.formData.auxiliaryProject = row.auxiliaryProject;
+ this.formData.laboratory = row.laboratory;
+ this.formData.unit = row.unit;
+ this.formData.approvedWorkingHour = row.approvedWorkingHour;
+ this.formData.remarks = row.remarks;
+ } else {
+ this.title = "鏂板";
+ }
+ this.dialogVisible = true;
+ },
+ obtainItemParameterList() {
+ obtainItemParameterList().then((res) => {
+ let data = [];
+ res.data.forEach((a) => {
+ data.push({
+ label: a.laboratoryName,
+ value: a.id,
+ });
+ });
+ this.laboratoryList = data;
+ });
+ },
+ handleClose() {
+ this.formData = {
+ id: null,
+ number: null,
+ auxiliaryProject: null,
+ laboratory: '',
+ unit: '',
+ approvedWorkingHour: null,
+ remarks: null,
+ };
+ this.resetForm("form");
+ this.dialogVisible = false;
+ console.log(7898,this.formData);
+ },
+ selectEnumByCategoryForUnit() {
+ getDicts("sys_unit").then((res) => {
+ this.utilList = res.data;
+ });
+ },
+ },
+};
+</script>
+
+ <style scoped>
+.work-time-config {
+ height: 100%;
+}
+.search {
+ background-color: #fff;
+ height: 80px;
+ display: flex;
+ align-items: center;
+}
+
+.search_thing {
+ width: 250px;
+ display: flex;
+ align-items: center;
+}
+
+.search_label {
+ width: 70px;
+ font-size: 14px;
+ text-align: right;
+}
+
+.search_input {
+ width: calc(100% - 70px);
+}
+.table {
+ margin-top: 10px;
+ background-color: #fff;
+ width: calc(100% - 40px);
+ height: calc(100% - 60px - 80px - 10px - 24px);
+ padding: 20px;
+}
+</style>
+
\ No newline at end of file
diff --git a/src/views/performance/manHour/work-time-management.vue b/src/views/performance/manHour/work-time-management.vue
new file mode 100644
index 0000000..df4bd08
--- /dev/null
+++ b/src/views/performance/manHour/work-time-management.vue
@@ -0,0 +1,1285 @@
+<template>
+ <div class="work-time-management">
+ <div class="search">
+ <div class="search_thing" style="width: 200px">
+ <div class="search_label">鏄熸湡锛�</div>
+ <el-select
+ v-model="entity.weekDay"
+ placeholder="鍏ㄩ儴"
+ size="small"
+ @change="refreshTable()"
+ clearable
+ >
+ <el-option
+ v-for="item in weekList"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </div>
+ <div class="search_thing" style="width: 390px">
+ <div class="search_label" style="width: 90px">鏃堕棿鑼冨洿锛�</div>
+ <div class="search_input">
+ <el-date-picker
+ style="width: 100%"
+ v-model="entity.dateTime"
+ size="small"
+ type="daterange"
+ range-separator="鑷�"
+ format="yyyy-MM-dd"
+ value-format="yyyy-MM-dd"
+ start-placeholder="寮�濮嬫棩鏈�"
+ end-placeholder="缁撴潫鏃ユ湡"
+ @change="refreshTable()"
+ clearable
+ >
+ </el-date-picker>
+ </div>
+ </div>
+ <!-- 浠ヤ笅杩欎袱涓负缁勯暱瑙掕壊鐗规湁鐨� -->
+ <div class="search_thing" style="width: 200px">
+ <div class="search_label">鍚嶅瓧锛�</div>
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="entity.name"
+ @keyup.enter.native="refreshTable()"
+ ></el-input>
+ </div>
+ <div
+ class="search_thing"
+ style="width: 200px"
+ v-if="currentTable == 'ValueTable0'"
+ >
+ <div class="search_label">鐘舵�侊細</div>
+ <el-select
+ v-model="entity.state"
+ placeholder="鍏ㄩ儴"
+ size="small"
+ @change="refreshTable()"
+ >
+ <el-option
+ v-for="item in stateList"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </div>
+ <div class="search_thing" style="padding-left: 30px; width: 100px">
+ <el-button size="small" @click="refresh()">閲� 缃�</el-button>
+ <el-button size="small" type="primary" @click="refreshTable()"
+ >鏌� 璇�</el-button
+ >
+ </div>
+ </div>
+ <div
+ style="
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-top: 10px;
+ "
+ >
+ <el-radio-group v-model="currentTable" size="small" :key="'111'">
+ <el-radio-button label="ValueTable0"> 杈呭姪宸ユ椂 </el-radio-button>
+ <el-radio-button label="ValueTable1"> 浜ч噺宸ユ椂 </el-radio-button>
+ </el-radio-group>
+ <div style="display: flex; align-items: center">
+ <p style="font-size: 14px; margin-right: 30px">
+ 鎬诲伐鏃舵眹鎬伙細<span
+ style="font-size: 16px; color: #3a7bfa"
+ v-if="totalInfo"
+ >{{
+ totalInfo["浜ч噺宸ユ椂姹囨��"] + totalInfo["杈呭姪宸ユ椂姹囨��"]
+ ? Number(
+ totalInfo["浜ч噺宸ユ椂姹囨��"] + totalInfo["杈呭姪宸ユ椂姹囨��"]
+ ).tofixed(4)
+ : 0
+ }}</span
+ > 浜ч噺宸ユ椂姹囨�伙細<span
+ style="font-size: 16px; color: #3a7bfa"
+ v-if="totalInfo"
+ >{{
+ totalInfo["浜ч噺宸ユ椂姹囨��"]
+ ? Number(totalInfo["浜ч噺宸ユ椂姹囨��"]).tofixed(4)
+ : 0
+ }}</span
+ > 杈呭姪宸ユ椂姹囨�伙細<span
+ style="font-size: 16px; color: #3a7bfa"
+ v-if="totalInfo"
+ >{{
+ totalInfo["杈呭姪宸ユ椂姹囨��"]
+ ? Number(totalInfo["杈呭姪宸ユ椂姹囨��"]).tofixed(4)
+ : 0
+ }}</span
+ >
+ </p>
+ <el-button
+ size="small"
+ type="primary"
+ @click="openAdd"
+ v-show="currentTable == 'ValueTable0'"
+ >褰曞叆鏁版嵁</el-button
+ >
+ <el-button
+ size="small"
+ type="primary"
+ @click="handleOut"
+ :loading="outLoading"
+ >瀵� 鍑�</el-button
+ >
+ <el-button
+ size="small"
+ type="primary"
+ v-show="currentTable == 'ValueTable0'"
+ @click="openBatchCheck(0)"
+ >鎵归噺瀹℃牳</el-button
+ >
+ <el-button
+ size="small"
+ type="primary"
+ v-show="currentTable == 'ValueTable0'"
+ @click="openBatchCheck(1)"
+ >鎵归噺鎵瑰噯</el-button
+ >
+ </div>
+ </div>
+ <div class="table">
+ <!-- <ValueTable
+ ref="ValueTable0"
+ v-if="currentTable == 'ValueTable0'"
+ :isColumnWidth="true"
+ :url="$api.auxiliaryWorkingHoursDay.selectAuxiliaryWorkingHoursDay"
+ :delUrl="$api.auxiliaryWorkingHoursDay.deleteAuxiliaryWorkingHoursDay"
+ :componentData="componentData"
+ :key="upIndex"
+ @delete="handleDelete"
+ /> -->
+ <!-- <ValueTable
+ ref="ValueTable1"
+ v-if="currentTable == 'ValueTable1'"
+ :isColumnWidth="true"
+ :url="
+ $api.auxiliaryOutputWorkingHours.selectAuxiliaryOutputWorkingHours
+ "
+ :componentData="componentData1"
+ :key="upIndex1"
+ /> -->
+ <lims-table
+ v-if="currentTable == 'ValueTable0'"
+ :tableData="tableData"
+ isSelection
+ :handleSelectionChange="handleSelectionChange"
+ :column="column"
+ :key="upIndex"
+ :tableLoading="tableLoading"
+ :height="'calc(100vh - 270px)'"
+ :page="page"
+ @pagination="pagination"
+ ></lims-table>
+
+ <lims-table
+ v-if="currentTable == 'ValueTable1'"
+ :tableData="tableData1"
+ :column="column1"
+ :key="upIndex1"
+ :tableLoading="tableLoading1"
+ :height="'calc(100vh - 270px)'"
+ :page="page1"
+ @pagination="pagination1"
+ ></lims-table>
+ </div>
+
+ <el-dialog
+ :title="formData.id ? '缂栬緫' : '褰曞叆鏁版嵁'"
+ :visible.sync="addVisible"
+ width="600px"
+ :before-close="handleClose"
+ >
+ <el-row style="display: flex; justify-content: space-around">
+ <el-col :span="12">
+ <el-form :model="formData" label-width="90px">
+ <el-form-item label="褰曞叆鏃堕棿:">
+ <el-radio-group v-model="formData.dateTime" size="small">
+ <el-radio :label="getYearAndMonthAndDays() + ' 00:00:00'"
+ >浠婂ぉ</el-radio
+ >
+ <el-radio
+ :label="
+ getYearAndMonthAndDays(
+ new Date(new Date().getTime() - 24 * 60 * 60 * 1000)
+ ) + ' 00:00:00'
+ "
+ >鏄ㄥぉ</el-radio
+ >
+ </el-radio-group>
+ </el-form-item>
+ <el-form-item label="骞翠唤:">
+ <el-input
+ v-model="formData.year"
+ disabled
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="鍛ㄦ:">
+ <el-input
+ v-model="formData.week"
+ size="small"
+ disabled
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="鏄熸湡:">
+ <el-select
+ v-model="formData.weekDay"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ disabled
+ >
+ <el-option
+ v-for="item in weekList"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鐝:">
+ <el-select
+ v-model="formData.shift"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ disabled
+ >
+ <el-option
+ v-for="item in classType"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-form>
+ </el-col>
+ <el-col :span="12">
+ <el-form :model="formData" label-width="90px">
+ <el-form-item label="缂栧彿:" required>
+ <el-input
+ v-model="formData.number"
+ size="small"
+ @blur="getInfoByCode"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="鏁伴噺:" required>
+ <el-input v-model="formData.amount" size="small"></el-input>
+ </el-form-item>
+ <el-form-item label="鏍稿噯宸ユ椂:">
+ <el-input
+ v-model="formData.approvedWorkingHour"
+ size="small"
+ disabled
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="杈呭姪宸ユ椂:">
+ <el-input
+ v-model="formData.nonproductiveTime"
+ size="small"
+ disabled
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="杈呭姪椤圭洰:">
+ <el-input
+ v-model="formData.auxiliaryProject"
+ size="small"
+ disabled
+ ></el-input>
+ </el-form-item>
+ </el-form>
+ </el-col>
+ </el-row>
+ <el-form :model="formData" label-width="90px">
+ <el-form-item label="杈呭姪璇存槑:">
+ <el-input
+ v-model="formData.remarks"
+ type="textarea"
+ :rows="3"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-row>
+ <el-button @click="handleClose">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitAdd" :loading="addLoad"
+ >纭� 瀹�</el-button
+ >
+ </el-row>
+ </span>
+ </el-dialog>
+ <el-dialog :title="title" :visible.sync="checkVisible" width="600px">
+ <el-row style="display: flex; justify-content: space-around">
+ <el-col :span="12">
+ <el-form :model="formData0" label-width="90px">
+ <el-form-item label="骞翠唤:">
+ <el-input
+ v-model="formData0.year"
+ size="small"
+ :disabled="title == '鎵瑰噯'"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="鍛ㄦ:">
+ <el-input
+ v-model="formData0.week"
+ size="small"
+ :disabled="title == '鎵瑰噯'"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="鏄熸湡:">
+ <el-select
+ v-model="formData0.weekDay"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ :disabled="title == '鎵瑰噯'"
+ >
+ <el-option
+ v-for="item in weekList"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="濮撳悕:">
+ <el-input
+ v-model="formData0.name"
+ size="small"
+ disabled
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="鐝:">
+ <el-select
+ v-model="formData0.shift"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ :disabled="title == '鎵瑰噯'"
+ >
+ <el-option
+ v-for="item in classType"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="澶嶆牳璇存槑:">
+ <el-input
+ v-model="formData0.reviewerRemark"
+ type="textarea"
+ :rows="3"
+ size="small"
+ :disabled="title == '鎵瑰噯'"
+ ></el-input>
+ </el-form-item>
+ </el-form>
+ </el-col>
+ <el-col :span="12">
+ <el-form :model="formData0" label-width="90px">
+ <el-form-item label="缂栧彿:" required>
+ <el-input
+ v-model="formData0.number"
+ size="small"
+ :disabled="title == '鎵瑰噯'"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="鏁伴噺:" required>
+ <el-input
+ v-model="formData0.amount"
+ size="small"
+ :disabled="title == '鎵瑰噯'"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="澶嶆牳鏁伴噺:" required>
+ <el-input
+ v-model="formData0.reviewerNumber"
+ size="small"
+ :disabled="title == '鎵瑰噯'"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="鏍稿噯宸ユ椂:">
+ <el-input
+ v-model="formData0.approvedWorkingHour"
+ size="small"
+ disabled
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="澶嶆牳宸ユ椂:">
+ <el-input
+ v-model="formData0.reviewerNonproductiveTime"
+ size="small"
+ disabled
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="杈呭姪椤圭洰:">
+ <el-input
+ v-model="formData0.auxiliaryProject"
+ size="small"
+ disabled
+ ></el-input>
+ </el-form-item>
+ </el-form>
+ </el-col>
+ </el-row>
+ <span slot="footer" class="dialog-footer">
+ <el-row>
+ <el-button
+ @click="submitCheck(0)"
+ type="danger"
+ :loading="checkLoadN"
+ >{{ title == "瀹℃牳" ? "涓嶉�氳繃" : "涓嶆壒鍑�" }}</el-button
+ >
+ <el-button
+ style="margin-left: 20px"
+ type="primary"
+ @click="submitCheck(1)"
+ :loading="checkLoadY"
+ >{{ title == "瀹℃牳" ? "閫� 杩�" : "鎵� 鍑�" }}</el-button
+ >
+ </el-row>
+ </span>
+ </el-dialog>
+ <el-dialog
+ :title="batchCheckTitle"
+ :visible.sync="batchCheckDialog"
+ width="30%"
+ :before-close="closeBatchCheckDialog"
+ >
+ <span>{{ batchCheckDialogMessage }}</span>
+ <span slot="footer" class="dialog-footer">
+ <el-button type="danger" @click="batchCheckDialog = false">{{
+ batchCheckTitle == "鎵归噺瀹℃牳" ? "涓嶉�氳繃" : "涓嶆壒鍑�"
+ }}</el-button>
+ <el-button
+ style="margin-left: 20px"
+ type="primary"
+ @click="batchCheck"
+ >{{ batchCheckTitle == "鎵归噺瀹℃牳" ? "閫� 杩�" : "鎵� 鍑�" }}</el-button
+ >
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+ <script>
+import limsTable from "@/components/Table/lims-table.vue";
+import {
+ obtainItemParameterList,
+ selectAuxiliaryCorrectionHours,
+ selectAuxiliaryOriginalHours,
+ selectAuxiliaryWorkingHoursDay,
+ selectAuxiliaryOutputWorkingHours,
+ insertAuxiliaryWorkingHoursDay,
+ updateAuxiliaryWorkingHoursDay,
+ check,
+ approve,
+ collectWorkingHours,
+ selectshiftByUser,
+ selectAuxiliaryWorkingHoursByNumber,
+ exportWorkingHours
+} from "../../../api/business/manHour";
+import { getYearAndMonthAndDays } from "../../../utils/date";
+
+import { getDicts } from "@/api/system/dict/data";
+import Big from "big.js";
+export default {
+ components: {
+ limsTable,
+ },
+ data() {
+ return {
+ shiftList:[],
+ tableData: [],
+ column: [
+ {
+ label: '濮撳悕',
+ prop: 'name',
+ },
+ {
+ label: '缂栧彿',
+ prop: 'number',
+ },
+ {
+ label: '杈呭姪椤圭洰鍚嶇О',
+ prop: 'auxiliaryProject'
+ },
+ {
+ label: '鐘舵��',
+ prop: 'state',
+ },
+ {
+ label: '鏍稿噯宸ユ椂',
+ prop: 'approvedWorkingHour'
+ },
+ {
+ label: '鏁伴噺',
+ prop: 'amount'
+ },
+ {
+ label: '杈呭姪宸ユ椂',
+ prop: 'nonproductiveTime'
+ },
+ {
+ label: '杈呭姪璇存槑',
+ prop: 'remarks'
+ },
+ {
+ label: '鐝',
+ prop: 'shift',
+ dataType: 'tag',
+ formatData: (params) => {
+ let farmat = '';
+ let list = this.shiftList.filter(item => item.dictValue == params)
+ if(list.length > 0){
+ farmat = list[0].dictLabel
+ }
+ return farmat;
+ },
+ formatType: () => {
+ return "primary";
+ },
+ },
+ {
+ label: '鍛ㄦ',
+ prop: 'week',
+
+ },
+ {
+ label: '鏄熸湡',
+ prop: 'weekDay',
+ dataType: 'tag',
+
+ formatData: (params) => {
+ let farmat = '';
+ let list = this.weekList.filter(item => item.value == params)
+ if(list.length > 0){
+ farmat = list[0].label
+ }
+ return farmat;
+ },
+ formatType: () => {
+ return "success";
+ },
+ },
+ {
+ label: '澶嶆牳浜�',
+ prop: 'reviewer'
+ },
+ {
+ label: '澶嶆牳鏁伴噺',
+ prop: 'reviewerNumber'
+ },
+ {
+ label: '澶嶆牳宸ユ椂',
+ prop: 'reviewerNonproductiveTime'
+ },
+ {
+ label: '澶嶆牳璇存槑',
+ prop: 'reviewerRemark'
+ },
+ {
+ label: '骞�',
+ prop: 'year'
+ },
+ {
+ label: '鍒涘缓鏃堕棿',
+ prop: 'createTime'
+ },
+ {
+ label: '鏃ユ湡',
+ prop: 'dateTime'
+ }
+ ],
+ tableLoading: false,
+ page: {
+ current: 1,
+ size: 20,
+ total: 0,
+ },
+ entity: {
+ week: null,
+ weekDay: null,
+ dateTime: [],
+ name: null,
+ state: null,
+ },
+ tableData1: [],
+ column1: [
+ {
+ label: '妫�娴嬬埗椤�',
+ prop: 'inspectionItem'
+ },
+ {
+ label: '妫�娴嬪瓙椤�',
+ prop: 'inspectionItemSubclass'
+ },
+ {
+ label: '鏍峰搧缂栧彿',
+ prop: 'sample'
+ },
+ {
+ label: '鍔犵彮濮旀墭鍗曞彿',
+ prop: 'overtimeOrderNo'
+ },
+ {
+ label: '鍔犵彮宸ユ椂',
+ prop: 'overtimeWorkTime'
+ },
+ {
+ label: '鍔犵彮鏁伴噺',
+ prop: 'overtimeAmount'
+ },
+ {
+ label: '闈炲姞鐝鎵樺崟鍙�',
+ prop: 'orderNo'
+ },
+ {
+ label: '闈炲姞鐝伐鏃�',
+ prop: 'workTime'
+ },
+ {
+ label: '闈炲姞鐝暟閲�',
+ prop: 'amount'
+ },
+ {
+ label: '浜ч噺宸ユ椂',
+ prop: 'outputWorkTime'
+ },
+ {
+ label: '鏃ユ湡',
+ prop: 'dateTime'
+ },
+ {
+ label: '鍛ㄦ',
+ prop: 'week'
+ },
+ {
+ label: '鏄熸湡',
+ prop: 'weekDay'
+ },
+ {
+ label: '妫�娴嬩汉',
+ prop: 'name'
+ }
+ ],
+ tableLoading1: false,
+ page1: {
+ current: 1,
+ size: 20,
+ total: 0,
+ },
+ entityCopy: {},
+ upIndex: 0,
+ addFileVisible: false,
+ entityCopy1: {},
+ upIndex1: 100,
+ weekList: [
+ { label: "鍛ㄤ竴", value: "1", type: "primary" },
+ { label: "鍛ㄤ簩", value: "2", type: "primary" },
+ { label: "鍛ㄤ笁", value: "3", type: "primary" },
+ { label: "鍛ㄥ洓", value: "4", type: "primary" },
+ { label: "鍛ㄤ簲", value: "5", type: "primary" },
+ { label: "鍛ㄥ叚", value: "6", type: "primary" },
+ { label: "鍛ㄦ棩", value: "0", type: "primary" },
+ ],
+ currentTable: "ValueTable0",
+ addVisible: false,
+ addLoad: false,
+ formData: {
+ dateTime: getYearAndMonthAndDays() + " 00:00:00",
+ year: new Date().getFullYear(),
+ week: this.getCurrentWeekNumber(),
+ weekDay: this.getWeek(),
+ shift: "",
+ number: "",
+ amount: "",
+ approvedWorkingHour: "",
+ nonproductiveTime: "",
+ auxiliaryProject: "",
+ remarks: "",
+ },
+ formData0: {
+ dateTime: 0,
+ year: new Date().getFullYear(),
+ week: this.getCurrentWeekNumber(),
+ weekDay: this.getWeek(),
+ createUser: "",
+ shift: "",
+ number: "",
+ reviewerNumber: "",
+ approvedWorkingHour: "",
+ reviewerNonproductiveTime: "",
+ auxiliaryProject: "",
+ reviewerRemark: "",
+ nameUser: "",
+ name: "",
+ },
+ checkVisible: false,
+ checkLoadN: false,
+ checkLoadY: false,
+ title: "瀹℃牳",
+ classType: [],
+ stateList: [
+ {
+ value: "宸叉彁浜�",
+ label: "宸叉彁浜�",
+ },
+ {
+ value: "宸插鏍�",
+ label: "宸插鏍�",
+ },
+ {
+ value: "宸叉壒鍑�",
+ label: "宸叉壒鍑�",
+ },
+ ],
+ totalInfo: null,
+ auxiliaryWorking: null,
+ outLoading: false,
+ batchCheckTitle: "鎵归噺瀹℃牳",
+ batchCheckDialog: false,
+ ValueTable0Selected: [],
+ batchCheckDialogMessage: "",
+ };
+ },
+ watch: {
+ currentTable() {
+ this.refreshTable();
+ },
+ "formData.dateTime"(val) {
+ if (val == getYearAndMonthAndDays() + " 00:00:00") {
+ this.formData.year = new Date().getFullYear();
+ this.formData.week = this.getCurrentWeekNumber();
+ this.formData.weekDay = this.getWeek();
+ } else {
+ var today = new Date(); // 鑾峰彇褰撳墠鏃ユ湡
+ var yesterday = new Date(today); // 澶嶅埗褰撳墠鏃ユ湡
+ yesterday.setDate(today.getDate() - 1); // 璁剧疆涓哄墠涓�澶�
+ var timestamp = new Date(yesterday.getTime());
+ this.formData.year = timestamp.getFullYear();
+ this.formData.week = this.getCurrentWeekNumber(timestamp);
+ this.formData.weekDay = this.getWeek(timestamp);
+ }
+ },
+ "formData.amount"(val) {
+ if (val) {
+ if (!isNaN(val)) {
+ if (this.formData.approvedWorkingHour) {
+ let workHour = new Big(this.formData.approvedWorkingHour);
+ this.formData.nonproductiveTime = workHour.times(val).toNumber();
+ }
+ } else {
+ this.$message.error("璇疯緭鍏ユ暟瀛�");
+ this.formData.amount = "";
+ }
+ }
+ },
+ "formData.approvedWorkingHour"(val) {
+ if (val && this.formData.amount) {
+ let amount = new Big(this.formData.amount);
+ this.formData.nonproductiveTime = amount.times(val).toNumber();
+ }
+ },
+ "formData0.reviewerNumber"(val) {
+ if (val) {
+ if (!isNaN(val)) {
+ if (this.formData0.approvedWorkingHour) {
+ let approvedWorkingHour = new Big(
+ this.formData0.approvedWorkingHour
+ );
+ this.formData0.reviewerNonproductiveTime = approvedWorkingHour
+ .times(val)
+ .toNumber();
+ }
+ } else {
+ this.$message.error("璇疯緭鍏ユ暟瀛�");
+ this.formData0.reviewerNumber = "";
+ }
+ }
+ },
+ "formData0.approvedWorkingHour"(val) {
+ if (val && this.formData0.reviewerNumber) {
+ let num = new Big(reviewerNumber);
+ this.formData0.reviewerNonproductiveTime = num.times(val).toNumber();
+ }
+ },
+ },
+ created() {
+ //褰撳彧鏈変骇閲忓伐鏃秚ab椤垫椂锛屽綋鍓嶉〉鏀逛负浜ч噺宸ユ椂椤�
+ this.selectEnumByCategory();
+ this.setDate();
+ },
+ mounted() {
+ console.log(11);
+ this.getCurrentWeekNumber();
+ this.selectshiftByUser();
+ this.entityCopy = this.HaveJson(this.entity);
+ this.entityCopy1 = this.HaveJson(this.entity);
+ },
+ methods: {
+ getData() {
+ if (this.currentTable == "ValueTable0") {
+ console.log('杈呭姪宸ユ椂');
+ this.tableLoading = true;
+ let params = {
+ current: this.page.current,
+ size: this.page.size,
+ dateTime1: this.entity.dateTime[0],
+ dateTime2: this.entity.dateTime[1],
+ week: this.entity.week,
+ weekDay: this.entity.weekDay,
+ name: this.entity.name,
+ state: this.entity.state,
+ };
+ selectAuxiliaryWorkingHoursDay(params)
+ .then((res) => {
+ this.tableLoading = false;
+ this.tableData = res.data.records;
+ this.page.total = res.data.total;
+ });
+ } else {
+ console.log('浜ч噺宸ユ椂');
+ this.tableLoading1 = true;
+ let params = {
+ current: this.page.current,
+ size: this.page.size,
+ dateTime1: this.entity.dateTime[0],
+ dateTime2: this.entity.dateTime[1],
+ week: this.entity.week,
+ weekDay: this.entity.weekDay,
+ name: this.entity.name,
+ state: this.entity.state,
+ };
+ selectAuxiliaryOutputWorkingHours(params)
+ .then((res) => {
+ this.tableLoading1 = false;
+ this.tableData1 = res.data.records;
+ this.page1.total = res.data.total;
+ });
+ }
+ },
+ pagination({ current, limit }) {
+ this.page.current = current;
+ this.page.size = limit;
+ this.getData();
+ },
+ pagination1({ current, limit }) {
+ this.page1.current = current;
+ this.page1.size = limit;
+ this.getData();
+ },
+ /** 灏嗘椂闂撮�夋嫨鍣ㄩ粯璁ら�変负褰撳ぉ鐨勬棩鏈� */
+ setDate() {
+ let currentDate = new Date();
+ let year = currentDate.getFullYear();
+ let month = String(currentDate.getMonth() + 1).padStart(2, "0");
+ let day = String(currentDate.getDate()).padStart(2, "0");
+ let formattedDate1 = `${year}-${month}-${day}`;
+ let formattedDate2 = `${year}-${month}-${day}`;
+ this.entity.dateTime.push(formattedDate1);
+ this.entity.dateTime.push(formattedDate2);
+ this.refreshTable();
+ },
+ getYearAndMonthAndDays(date) {
+ return getYearAndMonthAndDays(date);
+ },
+ refreshTable(e) {
+ let entity = {};
+ if (this.entity.week1 && this.entity.week2) {
+ entity.week = JSON.stringify([this.entity.week1, this.entity.week2]);
+ } else {
+ entity.week = "";
+ }
+ if (!this.entity.dateTime) {
+ entity.dateTime = "";
+
+ }
+ entity.weekDay = this.entity.weekDay;
+ entity.name = this.entity.name;
+ if (this.currentTable == "ValueTable0") {
+ entity.state = this.entity.state;
+ this.entity = { ...this.entity, ...entity };
+ this.$nextTick(() => {
+ this.getData();
+ });
+ } else {
+ this.entity = {
+ ...this.entity,
+ ...entity,
+ };
+ this.getData();
+ }
+
+ this.collectWorkingHours();
+ },
+ refresh() {
+ this.entity = {};
+ this.refreshTable();
+ },
+ openAdd() {
+ this.formData = {
+ dateTime: getYearAndMonthAndDays() + " 00:00:00",
+ year: new Date().getFullYear(),
+ week: this.getCurrentWeekNumber(),
+ weekDay: this.getWeek(),
+ shift: "",
+ number: "",
+ amount: "",
+ approvedWorkingHour: "",
+ nonproductiveTime: "",
+ auxiliaryProject: "",
+ remarks: "",
+ };
+ this.addVisible = true;
+ },
+ handleSelectionChange(val) {
+ this.ValueTable0Selected = val;
+ },
+ handleEdit(row) {
+ this.formData = JSON.parse(JSON.stringify(row));
+ this.addVisible = true;
+ },
+ handleDelete() {
+ this.collectWorkingHours();
+ },
+ handleClose() {
+ this.addVisible = false;
+ },
+ submitAdd() {
+ if (!this.formData.number) {
+ this.$message.error("璇疯緭鍏ョ紪鍙�");
+ return;
+ }
+ if (!this.formData.amount) {
+ this.$message.error("璇疯緭鍏ユ暟閲�");
+ return;
+ }
+ this.addLoad = true;
+ if (!this.formData.id) {
+ insertAuxiliaryWorkingHoursDay({...this.formData})
+ .then((res) => {
+ this.addLoad = false;
+ if (res.code == 201) return;
+ this.$message.success("宸叉彁浜�");
+ this.formData.number = "";
+ this.formData.amount = "";
+ this.formData.remarks = "";
+ this.formData.approvedWorkingHour = "";
+ this.formData.nonproductiveTime = "";
+ this.formData.auxiliaryProject = "";
+ // this.addVisible = false
+ this.refreshTable("page");
+ });
+ } else {
+ updateAuxiliaryWorkingHoursDay({...this.formData})
+ .then((res) => {
+ this.addLoad = false;
+ if (res.code == 201) return;
+ this.$message.success("鎿嶄綔鎴愬姛");
+ this.formData.number = "";
+ this.formData.amount = "";
+ this.formData.remarks = "";
+ this.formData.approvedWorkingHour = "";
+ this.formData.nonproductiveTime = "";
+ this.formData.auxiliaryProject = "";
+ // this.addVisible = false
+ this.refreshTable("page");
+ });
+ }
+ },
+ handleCheck(row) {
+ this.title = "瀹℃牳";
+ this.formData0 = row;
+ this.checkVisible = true;
+ this.formData0.reviewerNumber = this.formData0.amount;
+ },
+ handleRatify(row) {
+ this.title = "鎵瑰噯";
+ this.formData0 = row;
+ this.checkVisible = true;
+ this.formData0.reviewerNumber = this.formData0.amount;
+ },
+ handleChangeTask(row) {
+ this.ValueTable0Selected = JSON.parse(JSON.stringify(row));
+ },
+ openBatchCheck(e) {
+ if (this.ValueTable0Selected.length > 0) {
+ const isChecked = this.ValueTable0Selected.every(
+ (item) => item.state === "宸叉彁浜�"
+ );
+ const isApprove = this.ValueTable0Selected.every(
+ (item) => item.state !== "宸叉壒鍑�"
+ );
+ console.log("this.isApprove---", isApprove);
+ this.batchCheckTitle = e === 0 ? "鎵归噺瀹℃牳" : "鎵归噺鎵瑰噯";
+ this.batchCheckDialogMessage =
+ e === 0 ? "鏄惁鍏ㄩ儴閫氳繃瀹℃牳?" : "鏄惁鍏ㄩ儴閫氳繃鎵瑰噯?";
+ if (this.batchCheckTitle === "鎵归噺瀹℃牳") {
+ if (isChecked) {
+ this.batchCheckDialog = true;
+ } else {
+ this.$message.error("璇烽�夋嫨鏈鏍告垨鏈壒鍑嗙殑鏁版嵁");
+ }
+ } else {
+ if (isApprove) {
+ this.batchCheckDialog = true;
+ } else {
+ this.$message.error("璇烽�夋嫨鏈壒鍑嗙殑鏁版嵁");
+ }
+ }
+ } else {
+ this.$message.error("璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�");
+ }
+ },
+ batchCheck() {
+ const e = this.batchCheckTitle === "鎵归噺瀹℃牳" ? 0 : 1;
+ this.batchCheck1(e);
+ },
+ batchCheck1(e) {
+ if (this.ValueTable0Selected && this.ValueTable0Selected.length > 0) {
+ const list = JSON.parse(JSON.stringify(this.ValueTable0Selected));
+ const state = e === 0 ? "宸插鏍�" : "宸叉壒鍑�";
+ let auxiliaryWorkingHoursDays = [];
+ list.forEach((item) => {
+ delete item.orderBy;
+ item.state = state;
+ auxiliaryWorkingHoursDays.push(item);
+ });
+ if(e == 0) {
+ check({auxiliaryWorkingHoursDays: auxiliaryWorkingHoursDays}).then((res) => {
+ if (res.code == 201) return;
+ this.$message.success("鎿嶄綔鎴愬姛");
+ this.batchCheckDialog = false;
+ this.refreshTable("page");
+ });
+ }else {
+ approve({auxiliaryWorkingHoursDays: auxiliaryWorkingHoursDays}).then((res) => {
+ if (res.code == 201) return;
+ this.$message.success("鎿嶄綔鎴愬姛");
+ this.batchCheckDialog = false;
+ this.refreshTable("page");
+ });
+ }
+ } else {
+ this.$message.error("璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�");
+ }
+ },
+ closeBatchCheckDialog() {
+ this.batchCheckDialog = false;
+ },
+ submitBatchCheckDialog() {
+ this.batchCheckDialog = false;
+ this.refreshTable("page");
+ this.collectWorkingHours();
+ },
+ submitCheck(e) {
+ if (!this.formData0.number) {
+ this.$message.error("璇疯緭鍏ョ紪鍙�");
+ return;
+ }
+ if (!this.formData0.amount) {
+ this.$message.error("璇疯緭鍏ユ暟閲�");
+ return;
+ }
+
+ if (this.title == "瀹℃牳") {
+ if (e == 0) {
+ // 瀹℃牳涓嶉�氳繃
+ this.checkLoadN = true;
+ } else {
+ // 瀹℃牳閫氳繃
+ this.checkLoadY = true;
+ }
+ this.formData0.state = e == 0 ? this.formData0.state : "宸插鏍�";
+ check({auxiliaryWorkingHoursDays: [this.formData0]}).then((res) => {
+ if (e == 0) {
+ // 瀹℃牳涓嶉�氳繃
+ this.checkLoadN = false;
+ } else {
+ // 瀹℃牳閫氳繃
+ this.checkLoadY = false;
+ }
+ if (res.code == 201) return;
+ this.$message.success("鎿嶄綔鎴愬姛");
+ this.checkVisible = false;
+ this.refreshTable("page");
+ });
+ } else {
+ if (e == 0) {
+ this.checkLoadN = true;
+ } else {
+ this.checkLoadY = true;
+ }
+ this.formData0.state = e == 0 ? "宸叉彁浜�" : "宸叉壒鍑�";
+ approve({auxiliaryWorkingHoursDays: [this.formData0]}).then((res) => {
+ if (e == 0) {
+ this.checkLoadN = false;
+ } else {
+ this.checkLoadY = false;
+ }
+ if (res.code == 201) return;
+ this.$message.success("鎿嶄綔鎴愬姛");
+ this.checkVisible = false;
+ this.refreshTable("page");
+ this.collectWorkingHours();
+ });
+ }
+ },
+ selectEnumByCategory() {
+ getDicts('sys_class_type').then((res) => {
+ this.classType = res.data;
+ this.classType = res.data;
+ this.shiftList = res.data
+ console.log('shif',this.shiftList);
+ });
+ },
+ getCurrentWeekNumber(now = new Date()) {
+ const startOfWeek = new Date(
+ now.getFullYear(),
+ now.getMonth(),
+ now.getDate() - now.getDay()
+ ); // 鍛ㄥぉ
+ const firstWeekOfYear = new Date(startOfWeek.getFullYear(), 0, 0); // 褰撳勾鐨勭涓�涓懆澶�
+ const firstWeekOfNextYear = new Date(
+ firstWeekOfYear.getFullYear() + 1,
+ 0,
+ 0
+ ); // 涓嬩竴骞寸殑绗竴涓懆澶�
+ const daysSinceNewYear =
+ (startOfWeek - firstWeekOfYear) / (24 * 60 * 60 * 1000); // 璁$畻鑷柊骞翠互鏉ョ殑澶╂暟
+ const weeksSinceNewYear = Math.floor(daysSinceNewYear / 7); // 澶╂暟闄や互7寰楀埌鍛ㄦ暟
+
+ if (startOfWeek > now) {
+ // 濡傛灉褰撳墠鍛ㄧ殑鍛ㄥぉ杩樻病鍒帮紝鍒欒繑鍥炰笂骞寸殑鏈�鍚庝竴鍛�
+ return weeksSinceNewYear;
+ } else if (firstWeekOfNextYear <= now) {
+ // 濡傛灉褰撳墠鍛ㄧ殑鍛ㄥぉ宸茬粡杩囦簡锛屽垯杩斿洖褰撳勾鐨勫懆鏁�
+ return weeksSinceNewYear + 1;
+ } else {
+ // 鍚﹀垯杩斿洖褰撳勾鐨勬渶鍚庝竴鍛�
+ return weeksSinceNewYear + 2;
+ }
+ },
+ getWeek(e = new Date()) {
+ // let str = '鏃ヤ竴浜屼笁鍥涗簲鍏�'
+ let d = e.getDay();
+ // let c = str.charAt(d)
+ // return `鍛�${c}`
+ return String(d);
+ },
+ collectWorkingHours() {
+ let entity = {};
+ if (this.entity.week1 && this.entity.week2) {
+ entity.week = JSON.stringify([this.entity.week1, this.entity.week2]);
+ } else {
+ entity.week = "";
+ }
+ if (this.entity.dateTime) {
+ entity.dateTime = JSON.stringify(this.entity.dateTime);
+ } else {
+ entity.dateTime = "";
+ }
+ entity.weekDay = this.entity.weekDay;
+ entity.name = this.entity.name;
+ entity.state = this.entity.state;
+ collectWorkingHours(entity).then((res) => {
+ this.totalInfo = res.data;
+ });
+ },
+ selectshiftByUser() {
+ selectshiftByUser().then((res) => {
+ this.formData.shift = res.data;
+ });
+ },
+ getInfoByCode() {
+ if (this.formData.number) {
+ selectAuxiliaryWorkingHoursByNumber({number:this.formData.number}).then((res) => {
+ this.auxiliaryWorking = res.data;
+ if (this.addVisible) {
+ this.formData.approvedWorkingHour =
+ this.auxiliaryWorking.approvedWorkingHour;
+ this.formData.auxiliaryProject =
+ this.auxiliaryWorking.auxiliaryProject;
+ } else if (this.title == "瀹℃牳" && this.checkVisible) {
+ this.formData0.approvedWorkingHour =
+ this.auxiliaryWorking.approvedWorkingHour;
+ this.formData0.auxiliaryProject =
+ this.auxiliaryWorking.auxiliaryProject;
+ }
+ });
+ }
+ },
+ handleOut() {
+ this.outLoading = true;
+ exportWorkingHours().then((res) => {
+ this.outLoading = false;
+ this.$message.success("瀵煎嚭鎴愬姛");
+ const blob = new Blob([res]);
+ console.log(blob);
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement("a");
+ link.href = url;
+ link.download = "鏃ュ伐鏃舵眹鎬昏〃.xlsx";
+ link.click();
+ });
+ },
+ },
+};
+</script>
+
+ <style scoped>
+.work-time-management {
+ height: 100%;
+ overflow-y: scroll;
+ /* scrollbar-width: none; */
+}
+/* .work-time-management::-webkit-scrollbar {
+ display: none;
+ } */
+.search {
+ background-color: #fff;
+ height: 80px;
+ display: flex;
+ align-items: center;
+}
+
+.search_thing {
+ width: 300px;
+ display: flex;
+ align-items: center;
+}
+
+.search_label {
+ width: 70px;
+ font-size: 14px;
+ text-align: right;
+}
+
+.search_input {
+ width: calc(100% - 70px);
+}
+.table {
+ margin-top: 10px;
+ background-color: #fff;
+ width: calc(100% - 40px);
+ height: calc(100% - 60px - 80px - 10px - 40px - 25px);
+ padding: 20px;
+}
+</style>
+
\ No newline at end of file
diff --git a/src/views/performance/manHour/work-time-statistics.vue b/src/views/performance/manHour/work-time-statistics.vue
new file mode 100644
index 0000000..86aac14
--- /dev/null
+++ b/src/views/performance/manHour/work-time-statistics.vue
@@ -0,0 +1,589 @@
+<template>
+ <div class="work-time-statistics">
+ <div class="search">
+ <div class="search_thing">
+ <div class="search_label">鏃ユ湡锛�</div>
+ <div class="search_input" style="display: flex; align-items: center">
+ <el-date-picker
+ v-model="entity.month"
+ type="month"
+ format="yyyy-MM"
+ value-format="yyyy-MM"
+ placeholder="閫夋嫨鏈�"
+ size="small"
+ style="width: 100%"
+ :clearable="false"
+ @change="refreshTable()"
+ >
+ </el-date-picker>
+ </div>
+ </div>
+ <div class="search_thing">
+ <div class="search_label">鍛樺伐锛�</div>
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="entity.name"
+ @keyup.enter.native="refreshTable()"
+ ></el-input>
+ </div>
+ <div class="search_thing">
+ <div class="search_label">閮ㄩ棬锛�</div>
+ <div class="search_input">
+ <el-select
+ size="small"
+ placeholder="璇烽�夋嫨"
+ clearable
+ v-model="entity.departLims"
+ @change="refreshTable()"
+ >
+ <el-option
+ label="閫氫俊浜у搧瀹為獙瀹�"
+ value="閫氫俊浜у搧瀹為獙瀹�"
+ ></el-option>
+ <el-option
+ label="鐢靛姏浜у搧瀹為獙瀹�"
+ value="鐢靛姏浜у搧瀹為獙瀹�"
+ ></el-option>
+ </el-select>
+ </div>
+ </div>
+ <div class="search_thing" style="padding-left: 30px">
+ <el-button size="small" @click="refresh()">閲� 缃�</el-button>
+ <el-button size="small" type="primary" @click="refreshTable()"
+ >鏌� 璇�</el-button
+ >
+ </div>
+ <div class="search_thing">
+ <el-button
+ size="small"
+ type="primary"
+ @click="handleDown"
+ v-show="
+ currentTable == 'value0' &&
+ down
+ "
+ :loading="outLoading"
+ >瀵� 鍑�</el-button
+ >
+ <el-button
+ size="small"
+ type="primary"
+ @click="handleUp"
+ v-show="currentTable == 'value1' && up"
+ >瀵� 鍏�</el-button
+ >
+ </div>
+ </div>
+ <div style="text-align: left">
+ <el-radio-group
+ v-model="currentTable"
+ size="small"
+ :key="'111'"
+ style="margin-top: 10px"
+ >
+ <el-radio-button
+ label="value0" >
+ 鍘熷宸ユ椂
+ </el-radio-button>
+ <el-radio-button
+ label="value1"
+ >
+ 淇宸ユ椂
+ </el-radio-button>
+ </el-radio-group>
+ </div>
+ <div class="table">
+ <!-- <ValueTable ref="ValueTable0"
+ v-if="currentTable == 'value0' && isPermission('selectAuxiliaryOriginalHours')" :isColumnWidth="true"
+ :isShowZero="true"
+ :url="$api.auxiliaryOriginalHours.selectAuxiliaryOriginalHours"
+ :componentData="componentData" :key="upIndex" />
+ <ValueTable ref="ValueTable1" :isShowZero="true"
+ v-if="currentTable == 'value1' && isPermission('selectAuxiliaryCorrectionHours')" :isColumnWidth="true"
+ :url="$api.auxiliaryCorrectionHours.selectAuxiliaryCorrectionHours"
+ :inputUrl="$api.auxiliaryCorrectionHours.upload"
+ :componentData="componentData0"
+ :key="upIndex1" /> -->
+ <lims-table
+ v-if="currentTable == 'value0'"
+ :tableData="tableData"
+ :column="column"
+ :key="upIndex"
+ :tableLoading="tableLoading"
+ :height="'calc(100vh - 270px)'"
+ :page="page"
+ @pagination="pagination"
+ ></lims-table>
+
+ <lims-table
+ v-if="currentTable == 'value1'"
+ :tableData="tableData1"
+ :column="column1"
+ :key="upIndex1"
+ :tableLoading="tableLoading1"
+ :height="'calc(100vh - 270px)'"
+ :page="page1"
+ @pagination="pagination1"
+ ></lims-table>
+ </div>
+ </div>
+</template>
+
+ <script>
+import limsTable from "@/components/Table/lims-table.vue";
+import {
+ obtainItemParameterList,
+ selectAuxiliaryCorrectionHours,
+ selectAuxiliaryOriginalHours
+} from "../../../api/business/manHour";
+import { getDicts } from "@/api/system/dict/data";
+
+import {
+ getYearAndMonthAndDays
+ } from '../../../utils/date'
+
+export default {
+ components: {
+ limsTable,
+ },
+ computed: {},
+ data() {
+ return {
+ column: [
+ {
+ label: "濮撳悕",
+ prop: "name",
+ },
+ {
+ label: "绫诲瀷",
+ prop: "type",
+ },
+ {
+ label: "1",
+ prop: "oneHours",
+ },
+ {
+ label: "2",
+ prop: "twoHours",
+ },
+ {
+ label: "3",
+ prop: "threeHours",
+ },
+ {
+ label: "4",
+ prop: "fourHours",
+ },
+ {
+ label: "5",
+ prop: "fiveHours",
+ },
+ {
+ label: "6",
+ prop: "sixHours",
+ },
+ {
+ label: "7",
+ prop: "sevenHours",
+ },
+ {
+ label: "8",
+ prop: "eightHours",
+ },
+ {
+ label: "9",
+ prop: "nineHours",
+ },
+ {
+ label: "10",
+ prop: "tenHours",
+ },
+ {
+ label: "11",
+ prop: "elevenHours",
+ },
+ {
+ label: "12",
+ prop: "twelveHours",
+ },
+ {
+ label: "13",
+ prop: "thirteenHours",
+ },
+ {
+ label: "14",
+ prop: "fourteenHours",
+ },
+ {
+ label: "15",
+ prop: "fifteenHours",
+ },
+ {
+ label: "16",
+ prop: "sixteenHours",
+ },
+ {
+ label: "17",
+ prop: "seventeenHours",
+ },
+ {
+ label: "18",
+ prop: "eighteenHours",
+ },
+ {
+ label: "19",
+ prop: "nineteenHours",
+ },
+ {
+ label: "20",
+ prop: "twentyHours",
+ },
+ {
+ label: "21",
+ prop: "twentyOneHours",
+ },
+ {
+ label: "22",
+ prop: "twentyTwoHours",
+ },
+ {
+ label: "23",
+ prop: "twentyThreeHours",
+ },
+ {
+ label: "24",
+ prop: "twentyFourHours",
+ },
+ {
+ label: "25",
+ prop: "twentyFiveHours",
+ },
+ {
+ label: "26",
+ prop: "twentySixHours",
+ },
+ {
+ label: "27",
+ prop: "twentySevenHours",
+ },
+ {
+ label: "28",
+ prop: "twentyEightHours",
+ },
+ {
+ label: "29",
+ prop: "twentyNineHours",
+ },
+ {
+ label: "30",
+ prop: "thirtyHours",
+ },
+ {
+ label: "31",
+ prop: "thirtyOneHours",
+ },
+ {
+ label: "鎬诲伐鏃�",
+ prop: "total",
+ },
+ {
+ label: "鏈堜唤",
+ prop: "month",
+ },
+ ],
+ tableData: [],
+ tableLoading: false,
+ page: {
+ current: 1,
+ size: 20,
+ total: 0,
+ },
+ entity: {},
+ column1: [
+ {
+ label: "濮撳悕",
+ prop: "name",
+ },
+ {
+ label: "绫诲瀷",
+ prop: "type",
+ },
+ {
+ label: "1",
+ prop: "oneHours",
+ },
+ {
+ label: "2",
+ prop: "twoHours",
+ },
+ {
+ label: "3",
+ prop: "threeHours",
+ },
+ {
+ label: "4",
+ prop: "fourHours",
+ },
+ {
+ label: "5",
+ prop: "fiveHours",
+ },
+ {
+ label: "6",
+ prop: "sixHours",
+ },
+ {
+ label: "7",
+ prop: "sevenHours",
+ },
+ {
+ label: "8",
+ prop: "eightHours",
+ },
+ {
+ label: "9",
+ prop: "nineHours",
+ },
+ {
+ label: "10",
+ prop: "tenHours",
+ },
+ {
+ label: "11",
+ prop: "elevenHours",
+ },
+ {
+ label: "12",
+ prop: "twelveHours",
+ },
+ {
+ label: "13",
+ prop: "thirteenHours",
+ },
+ {
+ label: "14",
+ prop: "fourteenHours",
+ },
+ {
+ label: "15",
+ prop: "fifteenHours",
+ },
+ {
+ label: "16",
+ prop: "sixteenHours",
+ },
+ {
+ label: "17",
+ prop: "seventeenHours",
+ },
+ {
+ label: "18",
+ prop: "eighteenHours",
+ },
+ {
+ label: "19",
+ prop: "nineteenHours",
+ },
+ {
+ label: "20",
+ prop: "twentyHours",
+ },
+ {
+ label: "21",
+ prop: "twentyOneHours",
+ },
+ {
+ label: "22",
+ prop: "twentyTwoHours",
+ },
+ {
+ label: "23",
+ prop: "twentyThreeHours",
+ },
+ {
+ label: "24",
+ prop: "twentyFourHours",
+ },
+ {
+ label: "25",
+ prop: "twentyFiveHours",
+ },
+ {
+ label: "26",
+ prop: "twentySixHours",
+ },
+ {
+ label: "27",
+ prop: "twentySevenHours",
+ },
+ {
+ label: "28",
+ prop: "twentyEightHours",
+ },
+ {
+ label: "29",
+ prop: "twentyNineHours",
+ },
+ {
+ label: "30",
+ prop: "thirtyHours",
+ },
+ {
+ label: "31",
+ prop: "thirtyOneHours",
+ },
+ {
+ label: "鎬诲伐鏃�",
+ prop: "total",
+ },
+ {
+ label: "鏈堜唤",
+ prop: "month",
+ },
+ ],
+ tableData1: [],
+ tableLoading1: false,
+ page1: {
+ current: 1,
+ size: 20,
+ total: 0,
+ },
+ entity1: {},
+ down: false,
+ up: false,
+
+ entity: {
+ month: getYearAndMonthAndDays().split('-')[0]+'-'+getYearAndMonthAndDays().split('-')[1],
+ name: "",
+ departLims: "",
+ },
+ entityCopy: {},
+ entityCopy0: {},
+ upIndex: 0,
+ upIndex1: 100,
+ weekList: [],
+ currentTable: "value0",
+ outLoading: false,
+ };
+ },
+ created() {},
+ mounted() {
+ this.entityCopy = this.HaveJson(this.entity);
+ this.entityCopy0 = this.HaveJson(this.entity);
+ this.getData();
+ },
+ watch: {
+ currentTable(val) {
+ this.getData();
+ },
+ },
+ methods: {
+ getData() {
+ if (this.currentTable == "value0") {
+ console.log('value0');
+ this.tableLoading = true;
+ let params = {...this.page, ...this.entity};
+ selectAuxiliaryOriginalHours(params).then((res) => {
+ this.tableData = res.data.records;
+ this.page.total = res.data.total;
+ this.tableLoading = false;
+ });
+ } else {
+ console.log('value1');
+ this.tableLoading1 = true;
+ let params = {...this.page1, ...this.entity1};
+ selectAuxiliaryCorrectionHours(params).then((res) => {
+ this.tableData1 = res.data.records;
+ this.page1.total = res.data.total;
+ this.tableLoading1 = false;
+ });
+ }
+ },
+ // 杩斿洖鍒嗛〉鍊�
+ pagination({ page, limit }) {
+ this.page.current = page;
+ this.page.size = limit;
+ this.getList();
+ },
+ // 杩斿洖鍒嗛〉鍊�
+ pagination1({ page, limit }) {
+ this.page1.current = page;
+ this.page1.size = limit;
+ this.getList();
+ },
+ refresh() {
+ this.entity = {
+ month: getYearAndMonthAndDays(),
+ };
+ if (this.currentTable == "value0") {
+ this.entity = this.HaveJson(this.entityCopy);
+ this.upIndex++;
+ } else {
+ this.entity = this.HaveJson(this.entityCopy0);
+ this.upIndex1++;
+ }
+ this.refreshTable();
+ },
+ refreshTable() {
+ this.getData();
+ },
+ handleDown() {
+ let entity = { ...this.entity };
+ entity.month =
+ entity.month.split("-")[0] + "-" + entity.month.split("-")[1];
+ this.outLoading = true;
+ exportOriginalHours({ ...entity }).then((res) => {
+ this.outLoading = false;
+ this.$message.success("瀵煎嚭鎴愬姛");
+ const blob = new Blob([res], { type: "application/octet-stream" });
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement("a");
+ link.href = url;
+ link.download = entity.month + "宸ユ椂缁熻琛�.xlsx";
+ link.click();
+ });
+ },
+ handleUp() {
+ },
+
+ },
+};
+</script>
+
+ <style scoped>
+.work-time-statistics {
+ height: 100%;
+}
+.search {
+ background-color: #fff;
+ height: 80px;
+ display: flex;
+ align-items: center;
+}
+
+.search_thing {
+ width: 270px;
+ display: flex;
+ align-items: center;
+}
+
+.search_label {
+ width: 60px;
+ font-size: 14px;
+ text-align: right;
+}
+
+.search_input {
+ width: calc(100% - 60px);
+}
+.table {
+ margin-top: 10px;
+ background-color: #fff;
+ width: calc(100% - 40px);
+ height: calc(100% - 60px - 80px - 10px - 40px - 25px);
+ padding: 20px;
+}
+</style>
+
\ No newline at end of file
diff --git a/src/views/performance/manHour/workTimeConfig.vue b/src/views/performance/manHour/workTimeConfig.vue
deleted file mode 100644
index afdbc85..0000000
--- a/src/views/performance/manHour/workTimeConfig.vue
+++ /dev/null
@@ -1,260 +0,0 @@
-<template>
- <div class="work-time-config">
- <div class="search">
- <div class="search_thing">
- <div class="search_label">缂栧彿锛�</div>
- <div class="search_input">
- <el-input
- size="small"
- placeholder="璇疯緭鍏�"
- clearable
- v-model="queryParams.number"
- @keyup.enter.native="refreshTable()"
- ></el-input>
- </div>
- </div>
- <div class="search_thing">
- <div class="search_label">瀹為獙瀹わ細</div>
- <el-select
- v-model="queryParams.laboratory"
- placeholder="鍏ㄩ儴"
- size="small"
- @change="refreshTable()"
- clearable
- >
- <el-option
- v-for="item in laboratoryList"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </div>
- <div class="search_thing">
- <div class="search_label">閮ㄩ棬锛�</div>
- <div class="search_input">
- <el-input
- size="small"
- placeholder="璇疯緭鍏�"
- clearable
- v-model="queryParams.department"
- @keyup.enter.native="refreshTable()"
- ></el-input>
- </div>
- </div>
- <div class="search_thing" style="padding-left: 30px">
- <el-button size="small" @click="refresh()">閲� 缃�</el-button>
- <el-button size="small" type="primary" @click="refreshTable()"
- >鏌� 璇�</el-button
- >
- </div>
- <el-button
- size="small"
- type="primary"
- style="position: absolute; right: 50px"
- @click="openAdd"
- >鏂� 澧�</el-button
- >
- </div>
- <div class="table">
- <lims-table
- :tableData="tableData"
- :column="column"
- :page="page"
- :tableLoading="tableLoading"
- :height="'calc(100vh - 150px)'"
- @pagination="pagination"
- ></lims-table>
- </div>
- </div>
-</template>
-
-<script>
-import ValueTable from "@/components/Table/value-table.vue";
-import limsTable from "@/components/Table/lims-table.vue";
-import { checkPermi } from "@/utils/permission"; // 鏉冮檺鍒ゆ柇鍑芥暟
-import {
- selectAuxiliaryWorkingHours,
- insertAuxiliaryWorkingHoursDay,
- obtainItemParameterList,
-} from "@/api/performance/manHour";
-export default {
- components: {
- ValueTable,
- limsTable,
- },
- data() {
- return {
- laboratoryList: [],
- partList: [],
- addPower: true,
- queryParams: {},
- tableData: [],
- column: [
- { label: "缂栧彿", prop: "number" },
- { label: "杈呭姪椤圭洰鍚嶇О", prop: "auxiliaryProject", width: "120px" },
- { label: "瀹為獙瀹�", prop: "laboratory" },
- { label: "鍗曚綅", prop: "unit" },
- { label: "鏍稿噯宸ユ椂", prop: "approvedWorkingHour" },
- { label: "閮ㄩ棬", prop: "department" },
- { label: "澶囨敞", prop: "remarks" },
- {
- dataType: "action",
- fixed: "right",
- label: "鎿嶄綔",
- width: "160px",
- operation: [
- {
- name: "缂栬緫",
- type: "text",
- clickFun: (row) => {
- this.handleEdit(row);
- },
- showHide: (row) => {
- return this.checkPermi(["standard:model:edit"]);
- },
- },
- {
- name: "鍒犻櫎",
- type: "text",
- clickFun: (row) => {
- this.handleDelete(row);
- },
- showHide: (row) => {
- return this.checkPermi(["standard:model:del"]);
- },
- },
- ],
- },
- ],
- page: {
- total: 0,
- size: 10,
- current: 0,
- },
- tableLoading: false,
- unitList: [],
- };
- },
- mounted() {
- this.entityCopy = this.HaveJson(this.componentData.entity);
- //this.getPower();
- this.obtainItemParameterList();
- this.selectEnumByCategoryForUnit();
- },
- methods: {
- checkPermi,
- getList() {
- this.tableLoading = true;
- let param = { ...this.queryParams, ...this.page };
- delete param.total;
- selectAuxiliaryWorkingHours({ ...param })
- .then((res) => {
- this.tableLoading = false;
- if (res.code === 200) {
- this.tableData = res.data.records;
- this.page.total = res.data.total;
- }
- })
- .catch((err) => {
- this.tableLoading = false;
- });
- },
- pagination(current, size) {
- this.page.current = current;
- this.getList();
- },
- refresh() {
- this.queryParams = {};
- this.page.current = 1;
- this.getList();
- },
- refreshTable() {
- this.page.current = 1;
- this.getList();
- },
- // getPower(radio) {
- // let power = JSON.parse(sessionStorage.getItem("power"));
- // let up = false;
- // let del = false;
- // let add = false;
- // for (var i = 0; i < power.length; i++) {
- // if (power[i].menuMethod == "upDeviceParameter") {
- // up = true;
- // }
- // if (power[i].menuMethod == "delDeviceParameter") {
- // del = true;
- // }
- // if (power[i].menuMethod == "addDeviceParameter") {
- // add = true;
- // }
- // }
- // if (!up) {
- // this.componentData.do.splice(1, 1);
- // }
- // if (!del) {
- // this.componentData.do.splice(0, 1);
- // }
- // this.addPower = add;
- // },
- openAdd() {
- // this.$refs.ValueTable0.openAddDia(
- // this.$api.auxiliaryWorkingHours.insertAuxiliaryWorkingHours
- // );
- },
- obtainItemParameterList() {
- obtainItemParameterList().then((res) => {
- let data = [];
- res.data.forEach((a) => {
- data.push({
- label: a.laboratoryName,
- value: a.id,
- });
- });
- this.laboratoryList = data;
- });
- },
- selectEnumByCategoryForUnit() {
- this.getDicts("sys_unit").then((response) => {
- this.unitList = response.data;
- });
- },
- },
-};
-</script>
-
-<style scoped>
-.work-time-config {
- height: 100%;
-}
-.search {
- background-color: #fff;
- height: 80px;
- display: flex;
- align-items: center;
-}
-
-.search_thing {
- width: 250px;
- display: flex;
- align-items: center;
-}
-
-.search_label {
- width: 70px;
- font-size: 14px;
- text-align: right;
-}
-
-.search_input {
- width: calc(100% - 70px);
-}
-.table {
- margin-top: 10px;
- background-color: #fff;
- width: calc(100% - 40px);
- height: calc(100% - 60px - 80px - 10px - 24px);
- padding: 20px;
-}
-</style>
diff --git a/src/views/performance/manHour/workTimeManagement.vue b/src/views/performance/manHour/workTimeManagement.vue
deleted file mode 100644
index 4bbe90d..0000000
--- a/src/views/performance/manHour/workTimeManagement.vue
+++ /dev/null
@@ -1,1143 +0,0 @@
-<template>
- <!--鏃ュ伐鏃剁鐞�-->
- <div class="work-time-management">
- <div class="search">
- <div class="search_thing" style="width: 200px">
- <div class="search_label">鏄熸湡锛�</div>
- <el-select
- v-model="entity.weekDay"
- clearable
- placeholder="鍏ㄩ儴"
- size="small"
- @change="refreshTable()"
- >
- <el-option
- v-for="item in weekList"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </div>
- <div class="search_thing" style="width: 390px">
- <div class="search_label" style="width: 90px">鏃堕棿鑼冨洿锛�</div>
- <div class="search_input">
- <el-date-picker
- v-model="entity.dateTime"
- clearable
- end-placeholder="缁撴潫鏃ユ湡"
- format="yyyy-MM-dd"
- range-separator="鑷�"
- size="small"
- start-placeholder="寮�濮嬫棩鏈�"
- style="width: 100%"
- type="daterange"
- value-format="yyyy-MM-dd"
- @change="refreshTable()"
- >
- </el-date-picker>
- </div>
- </div>
- <!-- 浠ヤ笅杩欎袱涓负缁勯暱瑙掕壊鐗规湁鐨� -->
- <div class="search_thing" style="width: 200px">
- <div class="search_label">鍚嶅瓧锛�</div>
- <el-input
- v-model="entity.name"
- clearable
- placeholder="璇疯緭鍏�"
- size="small"
- @keyup.enter.native="refreshTable()"
- ></el-input>
- </div>
- <div
- v-if="currentTable == 'ValueTable1'"
- class="search_thing"
- style="width: 250px"
- >
- <div class="search_label" style="width: 120px">鏍峰搧缂栧彿锛�</div>
- <el-input
- v-model="entity.sample"
- clearable
- placeholder="璇疯緭鍏�"
- size="small"
- @keyup.enter.native="refreshTable()"
- ></el-input>
- </div>
- <div
- v-if="currentTable == 'ValueTable0'"
- class="search_thing"
- style="width: 200px"
- >
- <div class="search_label">鐘舵�侊細</div>
- <el-select
- v-model="entity.state"
- placeholder="鍏ㄩ儴"
- size="small"
- @change="refreshTable()"
- >
- <el-option
- v-for="item in stateList"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </div>
- <div class="search_thing" style="padding-left: 30px; width: 100px">
- <el-button size="small" @click="refresh()">閲� 缃�</el-button>
- <el-button size="small" type="primary" @click="refreshTable()"
- >鏌� 璇�</el-button
- >
- </div>
- </div>
- <div
- style="display: flex; align-items: center; justify-content: space-between"
- >
- <el-radio-group :key="'111'" v-model="currentTable" size="small">
- <el-radio-button label="ValueTable0"> 杈呭姪宸ユ椂 </el-radio-button>
- <el-radio-button label="ValueTable1"> 浜ч噺宸ユ椂 </el-radio-button>
- </el-radio-group>
- <div style="display: flex; align-items: center">
- <p style="font-size: 14px; margin-right: 30px">
- 鎬诲伐鏃舵眹鎬伙細<span
- v-if="totalInfo"
- style="font-size: 16px; color: #3a7bfa"
- >{{
- totalInfo["浜ч噺宸ユ椂姹囨��"] + totalInfo["杈呭姪宸ユ椂姹囨��"]
- ? Number(
- totalInfo["浜ч噺宸ユ椂姹囨��"] + totalInfo["杈呭姪宸ユ椂姹囨��"]
- ).tofixed(4)
- : 0
- }}</span
- > 浜ч噺宸ユ椂姹囨�伙細<span
- v-if="totalInfo"
- style="font-size: 16px; color: #3a7bfa"
- >{{
- totalInfo["浜ч噺宸ユ椂姹囨��"]
- ? Number(totalInfo["浜ч噺宸ユ椂姹囨��"]).tofixed(4)
- : 0
- }}</span
- > 杈呭姪宸ユ椂姹囨�伙細<span
- v-if="totalInfo"
- style="font-size: 16px; color: #3a7bfa"
- >{{
- totalInfo["杈呭姪宸ユ椂姹囨��"]
- ? Number(totalInfo["杈呭姪宸ユ椂姹囨��"]).tofixed(4)
- : 0
- }}</span
- >
- </p>
- <el-button
- v-show="
- currentTable == 'ValueTable0' &&
- checkPermi(['performance:manHour:workTimeManagement:add'])
- "
- size="small"
- type="primary"
- @click="openAdd"
- >褰曞叆鏁版嵁</el-button
- >
- <el-button
- v-if="down && currentTable === 'ValueTable0'"
- :loading="outLoading"
- size="small"
- type="primary"
- @click="handleOut"
- >瀵� 鍑�</el-button
- >
- <el-button
- v-if="down && currentTable === 'ValueTable1'"
- :loading="outLoading"
- size="small"
- type="primary"
- @click="handleOut1"
- >瀵� 鍑�</el-button
- >
- <el-button
- v-show="
- currentTable == 'ValueTable0' &&
- checkPermi(['performance:manHour:workTimeManagement:add'])
- "
- size="small"
- type="primary"
- @click="openBatchCheck(1)"
- >鎵归噺鎵瑰噯</el-button
- >
- </div>
- </div>
- <div class="table">
- <lims-table
- :tableData="tableData"
- :column="column"
- :page="page"
- :tableLoading="tableLoading"
- :height="'calc(100vh - 320px)'"
- v-if="currentTable == 'ValueTable0'"
- @pagination="pagination"
- ></lims-table>
- <lims-table
- :tableData="tableData0"
- :column="column0"
- :page="page0"
- :tableLoading="tableLoading"
- :height="'calc(100vh - 320px)'"
- v-if="currentTable == 'ValueTable1'"
- @pagination="pagination0"
- ></lims-table>
- </div>
- <el-dialog
- :before-close="handleClose"
- :title="formData.id ? '缂栬緫' : '褰曞叆鏁版嵁'"
- :visible.sync="addVisible"
- width="600px"
- >
- <el-row style="display: flex; justify-content: space-around">
- <el-col :span="12">
- <el-form :model="formData" label-width="90px">
- <el-form-item label="褰曞叆鏃堕棿:">
- <el-radio-group v-model="formData.dateTime" size="small">
- <el-radio :label="getYearAndMonthAndDays() + ' 00:00:00'"
- >浠婂ぉ</el-radio
- >
- <el-radio
- :label="
- getYearAndMonthAndDays(
- new Date(new Date().getTime() - 24 * 60 * 60 * 1000)
- ) + ' 00:00:00'
- "
- >鏄ㄥぉ</el-radio
- >
- </el-radio-group>
- </el-form-item>
- <el-form-item label="骞翠唤:">
- <el-input
- v-model="formData.year"
- disabled
- size="small"
- ></el-input>
- </el-form-item>
- <el-form-item label="鍛ㄦ:">
- <el-input
- v-model="formData.week"
- disabled
- size="small"
- ></el-input>
- </el-form-item>
- <el-form-item label="鏄熸湡:">
- <!-- <el-input v-model="formData.weekDay" size="small" disabled></el-input> -->
- <el-select
- v-model="formData.weekDay"
- disabled
- placeholder="璇烽�夋嫨"
- size="small"
- >
- <el-option
- v-for="item in weekList"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="鐝:">
- <el-input
- v-model="formData.shift"
- disabled
- size="small"
- ></el-input>
- </el-form-item>
- </el-form>
- </el-col>
- <el-col :span="12">
- <el-form :model="formData" label-width="90px">
- <el-form-item label="缂栧彿:" required>
- <el-input
- v-model="formData.number"
- size="small"
- @blur="getInfoByCode"
- ></el-input>
- </el-form-item>
- <el-form-item label="鏁伴噺:" required>
- <el-input v-model="formData.amount" size="small"></el-input>
- </el-form-item>
- <el-form-item label="鏍稿噯宸ユ椂:">
- <el-input
- v-model="formData.approvedWorkingHour"
- disabled
- size="small"
- ></el-input>
- </el-form-item>
- <el-form-item label="杈呭姪宸ユ椂:">
- <el-input
- v-model="formData.nonproductiveTime"
- disabled
- size="small"
- ></el-input>
- </el-form-item>
- <el-form-item label="杈呭姪椤圭洰:">
- <el-input
- v-model="formData.auxiliaryProject"
- disabled
- size="small"
- ></el-input>
- </el-form-item>
- </el-form>
- </el-col>
- </el-row>
- <el-form :model="formData" label-width="90px">
- <el-form-item label="杈呭姪璇存槑:">
- <el-input
- v-model="formData.remarks"
- :rows="3"
- size="small"
- type="textarea"
- ></el-input>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-row>
- <el-button @click="handleClose">鍙� 娑�</el-button>
- <el-button :loading="addLoad" type="primary" @click="submitAdd"
- >纭� 瀹�</el-button
- >
- </el-row>
- </span>
- </el-dialog>
- <!-- 鎵瑰噯寮规-->
- <el-dialog :title="title" :visible.sync="checkVisible" width="600px">
- <el-row style="display: flex; justify-content: space-around">
- <el-col :span="12">
- <el-form :model="formData0" label-width="90px">
- <el-form-item label="骞翠唤:">
- <el-input
- v-model="formData0.year"
- :disabled="title == '鎵瑰噯'"
- size="small"
- ></el-input>
- </el-form-item>
- <el-form-item label="鍛ㄦ:">
- <el-input
- v-model="formData0.week"
- :disabled="title == '鎵瑰噯'"
- size="small"
- ></el-input>
- </el-form-item>
- <el-form-item label="鏄熸湡:">
- <el-select
- v-model="formData0.weekDay"
- :disabled="title == '鎵瑰噯'"
- placeholder="璇烽�夋嫨"
- size="small"
- >
- <el-option
- v-for="item in weekList"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="濮撳悕:">
- <el-input
- v-model="formData0.name"
- disabled
- size="small"
- ></el-input>
- </el-form-item>
- <el-form-item label="鐝:">
- <el-select
- v-model="formData0.shift"
- :disabled="title == '鎵瑰噯'"
- placeholder="璇烽�夋嫨"
- size="small"
- >
- <el-option
- v-for="item in classType"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="澶嶆牳璇存槑:">
- <el-input
- v-model="formData0.reviewerRemark"
- :rows="3"
- size="small"
- type="textarea"
- ></el-input>
- </el-form-item>
- </el-form>
- </el-col>
- <el-col :span="12">
- <el-form :model="formData0" label-width="90px">
- <el-form-item label="缂栧彿:" required>
- <el-input
- v-model="formData0.number"
- :disabled="title == '鎵瑰噯'"
- size="small"
- ></el-input>
- </el-form-item>
- <el-form-item label="鏁伴噺:" required>
- <el-input
- v-model="formData0.amount"
- :disabled="title == '鎵瑰噯'"
- size="small"
- ></el-input>
- </el-form-item>
- <el-form-item label="澶嶆牳鏁伴噺:" required>
- <el-input
- v-model="formData0.reviewerNumber"
- size="small"
- ></el-input>
- </el-form-item>
- <el-form-item label="鏍稿噯宸ユ椂:">
- <el-input
- v-model="formData0.approvedWorkingHour"
- disabled
- size="small"
- ></el-input>
- </el-form-item>
- <el-form-item label="澶嶆牳宸ユ椂:">
- <el-input
- v-model="formData0.reviewerNonproductiveTime"
- disabled
- size="small"
- ></el-input>
- </el-form-item>
- <el-form-item label="杈呭姪椤圭洰:">
- <el-input
- v-model="formData0.auxiliaryProject"
- disabled
- size="small"
- ></el-input>
- </el-form-item>
- </el-form>
- </el-col>
- </el-row>
- <span slot="footer" class="dialog-footer">
- <el-row>
- <el-button :loading="checkLoadN" @click="submitCheck(0)"
- >涓嶆壒鍑�</el-button
- >
- <el-button
- :loading="checkLoadY"
- type="primary"
- @click="submitCheck(1)"
- >鎵� 鍑�</el-button
- >
- </el-row>
- </span>
- </el-dialog>
- <el-dialog
- :before-close="closeBatchCheckDialog"
- :title="batchCheckTitle"
- :visible.sync="batchCheckDialog"
- width="30%"
- >
- <span>{{ batchCheckDialogMessage }}</span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="batchCheck(0)">涓嶆壒鍑�</el-button>
- <el-button type="primary" @click="batchCheck(1)">鎵� 鍑�</el-button>
- </span>
- </el-dialog>
- </div>
-</template>
-
-<script>
-import ValueTable from "@/components/Table/value-table.vue";
-import { getYearAndMonthAndDays } from "@/utils/date";
-import {
- selectAuxiliaryWorkingHoursDay,
- selectAuxiliaryOutputWorkingHours,
- deleteAuxiliaryWorkingHoursDay,
- insertAuxiliaryWorkingHoursDay,
- updateAuxiliaryWorkingHoursDay,
- approve,
- collectWorkingHours,
- selectshiftByUser,
- selectAuxiliaryWorkingHoursByNumber,
- exportAssistantHours,
- exportOutputHours,
-} from "@/api/performance/manHour";
-import limsTable from "@/components/Table/lims-table.vue";
-import { checkPermi } from "@/utils/permission"; // 鏉冮檺鍒ゆ柇鍑芥暟
-export default {
- components: {
- ValueTable,
- limsTable,
- },
- dicts: ["sys_class_type"],
- data() {
- return {
- entity: {
- dateTime: [],
- },
- down: false,
- addFileVisible: false,
- weekList: [
- { label: "鍛ㄤ竴", value: "鍛ㄤ竴", type: "primary" },
- { label: "鍛ㄤ簩", value: "鍛ㄤ簩", type: "primary" },
- { label: "鍛ㄤ笁", value: "鍛ㄤ笁", type: "primary" },
- { label: "鍛ㄥ洓", value: "鍛ㄥ洓", type: "primary" },
- { label: "鍛ㄤ簲", value: "鍛ㄤ簲", type: "primary" },
- { label: "鍛ㄥ叚", value: "鍛ㄥ叚", type: "primary" },
- { label: "鍛ㄦ棩", value: "鍛ㄦ棩", type: "primary" },
- ],
- currentTable: "ValueTable0",
- addVisible: false,
- addLoad: false,
- formData: {
- dateTime: getYearAndMonthAndDays() + " 00:00:00",
- year: new Date().getFullYear(),
- week: this.getCurrentWeekNumber(),
- weekDay: this.getWeek(),
- shift: "",
- number: "",
- amount: "",
- approvedWorkingHour: "", // 鏍稿噯宸ユ椂
- nonproductiveTime: "",
- auxiliaryProject: "",
- remarks: "",
- },
- formData0: {
- dateTime: 0,
- year: new Date().getFullYear(),
- week: this.getCurrentWeekNumber(),
- weekDay: this.getWeek(),
- createUser: "",
- shift: "",
- number: "",
- reviewerNumber: "", // 澶嶆牳鏁伴噺
- approvedWorkingHour: "", // 鏍稿噯宸ユ椂
- reviewerNonproductiveTime: "", // 澶嶆牳宸ユ椂
- auxiliaryProject: "",
- reviewerRemark: "",
- nameUser: "",
- name: "",
- },
- checkVisible: false,
- checkLoadN: false,
- checkLoadY: false,
- title: "鎵瑰噯",
- classType: [],
- stateList: [
- {
- value: "宸叉彁浜�",
- label: "宸叉彁浜�",
- },
- {
- value: "宸插鏍�",
- label: "宸插鏍�",
- },
- {
- value: "宸叉壒鍑�",
- label: "宸叉壒鍑�",
- },
- {
- value: "涓嶆壒鍑�",
- label: "涓嶆壒鍑�",
- },
- ],
- totalInfo: null,
- auxiliaryWorking: null,
- outLoading: false,
- batchCheckTitle: "鎵归噺瀹℃牳",
- batchCheckDialog: false,
- ValueTable0Selected: [],
- batchCheckDialogMessage: "",
- tableData: [],
- column: [
- { label: "濮撳悕", prop: "name" },
- { label: "缂栧彿", prop: "number" },
- { label: "杈呭姪椤圭洰鍚嶇О", prop: "auxiliaryProject", width: "120px" },
- {
- label: "鐘舵��",
- prop: "state",
- dataType: "tag",
- formatType: (params) => {
- if (params == "宸叉彁浜�") {
- return "primary";
- } else if (params == "宸插鏍�") {
- return "warning";
- } else if (params == "宸叉壒鍑�") {
- return "success";
- } else if (params == "涓嶆壒鍑�") {
- return "danger";
- }
- },
- },
- { label: "鏍稿噯宸ユ椂", prop: "approvedWorkingHour" },
- { label: "鏁伴噺", prop: "amount" },
- { label: "杈呭姪宸ユ椂", prop: "nonproductiveTime" },
- { label: "杈呭姪璇存槑", prop: "remarks" },
- { label: "澶嶆牳浜�", prop: "reviewer" },
- { label: "澶嶆牳鏁伴噺", prop: "reviewerNumber" },
- { label: "澶嶆牳宸ユ椂", prop: "reviewerNonproductiveTime" },
- { label: "澶嶆牳璇存槑", prop: "reviewerRemark" },
- { label: "骞�", prop: "year" },
- {
- label: "鐝",
- prop: "shift",
- dataType: "tag",
- formatData: this.shifList,
- },
- { label: "鍛ㄦ", prop: "week" },
- { label: "鏄熸湡", prop: "weekDay" },
- { label: "鍒涘缓鏃堕棿", prop: "createTime" },
- { label: "鏃ユ湡", prop: "dateTime" },
- {
- dataType: "action",
- fixed: "right",
- label: "鎿嶄綔",
- width: "160px",
- operation: [
- {
- name: "缂栬緫",
- type: "text",
- clickFun: (row) => {
- this.handleEdit(row);
- },
- showHide: (row) => {
- return this.checkPermi([
- "performance:manHour:workTimeManagement:edit",
- ]);
- },
- disabled: (row) => {
- return row.state === "宸叉壒鍑�";
- },
- },
- {
- name: "鍒犻櫎",
- type: "text",
- clickFun: (row) => {
- this.handleDelete(row);
- },
- showHide: (row) => {
- return this.checkPermi([
- "sperformance:manHour:workTimeManagement:del",
- ]);
- },
- disabled: (row) => {
- return row.state === "宸叉壒鍑�";
- },
- },
- {
- name: "鎵瑰噯",
- type: "text",
- clickFun: (row) => {
- this.handleRatify(row);
- },
- showHide: (row) => {
- return this.checkPermi([
- "performance:manHour:workTimeManagement:ratify",
- ]);
- },
- disabled: (row) => {
- return row.state === "宸叉壒鍑�";
- },
- },
- ],
- },
- ],
- page: {
- total: 0,
- size: 10,
- current: 0,
- },
- tableLoading: false,
- tableData0: [],
- column0: [
- { label: "妫�娴嬩汉", prop: "name" },
- { label: "妫�娴嬮」鍒嗙被", prop: "inspectionItemClass" },
- { label: "妫�娴嬮」", prop: "inspectionItem" },
- { label: "妫�娴嬪瓙椤�", prop: "inspectionItemSubclass" },
- { label: "鏍峰搧缂栧彿", prop: "sample" },
- { label: "濮旀墭鍗曞彿", prop: "orderNo" },
- { label: "鐢电紗鏍囪瘑", prop: "cableTag" },
- { label: "浜ч噺宸ユ椂", prop: "outputWorkTime" },
- { label: "宸ユ椂鍒嗙粍", prop: "manHourGroup" },
- { label: "鍗曚环", prop: "price" },
- { label: "鏃ユ湡", prop: "dateTime" },
- { label: "鍛ㄦ", prop: "week" },
- { label: "鏄熸湡", prop: "weekDay" },
- ],
- page0: {
- total: 0,
- size: 10,
- current: 0,
- },
- shifList: [],
- };
- },
- watch: {
- "formData.dateTime"(val) {
- if (val == getYearAndMonthAndDays() + " 00:00:00") {
- this.formData.year = new Date().getFullYear();
- this.formData.week = this.getCurrentWeekNumber();
- this.formData.weekDay = this.getWeek();
- } else {
- var today = new Date(); // 鑾峰彇褰撳墠鏃ユ湡
- var yesterday = new Date(today); // 澶嶅埗褰撳墠鏃ユ湡
- yesterday.setDate(today.getDate() - 1); // 璁剧疆涓哄墠涓�澶�
- var timestamp = new Date(yesterday.getTime());
- this.formData.year = timestamp.getFullYear();
- this.formData.week = this.getCurrentWeekNumber(timestamp);
- this.formData.weekDay = this.getWeek(timestamp);
- }
- },
- "formData.amount"(val) {
- if (val) {
- if (!isNaN(val)) {
- if (this.formData.approvedWorkingHour) {
- this.formData.nonproductiveTime =
- this.formData.approvedWorkingHour * val;
- }
- } else {
- this.$message.error("璇疯緭鍏ユ暟瀛�");
- this.formData.amount = "";
- }
- }
- },
- "formData.approvedWorkingHour"(val) {
- if (val && this.formData.amount) {
- this.formData.nonproductiveTime = this.formData.amount * val;
- }
- },
- "formData0.reviewerNumber"(val) {
- if (val) {
- if (!isNaN(val)) {
- if (this.formData0.approvedWorkingHour) {
- this.formData0.reviewerNonproductiveTime =
- this.formData0.approvedWorkingHour * val;
- }
- } else {
- this.$message.error("璇疯緭鍏ユ暟瀛�");
- this.formData0.reviewerNumber = "";
- }
- }
- },
- "formData0.approvedWorkingHour"(val) {
- if (val && this.formData0.reviewerNumber) {
- this.formData0.reviewerNonproductiveTime =
- this.formData0.reviewerNumber * val;
- }
- },
- },
- created() {
- this.setDate();
- this.getDicts("sys_class_type").then((response) => {
- this.shifList = response.data;
- });
- },
- mounted() {
- this.getCurrentWeekNumber();
- this.collectWorkingHours();
- this.selectshiftByUser();
- this.getList();
- this.getList0();
- },
- methods: {
- checkPermi,
- getList(entity) {
- this.tableLoading = true;
- let param = {};
- if (entity) {
- param = { ...entity, ...this.page };
- } else {
- param = { ...this.entity, ...this.page };
- }
- delete param.total;
- selectAuxiliaryWorkingHoursDay({ ...param })
- .then((res) => {
- this.tableLoading = false;
- if (res.code === 200) {
- this.tableData = res.data.records;
- this.page.total = res.data.total;
- }
- })
- .catch((err) => {
- this.tableLoading = false;
- });
- },
- getList0(entity) {
- this.tableLoading = true;
- let param = {};
- if (entity) {
- param = { ...entity, ...this.page0 };
- } else {
- param = { ...this.entity, ...this.page0 };
- }
- delete param.total;
- selectAuxiliaryOutputWorkingHours({ ...param })
- .then((res) => {
- this.tableLoading = false;
- if (res.code === 200) {
- this.tableData0 = res.data.records;
- this.page0.total = res.data.total;
- }
- })
- .catch((err) => {
- this.tableLoading = false;
- });
- },
- pagination(current, size) {
- this.page.current = current;
- this.getList();
- },
- pagination0(current, size) {
- this.page0.current = current;
- this.getList();
- },
- /** 灏嗘椂闂撮�夋嫨鍣ㄩ粯璁ら�変负褰撳ぉ鐨勬棩鏈� */
- setDate() {
- let currentDate = new Date();
- let year = currentDate.getFullYear();
- let month = String(currentDate.getMonth() + 1).padStart(2, "0");
- let day = String(currentDate.getDate()).padStart(2, "0");
- let formattedDate1 = `${year}-${month}-${day}`;
- let formattedDate2 = `${year}-${month}-${day}`;
- this.entity.dateTime.push(formattedDate1);
- this.entity.dateTime.push(formattedDate2);
- this.refreshTable();
- },
- getYearAndMonthAndDays(date) {
- return getYearAndMonthAndDays(date);
- },
- refreshTable(e) {
- let entity = {};
- if (this.entity.week1 && this.entity.week2) {
- entity.week = JSON.stringify([this.entity.week1, this.entity.week2]);
- } else {
- entity.week = "";
- }
- if (this.entity.dateTime) {
- entity.dateTime = JSON.stringify(this.entity.dateTime);
- } else {
- entity.dateTime = "";
- }
- entity.weekDay = this.entity.weekDay;
- entity.name = this.entity.name;
- entity.sample = this.entity.sample;
- if (this.currentTable == "ValueTable0") {
- entity.state = this.entity.state;
- this.page.current = 1;
- this.getList(entity);
- } else {
- this.page0.current = 1;
- this.getList0(entity);
- }
- this.collectWorkingHours();
- },
- refresh() {
- this.entity = {};
- this.refreshTable();
- },
- openAdd() {
- this.formData = {
- dateTime: getYearAndMonthAndDays() + " 00:00:00",
- year: new Date().getFullYear(),
- week: this.getCurrentWeekNumber(),
- weekDay: this.getWeek(),
- shift: "",
- number: "",
- amount: "",
- approvedWorkingHour: "",
- nonproductiveTime: "",
- auxiliaryProject: "",
- remarks: "",
- };
- this.addVisible = true;
- },
- handleEdit(row) {
- this.formData = row;
- this.addVisible = true;
- },
- handleDelete(row) {
- this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- deleteAuxiliaryWorkingHoursDay({ id: row.id }).then((res) => {
- if (res.code == 201) return;
- this.$message.success("鍒犻櫎鎴愬姛");
- this.refreshTable("page");
- });
- })
- .catch(() => {});
- },
- handleClose() {
- this.addVisible = false;
- },
- submitAdd() {
- if (!this.formData.number) {
- this.$message.error("璇疯緭鍏ョ紪鍙�");
- return;
- }
- if (!this.formData.amount) {
- this.$message.error("璇疯緭鍏ユ暟閲�");
- return;
- }
- this.addLoad = true;
- if (!this.formData.id) {
- insertAuxiliaryWorkingHoursDay(this.formData).then((res) => {
- this.addLoad = false;
- if (res.code == 201) return;
- this.$message.success("宸叉彁浜�");
- this.formData.number = "";
- this.formData.amount = "";
- this.formData.remarks = "";
- this.formData.approvedWorkingHour = "";
- this.formData.nonproductiveTime = "";
- this.formData.auxiliaryProject = "";
- this.addVisible = false;
- this.refreshTable("page");
- this.collectWorkingHours();
- });
- } else {
- updateAuxiliaryWorkingHoursDay(this.formData).then((res) => {
- this.addLoad = false;
- if (res.code == 201) return;
- this.$message.success("鎿嶄綔鎴愬姛");
- this.formData.number = "";
- this.formData.amount = "";
- this.formData.remarks = "";
- this.formData.approvedWorkingHour = "";
- this.formData.nonproductiveTime = "";
- this.formData.auxiliaryProject = "";
- this.refreshTable("page");
- this.collectWorkingHours();
- });
- }
- },
- handleRatify(row) {
- this.title = "鎵瑰噯";
- this.formData0 = row;
- this.checkVisible = true;
- this.formData0.reviewerNumber = this.formData0.amount;
- if (this.formData0.approvedWorkingHour && this.formData0.reviewerNumber) {
- this.formData0.reviewerNonproductiveTime =
- this.formData0.approvedWorkingHour * this.formData0.reviewerNumber;
- }
- },
- handleChangeTask(row) {
- this.ValueTable0Selected = JSON.parse(JSON.stringify(row));
- },
- openBatchCheck(e) {
- if (this.ValueTable0Selected.length > 0) {
- const isApprove = this.ValueTable0Selected.every(
- (item) => item.state !== "宸叉壒鍑�"
- );
- this.batchCheckTitle = "鎵归噺鎵瑰噯";
- this.batchCheckDialogMessage = "鏄惁鍏ㄩ儴閫氳繃鎵瑰噯?";
- if (isApprove) {
- this.batchCheckDialog = true;
- } else {
- this.$message.error("璇烽�夋嫨鏈壒鍑嗙殑鏁版嵁");
- }
- } else {
- this.$message.error("璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�");
- }
- },
- batchCheck(e) {
- this.$refs.ValueTable0.batchCheck(e);
- },
- closeBatchCheckDialog() {
- this.batchCheckDialog = false;
- },
- submitBatchCheckDialog() {
- this.batchCheckDialog = false;
- this.refreshTable("page");
- this.collectWorkingHours();
- },
- submitCheck(e) {
- if (!this.formData0.number) {
- this.$message.error("璇疯緭鍏ョ紪鍙�");
- return;
- }
- if (!this.formData0.amount) {
- this.$message.error("璇疯緭鍏ユ暟閲�");
- return;
- }
- if (e == 0) {
- this.checkLoadN = true;
- } else {
- this.checkLoadY = true;
- }
- this.formData0.state = e == 0 ? "涓嶆壒鍑�" : "宸叉壒鍑�";
- approve({
- auxiliaryWorkingHoursDays: [this.formData0],
- }).then((res) => {
- if (e == 0) {
- this.checkLoadN = false;
- } else {
- this.checkLoadY = false;
- }
- if (res.code == 201) return;
- this.$message.success("鎿嶄綔鎴愬姛");
- this.checkVisible = false;
- this.refreshTable("page");
- this.collectWorkingHours();
- });
- },
- getCurrentWeekNumber(now = new Date()) {
- const startOfWeek = new Date(
- now.getFullYear(),
- now.getMonth(),
- now.getDate() - now.getDay()
- ); // 鍛ㄥぉ
- const firstWeekOfYear = new Date(startOfWeek.getFullYear(), 0, 0); // 褰撳勾鐨勭涓�涓懆澶�
- const firstWeekOfNextYear = new Date(
- firstWeekOfYear.getFullYear() + 1,
- 0,
- 0
- ); // 涓嬩竴骞寸殑绗竴涓懆澶�
- const daysSinceNewYear =
- (startOfWeek - firstWeekOfYear) / (24 * 60 * 60 * 1000); // 璁$畻鑷柊骞翠互鏉ョ殑澶╂暟
- const weeksSinceNewYear = Math.floor(daysSinceNewYear / 7); // 澶╂暟闄や互7寰楀埌鍛ㄦ暟
-
- if (startOfWeek > now) {
- // 濡傛灉褰撳墠鍛ㄧ殑鍛ㄥぉ杩樻病鍒帮紝鍒欒繑鍥炰笂骞寸殑鏈�鍚庝竴鍛�
- return weeksSinceNewYear;
- } else if (firstWeekOfNextYear <= now) {
- // 濡傛灉褰撳墠鍛ㄧ殑鍛ㄥぉ宸茬粡杩囦簡锛屽垯杩斿洖褰撳勾鐨勫懆鏁�
- return weeksSinceNewYear + 1;
- } else {
- // 鍚﹀垯杩斿洖褰撳勾鐨勬渶鍚庝竴鍛�
- return weeksSinceNewYear + 2;
- }
- },
- getWeek(e = new Date()) {
- // let str = '鏃ヤ竴浜屼笁鍥涗簲鍏�'
- let d = e.getDay();
- // let c = str.charAt(d)
- // return `鍛�${c}`
- return String(d);
- },
- // 缁熻浜ч噺宸ユ椂姹囨�诲拰杈呭姪宸ユ椂姹囨��
- collectWorkingHours() {
- let entity = {};
- if (this.entity.week1 && this.entity.week2) {
- entity.week = JSON.stringify([this.entity.week1, this.entity.week2]);
- } else {
- entity.week = "";
- }
- if (this.entity.dateTime) {
- entity.dateTime = JSON.stringify(this.entity.dateTime);
- } else {
- entity.dateTime = "";
- }
- entity.weekDay = this.entity.weekDay;
- entity.name = this.entity.name;
- collectWorkingHours({ entity: entity }).then((res) => {
- this.totalInfo = res.data;
- });
- },
- selectshiftByUser() {
- selectshiftByUser().then((res) => {
- this.formData.shift = res.data;
- });
- },
- getInfoByCode() {
- if (this.formData.number) {
- selectAuxiliaryWorkingHoursByNumber(this.formData.number).then(
- (res) => {
- this.auxiliaryWorking = res.data;
- if (this.addVisible) {
- this.formData.approvedWorkingHour =
- this.auxiliaryWorking.approvedWorkingHour;
- this.formData.auxiliaryProject =
- this.auxiliaryWorking.auxiliaryProject;
- } else if (this.title == "瀹℃牳" && this.checkVisible) {
- this.formData0.approvedWorkingHour =
- this.auxiliaryWorking.approvedWorkingHour;
- this.formData0.auxiliaryProject =
- this.auxiliaryWorking.auxiliaryProject;
- }
- }
- );
- }
- },
- handleOut() {
- let entity = this.HaveJson(this.entity);
- if (this.entity.dateTime) {
- entity.dateTime = JSON.stringify(this.entity.dateTime);
- } else {
- entity.dateTime = "";
- }
- this.outLoading = true;
- exportAssistantHours({ entity: entity })
- .then((res) => {
- this.outLoading = false;
- this.$message.success("瀵煎嚭鎴愬姛");
- const blob = new Blob([res]);
- this.$download.saveAs(blob, "杈呭姪宸ユ椂淇℃伅瀵煎嚭.xlsx");
- })
- .catch((err) => {
- this.outLoading = false;
- });
- },
- handleOut1() {
- let entity = this.HaveJson(this.entity);
- if (this.entity.dateTime) {
- entity.dateTime = JSON.stringify(this.entity.dateTime);
- } else {
- entity.dateTime = "";
- }
- this.outLoading = true;
- exportOutputHours({ entity: entity })
- .then((res) => {
- this.outLoading = false;
- this.$message.success("瀵煎嚭鎴愬姛");
- const blob = new Blob([res]);
- this.$download.saveAs(blob, "浜ч噺宸ユ椂淇℃伅瀵煎嚭.xlsx");
- })
- .catch((err) => {
- this.outLoading = false;
- });
- },
- },
-};
-</script>
-
-<style scoped>
-.work-time-management {
- height: 100%;
- overflow-y: scroll;
- padding: 20px;
- padding-top: 0;
- /* scrollbar-width: none; */
-}
-/* .work-time-management::-webkit-scrollbar {
- display: none;
-} */
-.search {
- background-color: #fff;
- height: 80px;
- display: flex;
- align-items: center;
-}
-
-.search_thing {
- width: 300px;
- display: flex;
- align-items: center;
-}
-
-.search_label {
- width: 70px;
- font-size: 14px;
- text-align: right;
-}
-
-.search_input {
- width: calc(100% - 70px);
-}
-</style>
diff --git a/src/views/performance/manHour/workTimeStatistics.vue b/src/views/performance/manHour/workTimeStatistics.vue
deleted file mode 100644
index 4425caf..0000000
--- a/src/views/performance/manHour/workTimeStatistics.vue
+++ /dev/null
@@ -1,176 +0,0 @@
-<template>
- <div>
- <div>
- <div class="search">
- <div class="search_thing">
- <div class="search_label">鏃ユ湡锛�</div>
- <div class="search_input" style="display: flex; align-items: center">
- <el-date-picker
- v-model="queryParams.month"
- :clearable="false"
- format="yyyy-MM"
- placeholder="閫夋嫨鏈�"
- size="small"
- style="width: 100%"
- type="month"
- value-format="yyyy-MM"
- @change="refreshTable()"
- >
- </el-date-picker>
- </div>
- </div>
- <div class="search_thing">
- <div class="search_label">鍛樺伐锛�</div>
- <el-input
- v-model="queryParams.name"
- clearable
- placeholder="璇疯緭鍏�"
- size="small"
- @keyup.enter.native="refreshTable()"
- ></el-input>
- </div>
- <div class="search_thing" style="padding-left: 30px">
- <el-button size="small" @click="refresh()">閲� 缃�</el-button>
- <el-button size="small" type="primary" @click="refreshTable()"
- >鏌� 璇�</el-button
- >
- </div>
- </div>
- <div class="table">
- <TableCard :showForm="false" :showTitle="false">
- <template v-slot:table>
- <limsTable
- :column="tableColumn"
- :table-data="tableData"
- :table-loading="tableLoading"
- :page="page"
- style="padding: 0 15px"
- >
- </limsTable>
- </template>
- </TableCard>
- </div>
- </div>
- </div>
-</template>
-
-<script>
-import { getYearAndMonthAndDays } from "@/utils/date";
-import TableCard from "@/components/TableCard/index.vue";
-import limsTable from "@/components/Table/lims-table.vue";
-import { selectAuxiliaryAllByMonth } from "@/api/performance/manHour";
-export default {
- components: {
- limsTable,
- TableCard,
- },
- data() {
- return {
- queryParams: {
- month: getYearAndMonthAndDays().slice(0, 7),
- name: "",
- departLims: "",
- },
- tableColumn: [
- {
- label: "濮撳悕",
- minWidth: "120px",
- prop: "userName",
- },
- {
- label: "鏈堜唤",
- minWidth: "120px",
- prop: "month",
- },
- {
- label: "浜ч噺宸ユ椂",
- minWidth: "120px",
- prop: "yieldHour",
- },
- {
- label: "杈呭姪宸ユ椂",
- minWidth: "120px",
- prop: "subsidiaryHour",
- },
- {
- label: "鎬诲伐鏃�",
- minWidth: "120px",
- prop: "totalHour",
- },
- ],
- tableData: [],
- tableLoading: false,
- page: {
- total: 0,
- size: 10,
- current: 0,
- },
- };
- },
- mounted() {
- this.refreshTable();
- },
- methods: {
- refreshTable() {
- this.tableLoading = true;
- selectAuxiliaryAllByMonth(this.queryParams)
- .then((res) => {
- this.tableLoading = false;
- if (res.code === 201) return;
- this.tableData = res.data;
- })
- .catch(() => {
- this.tableLoading = false;
- });
- },
- refresh() {
- this.queryParams = {
- month: getYearAndMonthAndDays().slice(0, 7),
- name: "",
- departLims: "",
- };
- this.refreshTable();
- },
- // 鍒嗛〉
- handleCurrent(page) {
- this.pagination.curent = page;
- this.refreshTable();
- },
- handleSizeChange(size) {
- this.pagination.pageSize = size;
- this.refreshTable();
- },
- },
-};
-</script>
-
-<style scoped>
-.work-time-statistics {
- height: 100%;
-}
-.search {
- background-color: #fff;
- height: 80px;
- display: flex;
- align-items: center;
-}
-
-.search_thing {
- width: 270px;
- display: flex;
- align-items: center;
-}
-
-.search_label {
- width: 60px;
- font-size: 14px;
- text-align: right;
-}
-
-.search_input {
- width: calc(100% - 60px);
-}
-.table {
- height: calc(100% - 60px - 80px - 10px - 40px - 25px);
-}
-</style>
--
Gitblit v1.9.3