From 8ab803dcaf5fb415ba865b02320cff63a7aba0f5 Mon Sep 17 00:00:00 2001 From: Houjie <714924425@qq.com> Date: 星期五, 13 六月 2025 10:52:48 +0800 Subject: [PATCH] 设备打卡率报表-页面 --- src/views/mdc/base/EfficiencyPunchReport.vue | 216 +++++++++++++++++++++++++++ src/views/mdc/base/modules/EfficiencyPunchReport/EfficiencyPunchReportModal.vue | 214 ++++++++++++++++++++++++++ 2 files changed, 430 insertions(+), 0 deletions(-) diff --git a/src/views/mdc/base/EfficiencyPunchReport.vue b/src/views/mdc/base/EfficiencyPunchReport.vue new file mode 100644 index 0000000..e90b63d --- /dev/null +++ b/src/views/mdc/base/EfficiencyPunchReport.vue @@ -0,0 +1,216 @@ +<template> + <a-card :bordered="false"> + + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="璁板綍鏃堕棿"> + <a-date-picker format="YYYY-MM-DD" :allowClear="false" v-model="queryParam.theDate" + @change="dateParamChange"></a-date-picker> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鐝"> + <j-dict-select-tag v-model="queryParam.shiftSchedule" dictCode="shift_schedule" + placeholder="璇烽�夋嫨鐝"></j-dict-select-tag> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button type="primary" icon="download" @click="handleExportXls('璁惧鎵撳崱鐜囨姤琛�')">瀵煎嚭</a-button> + + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a + style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <span slot="action" slot-scope="text, record"> + <a @click="handleDetail(record)">璇︽儏</a> + </span> + </a-table> + </div> + <!-- table鍖哄煙-end --> + <efficiency-punch-report-modal ref="modalForm" @ok="modalFormOk"></efficiency-punch-report-modal> + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' + +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import EfficiencyPunchReportModal from '@views/mdc/base/modules/EfficiencyPunchReport/EfficiencyPunchReportModal.vue' + +export default { + name: 'EfficiencyPunchReport', + mixins: [JeecgListMixin], + components: { + EfficiencyPunchReportModal + }, + data() { + return { + queryParam: { + theDate: this.formatDate(new Date(new Date().setDate(new Date().getDate() - 1))), // 榛樿璁剧疆涓烘槰澶� + shiftSchedule: '' + }, + + dataSource: [], // 纭繚鍒濆鍖栦负绌烘暟缁� + description: '璁惧鎵撳崱鐜�', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + + { + title: '璁板綍鏃堕棿', + align: 'center', + dataIndex: 'theDate' + }, + { + title: '鐝', + align: 'center', + dataIndex: 'shiftSchedule_dictText' + }, + + { + title: '鏃╃彮涓婄彮鎵撳崱璁惧鏁伴噺', + align: 'center', + dataIndex: 'mornShiftInNum' + }, + { + title: '鏃╀笅鐝墦鍗¤澶囨暟閲�', + align: 'center', + dataIndex: 'mornShiftOutNum' + }, + { + title: '鏅氱彮涓婄彮鎵撳崱璁惧鏁伴噺', + align: 'center', + dataIndex: 'evenShiftInNum' + }, + { + title: '鏅氱彮涓嬬彮鎵撳崱璁惧鏁伴噺', + align: 'center', + dataIndex: 'evenShiftOutNum' + }, + { + title: '璁惧鎬绘暟', + align: 'center', + dataIndex: 'deviceCountNum' + }, + { + title: '鏃╃彮涓婄彮鎵撳崱鐜�(%)', + align: 'center', + dataIndex: 'mornShiftInRate' + }, + { + title: '鏃╃彮涓嬬彮鎵撳崱鐜�(%)', + align: 'center', + dataIndex: 'mornShiftOutRate' + + }, + { + title: '鏅氱彮涓婄彮鎵撳崱鐜�(%)', + align: 'center', + dataIndex: 'evenShiftInRate', + customRender: (text) => { + if (text !== null && text !== undefined) { + return parseFloat(text).toFixed(2); + } + return text; + } + }, + { + title: '鏅氱彮涓嬬彮鎵撳崱鐜�(%)', + align: 'center', + dataIndex: 'evenShiftOutRate' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: '/mdcEquipmentPunchRate/queryPageList', + exportXlsUrl: '/mdcEquipmentPunchRate/exportXls' + } + } + }, + methods: { + searchQuery() { + if (this.queryParam.theDate) { + // 纭繚 queryParam.recordDate 鏄竴涓湁鏁堢殑 Date 瀵硅薄 + const date = new Date(this.queryParam.recordDate) + if (!isNaN(date.getTime())) { // 妫�鏌ユ槸鍚︿负鏈夋晥鏃ユ湡 + const formattedDate = this.formatDate(date) + this.queryParam.theDate = formattedDate + console.log('Formatted theDate:', this.queryParam.theDate) // 楠岃瘉鏍煎紡 + } else { + console.error('Invalid date format') + } + } + + this.loadData() + }, + + formatDate(date) { + const year = date.getFullYear() + const month = String(date.getMonth() + 1).padStart(2, '0') + const day = String(date.getDate()).padStart(2, '0') + return `${year}${month}${day}` + }, + + dateParamChange(value) { + // value 鏄竴涓椂鍒诲璞★紙moment object锛夛紝闇�瑕佽浆鎹负 Date 瀵硅薄 + if (value) { + const date = value.toDate() // 杞崲涓� Date 瀵硅薄 + const formattedDate = this.formatDate(date) + this.queryParam.theDate = formattedDate + } else { + this.queryParam.theDate = null + } + } + + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/mdc/base/modules/EfficiencyPunchReport/EfficiencyPunchReportModal.vue b/src/views/mdc/base/modules/EfficiencyPunchReport/EfficiencyPunchReportModal.vue new file mode 100644 index 0000000..9924fae --- /dev/null +++ b/src/views/mdc/base/modules/EfficiencyPunchReport/EfficiencyPunchReportModal.vue @@ -0,0 +1,214 @@ +<template> + <a-modal :title="title" :width="1500" :height="1500" :visible="visible" :maskClosable="false" + cancelText="鍏抽棴" + @cancel="handleCancel" :confirmLoading="confirmLoading"> + + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <a-row> + <a-col :span="12"> + <a-form-model-item label="璁板綍鏃ユ湡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="theDate"> + <a-input :disabled="true" v-model="model.theDate" placeholder="璇疯緭鍏ヨ褰曟棩鏈�"></a-input> + </a-form-model-item> + </a-col> + + <a-col :span="12"> + <a-form-model-item label="鐝" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shiftSchedule"> + <j-dict-select-tag dictCode="shift_schedule" placeholder="璇烽�夋嫨鐝" v-model="model.shiftSchedule" + :disabled="disableSubmit" /> + </a-form-model-item> + </a-col> + + <a-col :span="12"> + <a-form-model-item label="鏃╃彮涓婄彮鎵撳崱鐜�" :labelCol="labelCol" :wrapperCol="wrapperCol" + prop="mornShiftInRate"> + <a-input v-model="model.mornShiftInRate" placeholder="璇疯緭鍏�"></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鏃╃彮涓嬬彮鎵撳崱鐜�" :labelCol="labelCol" :wrapperCol="wrapperCol" + prop="mornShiftOutRate"> + <a-input v-model="model.mornShiftOutRate" placeholder="璇疯緭鍏�"></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鏅氱彮涓婄彮鎵撳崱鐜�" :labelCol="labelCol" :wrapperCol="wrapperCol" + prop="evenShiftInRate"> + <a-input v-model="model.evenShiftInRate" placeholder="璇疯緭鍏�"></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item v-show="addShow" label="鏅氱彮涓嬬彮鎵撳崱鐜�" :labelCol="labelCol" :wrapperCol="wrapperCol" + prop="evenShiftOutRate"> + <a-input v-model="model.evenShiftOutRate" placeholder="璇疯緭鍏�"></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item v-show="addShow" label="鏃╃彮涓婄彮鎵撳崱璁惧鏁伴噺" :labelCol="labelCol" :wrapperCol="wrapperCol" + prop="mornShiftInDeviceNum"> + <a-input v-model="model.mornShiftInNum" placeholder="璇疯緭鍏�"></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item v-show="addShow" label="鏃╀笅鐝墦鍗¤澶囨暟閲�" :labelCol="labelCol" :wrapperCol="wrapperCol" + prop="mornShiftOutNum"> + <a-input v-model="model.mornShiftOutNum" placeholder="璇疯緭鍏�"></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item v-show="addShow" label="鏅氱彮涓婄彮鎵撳崱璁惧鏁伴噺" :labelCol="labelCol" :wrapperCol="wrapperCol" + prop="evenShiftInNum"> + <a-input v-model="model.evenShiftInNum" placeholder="璇疯緭鍏�"></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item v-show="addShow" label="鏅氫笅鐝墦鍗¤澶囨暟閲�" :labelCol="labelCol" :wrapperCol="wrapperCol" + prop="evenShiftOutNum"> + <a-input v-model="model.evenShiftOutNum" placeholder="璇疯緭鍏�"></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item v-show="addShow" label="璁惧鎬绘暟" :labelCol="labelCol" :wrapperCol="wrapperCol" + prop="deviceCountNum"> + <a-input v-model="model.deviceCountNum" placeholder="璇疯緭鍏�"></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form> + </a-spin> + + <template slot="footer"> + <a-button :style="{ marginRight: '8px' }" @click="handleCancel()"> + 鍏抽棴 + </a-button> + +<!-- <a-button @click="handleOk()" :disabled="disableSubmit" type="primary" :loading="confirmLoading">纭畾</a-button>--> + </template> + </a-modal> + +</template> + +<script> +import JMultiSelectTag from '@/components/dict/JMultiSelectTag' +import Tooltip from 'ant-design-vue/es/tooltip' + +export default { + name: 'EfficiencyPunchReportModal', + components: { + JMultiSelectTag, + Tooltip + }, + data() { + + return { + addShow: true, + model: {}, + formDisabled: false, + pagination: { + current: 1, + pageSize: 10, + total: 0 + }, + + title: '鎿嶄綔', + visible: false, + disableSubmit: false, + codeDisable: true, + + labelCol: { + xs: { span: 24 }, + sm: { span: 6 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 18 } + }, + confirmLoading: false, + form: this.$form.createForm(this), + validatorRules: { + // orderCode: [ + // { required: true, message: '璇疯緭鍏ョ洏鐐瑰崟鍙�!' } + // ], + // handler: [ + // { required: true, message: '璇疯緭鍏ョ粡鎵嬩汉!' } + // ], + // stocktakingName: [ + // { required: true, message: '璇疯緭鍏ョ洏鐐瑰悕绉�!' } + // ], + // approvalStatus: [ + // { required: true, message: '璇疯緭鍏ュ鏍哥姸鎬�!' } + // ], + // inventoryTime: [ + // { required: true, message: '璇疯緭鍏ョ洏鐐规椂闂�!' } + // ] + }, + url: { + + + + }, + dataSource: [] + } + }, + + mounted() { + + }, + + methods: { + + add() { + this.addShow = false + this.edit() + }, + + edit(record) { + this.model = Object.assign({}, record) + this.visible = true + }, + + + + close() { + this.$emit('close') + this.visible = false + }, + + handleCancel() { + this.model = {} + this.dataSource = [] + this.close() + }, + } + +} +</script> + +<style lang="less" scoped> +.frozenRowClass { + color: #c9c9c9; +} + +.fontweight { + font-weight: bold; +} + +.ant-btn { + padding: 0 10px; + margin-left: 3px; +} + +.ant-form-item-control { + line-height: 0px; +} + +/** 涓昏〃鍗曡闂磋窛 */ +.ant-form .ant-form-item { + margin-bottom: 10px; +} + +/** Tab椤甸潰琛岄棿璺� */ +.ant-tabs-content .ant-form-item { + margin-bottom: 0px; +} +</style> \ No newline at end of file -- Gitblit v1.9.3