From 0841408cbe384a3e52acd4c91cd48685f5d3bc2b Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期二, 10 十二月 2024 15:01:24 +0800 Subject: [PATCH] 新增计划与非计划停机管理 --- src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseForm.vue | 169 ++++++++ src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseList.vue | 307 ++++++++++++++++ src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseModal.vue | 64 +++ src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseForm.vue | 171 +++++++++ src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseList.vue | 307 ++++++++++++++++ src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseModal.vue | 64 +++ 6 files changed, 1,082 insertions(+), 0 deletions(-) diff --git a/src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseForm.vue b/src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseForm.vue new file mode 100644 index 0000000..98ab80e --- /dev/null +++ b/src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseForm.vue @@ -0,0 +1,169 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="璁惧缁�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentIds"> + <a-input-search :readOnly="true" v-model="model.equipmentIds" + @search="deviceSearch" :disabled="disableSelectDevice" enter-button + placeholder="璇烽�夋嫨璁惧"></a-input-search> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="浜嬮」" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planCloseType"> + <j-dict-select-tag :readOnly="disabled" placeholder="璇烽�夋嫨浜嬮」" + :triggerChange="true" dictCode="plan_close_matter " + v-model="model.planCloseType" allow-clear/> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鏃ユ湡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="theDate"> + <a-date-picker v-model="model.theDate" :disabled="disabled" format="YYYY-MM-DD" + value-format="YYYY-MM-DD" style="width: 100%"></a-date-picker> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鏃堕暱锛堝垎閽燂級" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planCloseTimeLong"> + <a-input-number :min="0" v-model="model.planCloseTimeLong" placeholder="璇疯緭鍏ユ椂闀匡紙鍒嗛挓锛�"></a-input-number> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="澶囨敞" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> + <a-textarea :maxLength="20" v-model="model.remark" placeholder="璇疯緭鍏ュ娉�"></a-textarea> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + + <select-device-drawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'閫夋嫨璁惧'"/> + </a-spin> +</template> + +<script> + import { httpAction, getAction } from '@/api/manage' + import SelectDeviceDrawer from '@/views/system/modules/SelectDeviceDrawer' + + export default { + name: 'MdcPlanCloseForm', + components: { SelectDeviceDrawer }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + }, + disableSelectDevice: { + type: Boolean, + default: false + } + }, + data() { + return { + model: { + closeType: 1 + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + confirmLoading: false, + validatorRules: { + equipmentIds: [ + { required: true, message: '璇烽�夋嫨璁惧!' } + ], + planCloseType: [ + { required: true, message: '璇烽�夋嫨浜嬮」!' } + ], + theDate: [ + { required: true, message: '璇烽�夋嫨鏃ユ湡!' } + ], + planCloseTimeLong: [ + { required: true, message: '璇疯緭鍏ユ椂闀�!' } + ] + }, + url: { + add: '/mdc/mdcPlanClose/add', + edit: '/mdc/mdcPlanClose/edit' + } + } + }, + computed: { + formDisabled() { + return this.disabled + } + }, + created() { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)) + }, + methods: { + add() { + this.edit(this.modelDefault) + }, + edit(record) { + this.model = Object.assign({}, { equipmentIds: record.equipmentId }, record) + console.log('model', this.model) + this.visible = true + }, + submitForm() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true + let httpUrl = '' + let method = 'post' + if (!this.model.id) { + httpUrl += this.url.add + } else { + httpUrl += this.url.edit + } + httpAction(httpUrl, this.model, method).then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.$emit('ok') + } else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.confirmLoading = false + }) + } + + }) + }, + deviceSearch() { + this.$refs.selectDeviceDrawer.visible = true + this.$refs.selectDeviceDrawer.selectedRowKeys = [] + this.$refs.selectDeviceDrawer.selectedRows = [] + this.$refs.selectDeviceDrawer.checkedKeys = this.model.equipmentIds ? this.model.equipmentIds.split(',') : [] + }, + /** + * 閫夋嫨宸叉湁璁惧鍚庣偣鍑荤‘瀹氭椂瑙﹀彂 + * @param data 宸查�夋嫨鐨勮澶� + */ + selectOK(data) { + this.$set(this.model, 'equipmentIds', data.join(',')) + console.log('model', this.model) + } + } + } +</script> +<style scoped lang="less"> + /deep/ .ant-input-number { + width: 100% !important; + } +</style> \ No newline at end of file diff --git a/src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseList.vue b/src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseList.vue new file mode 100644 index 0000000..21fa529 --- /dev/null +++ b/src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseList.vue @@ -0,0 +1,307 @@ +<template> + <div class="device_list"> + <!-- 鏌ヨ鍖哄煙 --> + <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-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId" allowClear/> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="浜嬮」"> + <j-dict-select-tag placeholder="璇烽�夋嫨浜嬮」" :triggerChange="true" dictCode="plan_close_matter " + v-model="queryParam.planCloseType"/> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鏃ユ湡"> + <a-date-picker v-model="queryParam.theDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" + style="width: 100%"></a-date-picker> + </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="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-button type="primary" icon="download" @click="importTemplate('璁″垝鍋滄満妯℃澘')">瀵煎叆妯℃澘</a-button> + <a-button type="primary" icon="download" @click="handleExportXls('璁″垝鍋滄満绠$悊')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" + @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> + <a-button type="primary" icon="printer" v-print="'#planClose'" v-has="'planClose:print'">鎵撳嵃</a-button> + + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel"> + <a-icon type="delete"/> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down"/> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div id="DeviceList" style="flex: 1;overflow: hidden"> + <a-table + id="planClose" + ref="table" + size="middle" + :scroll="{x:'max-content',y:scrollY}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical"/> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down"/></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + + <MdcPlanCloseModal ref="modalForm" @ok="modalFormOk"/> + </div> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import MdcPlanCloseModal from './MdcPlanCloseModal' + + export default { + name: 'MdcPlanCloseList', + mixins: [JeecgListMixin, mixinDevice], + components: { + MdcPlanCloseModal + }, + props: { nodeTree: '', Type: '', nodePeople: '' }, + data() { + return { + description: 'mdcPlanClose绠$悊椤甸潰', + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 30, + pageSizeOptions: ['30', '50', '100'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + queryParam: { + closeType: 1 + }, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentId', + width: 250 + }, + { + title: '浜嬮」', + align: 'center', + dataIndex: 'planCloseType', + width: 150 + }, + { + title: '鏃ユ湡', + align: 'center', + dataIndex: 'theDate', + width: 250 + }, + { + title: '鏃堕暱锛堝垎閽燂級', + align: 'center', + dataIndex: 'planCloseTimeLong', + width: 250 + }, + { + title: '澶囨敞', + align: 'center', + dataIndex: 'remark', + width: 300 + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + fixed: 'right', + width: 150, + scopedSlots: { customRender: 'action' } + } + ], + scrollY: 465, + url: { + list: '/mdc/mdcPlanClose/list', + delete: '/mdc/mdcPlanClose/delete', + deleteBatch: '/mdc/mdcPlanClose/deleteBatch', + exportXlsUrl: '/mdc/mdcPlanClose/exportXls', + importExcelUrl: 'mdc/mdcPlanClose/importExcel' + }, + dictOptions: {}, + superFieldList: [] + } + }, + watch: { + Type(valmath) { + this.dataList = [] + this.queryParam.typeTree = valmath + // console.log(this.queryParam.typeTree) + }, + nodeTree(val) { //鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 + if (JSON.stringify(val) != '{}') { + if (val.equipmentId) { + this.queryParam.parentId = '' + this.queryParam.equipmentId = val.equipmentId + } else { + this.queryParam.parentId = val.key + this.queryParam.equipmentId = '' + } + this.searchQuery() + } + }, + nodePeople(val) { + if (JSON.stringify(val) != '{}') { + if (val.equipmentId) { + this.queryParam.parentId = '' + this.queryParam.equipmentId = val.equipmentId + } else { + this.queryParam.parentId = val.key + this.queryParam.equipmentId = '' + } + this.searchQuery() + } + } + }, + computed: { + importExcelUrl: function() { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` + } + }, + methods: { + importTemplate(fileName) { + var a = document.createElement('a') + a.href = '/static/璁″垝鍋滄満绠$悊.xls' + a.download = '璁″垝鍋滄満绠$悊.xls' + a.style.display = 'none' + document.body.appendChild(a) + a.click() + a.remove() + }, + initDictConfig() { + }, + searchReset() { + this.queryParam = { + closeType: 1 + } + this.loadData(1) + }, + /** + * 褰撴祻瑙堝櫒鍙绐楀彛灏哄鍙戠敓鏀瑰彉鏃惰Е鍙� + */ + handleWindowResize() { + const boxHeight = +window.getComputedStyle(document.getElementById('DeviceList')).height.slice(0, -2) + const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0, -2) + this.scrollY = boxHeight - tableHeadHeight - 50 + } + }, + mounted() { + window.addEventListener('resize', this.handleWindowResize) + this.handleWindowResize() + }, + beforeDestroy() { + window.removeEventListener('resize', this.handleWindowResize) + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; + + .device_list { + display: flex; + flex-direction: column; + overflow: hidden; + } + + @media screen and (min-width: 1920px) { + .device_list { + height: 811px !important; + } + } + + @media screen and (min-width: 1680px) and (max-width: 1920px) { + .device_list { + height: 811px !important; + } + } + + @media screen and (min-width: 1400px) and (max-width: 1680px) { + .device_list { + height: 663px !important; + } + } + + @media screen and (min-width: 1280px) and (max-width: 1400px) { + .device_list { + height: 564px !important; + } + } + + @media screen and (max-width: 1280px) { + .device_list { + height: 564px !important; + } + } +</style> \ No newline at end of file diff --git a/src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseModal.vue b/src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseModal.vue new file mode 100644 index 0000000..54b479f --- /dev/null +++ b/src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseModal.vue @@ -0,0 +1,64 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <MdcPlanCloseForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit" + :disableSelectDevice="disableSelectDevice"/> + </j-modal> +</template> + +<script> + import MdcPlanCloseForm from './MdcPlanCloseForm' + + export default { + name: 'MdcPlanCloseModal', + components: { + MdcPlanCloseForm + }, + data() { + return { + title: '', + width: 800, + visible: false, + disableSubmit: false, + disableSelectDevice: false + } + }, + methods: { + add() { + this.visible = true + this.disableSelectDevice = false + this.$nextTick(() => { + this.$refs.realForm.add() + }) + }, + edit(record) { + this.visible = true + this.disableSelectDevice = true + this.$nextTick(() => { + this.$refs.realForm.edit(record) + }) + }, + close() { + this.$emit('close') + this.visible = false + }, + handleOk() { + this.$refs.realForm.submitForm() + }, + submitCallback() { + this.$emit('ok') + this.visible = false + }, + handleCancel() { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseForm.vue b/src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseForm.vue new file mode 100644 index 0000000..606f74f --- /dev/null +++ b/src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseForm.vue @@ -0,0 +1,171 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="璁惧缁�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentIds"> + <a-input-search :readOnly="true" v-model="model.equipmentIds" + @search="deviceSearch" :disabled="disableSelectDevice" enter-button + placeholder="璇烽�夋嫨璁惧"></a-input-search> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="浜嬮」" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planCloseType"> + <j-dict-select-tag :readOnly="disabled" placeholder="璇烽�夋嫨浜嬮」" + :triggerChange="true" dictCode="unplanned_close_matter" + v-model="model.planCloseType" allow-clear/> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鏃ユ湡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="theDate"> + <a-date-picker v-model="model.theDate" :disabled="disabled" format="YYYY-MM-DD" + value-format="YYYY-MM-DD" style="width: 100%"></a-date-picker> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鏃堕暱锛堝垎閽燂級" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planCloseTimeLong"> + <a-input-number :min="0" v-model="model.planCloseTimeLong" placeholder="璇疯緭鍏ユ椂闀匡紙鍒嗛挓锛�"></a-input-number> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="澶囨敞" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> + <a-textarea :maxLength="20" v-model="model.remark" placeholder="璇疯緭鍏ュ娉�"></a-textarea> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + + <select-device-drawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'閫夋嫨璁惧'"/> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + import SelectDeviceDrawer from '@/views/system/modules/SelectDeviceDrawer' + + export default { + name: 'MdcUnplannedCloseForm', + components: { SelectDeviceDrawer }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + }, + disableSelectDevice: { + type: Boolean, + default: false + } + }, + data() { + return { + model: { + closeType: 2 + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + confirmLoading: false, + validatorRules: { + equipmentIds: [ + { required: true, message: '璇烽�夋嫨璁惧!' } + ], + planCloseType: [ + { required: true, message: '璇烽�夋嫨浜嬮」!' } + ], + theDate: [ + { required: true, message: '璇烽�夋嫨鏃ユ湡!' } + ], + planCloseTimeLong: [ + { required: true, message: '璇疯緭鍏ユ椂闀�!' } + ] + }, + url: { + add: '/mdc/mdcPlanClose/add', + edit: '/mdc/mdcPlanClose/edit' + } + } + }, + computed: { + formDisabled() { + return this.disabled + } + }, + created() { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)) + }, + methods: { + add() { + this.edit(this.modelDefault) + }, + edit(record) { + this.model = Object.assign({}, { equipmentIds: record.equipmentId }, record) + console.log('model', this.model) + this.visible = true + }, + submitForm() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true + let httpUrl = '' + let method = 'post' + if (!this.model.id) { + httpUrl += this.url.add + } else { + httpUrl += this.url.edit + } + httpAction(httpUrl, this.model, method).then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.$emit('ok') + } else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.confirmLoading = false + }) + } + + }) + }, + deviceSearch() { + this.$refs.selectDeviceDrawer.visible = true + this.$refs.selectDeviceDrawer.selectedRowKeys = [] + this.$refs.selectDeviceDrawer.selectedRows = [] + this.$refs.selectDeviceDrawer.checkedKeys = this.model.equipmentIds ? this.model.equipmentIds.split(',') : [] + }, + /** + * 閫夋嫨宸叉湁璁惧鍚庣偣鍑荤‘瀹氭椂瑙﹀彂 + * @param data 宸查�夋嫨鐨勮澶� + */ + selectOK(data) { + this.$set(this.model, 'equipmentIds', data.join(',')) + console.log('model', this.model) + } + } + } +</script> +<style scoped lang="less"> + /deep/ .ant-input-number { + width: 100% !important; + } +</style> \ No newline at end of file diff --git a/src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseList.vue b/src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseList.vue new file mode 100644 index 0000000..5d6ea0a --- /dev/null +++ b/src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseList.vue @@ -0,0 +1,307 @@ +<template> + <div class="device_list"> + <!-- 鏌ヨ鍖哄煙 --> + <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-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId" allowClear/> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="浜嬮」"> + <j-dict-select-tag placeholder="璇烽�夋嫨浜嬮」" :triggerChange="true" dictCode="unplanned_close_matter" + v-model="queryParam.planCloseType"/> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鏃ユ湡"> + <a-date-picker v-model="queryParam.theDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" + style="width: 100%"></a-date-picker> + </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="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-button type="primary" icon="download" @click="importTemplate('璁″垝鍋滄満妯℃澘')">瀵煎叆妯℃澘</a-button> + <a-button type="primary" icon="download" @click="handleExportXls('璁″垝鍋滄満绠$悊')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" + @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> + <a-button type="primary" icon="printer" v-print="'#planClose'" v-has="'planClose:print'">鎵撳嵃</a-button> + + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel"> + <a-icon type="delete"/> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down"/> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div id="DeviceList" style="flex: 1;overflow: hidden"> + <a-table + id="planClose" + ref="table" + size="middle" + :scroll="{x:'max-content',y:scrollY}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical"/> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down"/></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + + <MdcUnplannedCloseModal ref="modalForm" @ok="modalFormOk"/> + </div> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import MdcUnplannedCloseModal from './MdcUnplannedCloseModal' + + export default { + name: 'MdcUnplannedCloseList', + mixins: [JeecgListMixin, mixinDevice], + components: { + MdcUnplannedCloseModal + }, + props: { nodeTree: '', Type: '', nodePeople: '' }, + data() { + return { + description: 'mdcPlanClose绠$悊椤甸潰', + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 30, + pageSizeOptions: ['30', '50', '100'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + queryParam: { + closeType: 2 + }, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentId', + width: 250 + }, + { + title: '浜嬮」', + align: 'center', + dataIndex: 'planCloseType', + width: 150 + }, + { + title: '鏃ユ湡', + align: 'center', + dataIndex: 'theDate', + width: 250 + }, + { + title: '鏃堕暱锛堝垎閽燂級', + align: 'center', + dataIndex: 'planCloseTimeLong', + width: 250 + }, + { + title: '澶囨敞', + align: 'center', + dataIndex: 'remark', + width: 300 + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + fixed: 'right', + width: 150, + scopedSlots: { customRender: 'action' } + } + ], + scrollY: 465, + url: { + list: '/mdc/mdcPlanClose/list', + delete: '/mdc/mdcPlanClose/delete', + deleteBatch: '/mdc/mdcPlanClose/deleteBatch', + exportXlsUrl: '/mdc/mdcPlanClose/exportXls', + importExcelUrl: 'mdc/mdcPlanClose/importExcel' + }, + dictOptions: {}, + superFieldList: [] + } + }, + watch: { + Type(valmath) { + this.dataList = [] + this.queryParam.typeTree = valmath + // console.log(this.queryParam.typeTree) + }, + nodeTree(val) { //鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 + if (JSON.stringify(val) != '{}') { + if (val.equipmentId) { + this.queryParam.parentId = '' + this.queryParam.equipmentId = val.equipmentId + } else { + this.queryParam.parentId = val.key + this.queryParam.equipmentId = '' + } + this.searchQuery() + } + }, + nodePeople(val) { + if (JSON.stringify(val) != '{}') { + if (val.equipmentId) { + this.queryParam.parentId = '' + this.queryParam.equipmentId = val.equipmentId + } else { + this.queryParam.parentId = val.key + this.queryParam.equipmentId = '' + } + this.searchQuery() + } + } + }, + computed: { + importExcelUrl: function() { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` + } + }, + methods: { + importTemplate(fileName) { + var a = document.createElement('a') + a.href = '/static/璁″垝鍋滄満绠$悊.xls' + a.download = '璁″垝鍋滄満绠$悊.xls' + a.style.display = 'none' + document.body.appendChild(a) + a.click() + a.remove() + }, + initDictConfig() { + }, + searchReset() { + this.queryParam = { + closeType: 2 + } + this.loadData(1) + }, + /** + * 褰撴祻瑙堝櫒鍙绐楀彛灏哄鍙戠敓鏀瑰彉鏃惰Е鍙� + */ + handleWindowResize() { + const boxHeight = +window.getComputedStyle(document.getElementById('DeviceList')).height.slice(0, -2) + const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0, -2) + this.scrollY = boxHeight - tableHeadHeight - 50 + } + }, + mounted() { + window.addEventListener('resize', this.handleWindowResize) + this.handleWindowResize() + }, + beforeDestroy() { + window.removeEventListener('resize', this.handleWindowResize) + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; + + .device_list { + display: flex; + flex-direction: column; + overflow: hidden; + } + + @media screen and (min-width: 1920px) { + .device_list { + height: 811px !important; + } + } + + @media screen and (min-width: 1680px) and (max-width: 1920px) { + .device_list { + height: 811px !important; + } + } + + @media screen and (min-width: 1400px) and (max-width: 1680px) { + .device_list { + height: 663px !important; + } + } + + @media screen and (min-width: 1280px) and (max-width: 1400px) { + .device_list { + height: 564px !important; + } + } + + @media screen and (max-width: 1280px) { + .device_list { + height: 564px !important; + } + } +</style> \ No newline at end of file diff --git a/src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseModal.vue b/src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseModal.vue new file mode 100644 index 0000000..6cdf097 --- /dev/null +++ b/src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseModal.vue @@ -0,0 +1,64 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <MdcUnplannedCloseForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit" + :disableSelectDevice="disableSelectDevice"/> + </j-modal> +</template> + +<script> + import MdcUnplannedCloseForm from './MdcUnplannedCloseForm' + + export default { + name: 'MdcUnplannedCloseModal', + components: { + MdcUnplannedCloseForm + }, + data() { + return { + title: '', + width: 800, + visible: false, + disableSubmit: false, + disableSelectDevice: false + } + }, + methods: { + add() { + this.visible = true + this.disableSelectDevice = false + this.$nextTick(() => { + this.$refs.realForm.add() + }) + }, + edit(record) { + this.visible = true + this.disableSelectDevice = true + this.$nextTick(() => { + this.$refs.realForm.edit(record) + }) + }, + close() { + this.$emit('close') + this.visible = false + }, + handleOk() { + this.$refs.realForm.submitForm() + }, + submitCallback() { + this.$emit('ok') + this.visible = false + }, + handleCancel() { + this.close() + } + } + } +</script> \ No newline at end of file -- Gitblit v1.9.3