| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 |
| | | }) |
| | | } |
| | |
| | | |
| | | export function getUserList(params) { |
| | | return resquest({ |
| | | url: '/approveConfig/getUserList', |
| | | url: '/performanceShift/getUserList', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | |
| | | }) |
| | | } |
| | | |
| | | export function downReport(params) { |
| | | return resquest({ |
| | | url: '/insReport/downReport', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | export function upReportUrl(data) { |
| | | return resquest({ |
| | | url: '/insReport/upReportUrl', |
| | |
| | | return resquest({ |
| | | url: '/insReport/examineReport', |
| | | method: 'post', |
| | | data: data |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | |
| | | return resquest({ |
| | | url: '/insReport/ratifyReport', |
| | | method: 'post', |
| | | data: data |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | |
| | | export function downReport(params) { |
| | | return resquest({ |
| | | url: '/insReport/downReport', |
| | | method: 'get', |
| | | params: params, |
| | | responseType: 'blob' |
| | | }) |
| | | } |
| | |
| | | props: { |
| | | isSelection: { |
| | | type: Boolean, |
| | | default: false, |
| | | default: undefined, |
| | | }, |
| | | height: { |
| | | type: String, |
| | |
| | | }, |
| | | rowKey: { |
| | | type: String, |
| | | default: undefined, |
| | | default: "id", |
| | | }, |
| | | page: { |
| | | type: Object, |
| | |
| | | }; |
| | | }, |
| | | watch: { |
| | | column(val) { |
| | | this.doLayout(); |
| | | }, |
| | | // column(val) { |
| | | // this.doLayout(); |
| | | // }, |
| | | }, |
| | | mounted() { |
| | | this.calculateSpanInfo(); |
| | |
| | | s_url === requestObj.url |
| | | ) { |
| | | const message = "æ°æ®æ£å¨å¤çï¼è¯·å¿éå¤æäº¤"; |
| | | console.log('éå¤ç请æ±',sessionObj.url); |
| | | console.warn(`[${s_url}]: ` + message); |
| | | return Promise.reject(new Error(message)); |
| | | } else { |
| | |
| | | insSampleId: row.insSampleId, |
| | | entrustCode: row.entrustCode, |
| | | sampleCode: row.sampleCode, |
| | | inspectionItemSubclass: row.inspectionItemSubclass, |
| | | }; |
| | | this.$axios |
| | | .post(this.$api.insOrder.viewDetails, data, { |
| | |
| | | </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> |
| | |
| | | </p> |
| | | </div> |
| | | <lims-table |
| | | :handleSelectionChange="handleSelectionChange" |
| | | isSelection |
| | | :tableData="tableData" |
| | | :column="column" |
| | | :tableLoading="tableLoading" |
| | |
| | | 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: { |
| | |
| | | { |
| | | name: "ä¸ä¼ ", |
| | | type: "upload", |
| | | url: "/file/attachmentType/upload", |
| | | url: "/insReport/inReport", |
| | | data: (row) => { |
| | | return { |
| | | id: row.id, |
| | | type: 1, |
| | | }; |
| | | }, |
| | | uploadIdFun: (row) => { |
| | |
| | | }, |
| | | computed: { |
| | | headers() { |
| | | let token = getToken(); |
| | | return { |
| | | token: sessionStorage.getItem("token"), |
| | | authorization: token, |
| | | }; |
| | | }, |
| | | action() { |
| | | return ""; |
| | | return this.javaApi + "/insReport/upAll"; |
| | | }, |
| | | }, |
| | | created() { |
| | |
| | | }, |
| | | // æ¤å å¼¹æ¡ |
| | | withdraw(row) { |
| | | getLaboratoryByReportId(row.id).then((res) => { |
| | | getLaboratoryByReportId({ id: row.id }).then((res) => { |
| | | this.laboratorys = res.data; |
| | | this.reportId = row.id; |
| | | this.withdrawDialogVisible = true; |
| | |
| | | withdraw(data).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("æ¤åæå"); |
| | | this.laboratory = []; |
| | | this.withdrawDialogVisible = false; |
| | | this.refresh(); |
| | | } |
| | |
| | | getAuthorizedPerson() { |
| | | getUserList() |
| | | .then((res) => { |
| | | console.log('res',res); |
| | | this.personList = res.data; |
| | | }) |
| | | .catch((error) => { |
| | |
| | | handleChange(arr) { |
| | | this.mutiList = arr; |
| | | }, |
| | | handleSelectionChange(val) { |
| | | this.mutiList = val; |
| | | console.log(`output->val`, val); |
| | | }, |
| | | handleDowns() { |
| | | if (this.mutiList.length == 0) { |
| | | this.$message.error("è¯·éæ©æ¥å"); |
| | |
| | | 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(); |
| | |
| | | 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"); |
| | | 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.download = row.code; |
| | | link.target = "_blank"; |
| | | link.download = fileName; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | URL.revokeObjectURL(url); |
| | | }) |
| | | .catch((error) => { |
| | | this.$message.error(error); |
| | | }); |
| | | } else { |
| | | this.$message.error("æªæ¾å°æä»¶"); |
| | | } |
| | | }); |
| | | }, |
| | | // è¿åæä½ |
| | |
| | | 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, |
| | |
| | | }, |
| | | 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, |
| | |
| | | this.loadingApproveReason = true; |
| | | examineReport({ |
| | | id: this.currentInfo.id, |
| | | isRatify: 0, |
| | | ratifyTell: this.reason, |
| | | isExamine: 0, |
| | | examineTell: this.reason, |
| | | }) |
| | | .then((res) => { |
| | | this.loadingApproveReason = false; |
| | |
| | | <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> |
| | |
| | | </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", |
| | | }; |
| | | currentComponent:'workTimeStatistics', |
| | | selectAuxiliaryOriginalHours:false, |
| | | selectAuxiliaryOutputWorkingHours:false, |
| | | insertAuxiliaryWorkingHours:false |
| | | } |
| | | }, |
| | | methods: { |
| | | checkPermi, |
| | | }, |
| | | }; |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped></style> |
| | | <style scoped> |
| | | |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <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() { |
| | | //å½åªæäº§éå·¥æ¶tab页æ¶ï¼å½å页æ¹ä¸ºäº§éå·¥æ¶é¡µ |
| | | 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> |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | | |