src/views/mdc/base/EfficiencyPunchReport.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/mdc/base/modules/EfficiencyPunchReport/EfficiencyPunchReportModal.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
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> 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>