| | |
| | | <a-input placeholder="输入设备名称查询" v-model="queryParams.equipmentName"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="2" :sm="3" :xs="3"> |
| | | <a-col :md="2" :sm="2" :xs="2"> |
| | | <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
| | | </a-col> |
| | | <a-col :md="2" :sm="2" :xs="2"> |
| | | <a-button type="primary" @click="searchReset" icon="reload">重置</a-button> |
| | | </a-col> |
| | | <!--<a-col :lg="2" :md="3" :sm="3" :xs="3">--> |
| | | <!--<a-button type="primary" @click="exportExcel" icon="download">导出</a-button>--> |
| | | <!--</a-col>--> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | |
| | | <div class="table-operator" style="display: inline;"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">新增 |
| | | </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="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-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 --> |
| | |
| | | { |
| | | title: '类型', |
| | | align: 'center', |
| | | dataIndex: 'type' |
| | | dataIndex: 'vacationType' |
| | | }, |
| | | { |
| | | title: '备注', |
| | |
| | | ], |
| | | url: { |
| | | list: '/mdc/mdcVacationManagement/pageList', |
| | | delete: '/mdc/mdcVacationManagement/deleteVacation', |
| | | deleteBatch: '/mdc/mdcVacationManagement/deleteBatchVacation', |
| | | getEquipmentByPid: '/mdc/mdcequipment/getEquipmentByPid', |
| | | exportXlsUrl: "/mdc/MdcTorqueConfig/exportXls", |
| | | importExcelUrl: "/mdc/MdcTorqueConfig/importExcel", |
| | | exportXlsUrl: "/mdc/mdcVacationManagement/exportXls", |
| | | importExcelUrl: "/mdc/mdcVacationManagement/importExcel", |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ |
| | | }else{ |
| | | this.$message.warning(res.message) |
| | | // this.$message.warning(res.message) |
| | | this.$notification.warning({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | |
| | | this.ipagination.total = 0; |
| | | } |
| | | }else{ |
| | | this.$message.warning(res.message) |
| | | // this.$message.warning(res.message) |
| | | this.$notification.warning({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | |
| | | this.ipagination.total = 0; |
| | | } |
| | | }else{ |
| | | this.$message.warning(res.message) |
| | | // this.$message.warning(res.message) |
| | | this.$notification.warning({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | |
| | | this.ipagination.total = 0; |
| | | } |
| | | }else{ |
| | | this.$message.warning(res.message) |
| | | // this.$message.warning(res.message) |
| | | this.$notification.warning({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | |
| | | } |
| | | //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ |
| | | }else{ |
| | | this.$message.warning(res.message) |
| | | // this.$message.warning(res.message) |
| | | this.$notification.warning({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | |
| | | this.selectedRowKeys = [] |
| | | }, |
| | | handleDelete: function (id) { |
| | | if(!this.url.deleteBatch){ |
| | | if(!this.url.delete){ |
| | | this.$message.error("请设置url.delete属性!") |
| | | return |
| | | } |
| | | var that = this; |
| | | deleteAction(that.url.deleteBatch, {id: id}).then((res) => { |
| | | deleteAction(that.url.delete, {id: id}).then((res) => { |
| | | if (res.success) { |
| | | //重新计算分页问题 |
| | | that.reCalculatePage(1) |
| | | that.$message.success(res.message); |
| | | // that.$message.success(res.message); |
| | | that.$notification.success({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | that.searchQuery(); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | // that.$message.warning(res.message); |
| | | that.$notification.warning({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | batchDel: function () { |
| | | if(!this.url.deleteBatch){ |
| | | this.$message.error("请设置url.deleteBatch属性!") |
| | | return |
| | | } |
| | | if (this.selectedRowKeys.length <= 0) { |
| | | // this.$message.warning('请选择一条记录!'); |
| | | this.$notification.warning({ |
| | | message:'消息', |
| | | description:"请选择一条记录" |
| | | }); |
| | | return; |
| | | } else { |
| | | var ids = ""; |
| | | for (var a = 0; a < this.selectedRowKeys.length; a++) { |
| | | ids += this.selectedRowKeys[a] + ","; |
| | | } |
| | | var that = this; |
| | | this.$confirm({ |
| | | title: "确认删除", |
| | | content: "是否删除选中数据?", |
| | | onOk: function () { |
| | | that.loading = true; |
| | | deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => { |
| | | if (res.success) { |
| | | //重新计算分页问题 |
| | | that.reCalculatePage(that.selectedRowKeys.length) |
| | | // that.$message.success(res.message); |
| | | that.$notification.success({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | that.loadData(); |
| | | that.onClearSelected(); |
| | | } else { |
| | | // that.$message.warning(res.message); |
| | | that.$notification.warning({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }).finally(() => { |
| | | that.loading = false; |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | 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(); |
| | | }, |
| | | handleAdd() { |
| | | this.$refs.modalForm.add(this.node) |
| | |
| | | _this.equipment = res.result |
| | | _this.searchQuery() |
| | | } else { |
| | | _this.$message.warning('请配置设备!') |
| | | // _this.$message.warning('请配置设备!') |
| | | _this.$notification.warning({ |
| | | message:'消息', |
| | | description:'请联系管理员,开放设备权限!' |
| | | }); |
| | | } |
| | | } |
| | | }) |