From 102c7d7dc9f5af873f19c86a0d17d5d6addcbc32 Mon Sep 17 00:00:00 2001 From: zhuzhuanzhuan Date: 星期二, 19 九月 2023 17:39:28 +0800 Subject: [PATCH] 项目优化 --- src/views/mdc/base/modules/HolidayManagement/HolidayManagementList.vue | 139 ++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 121 insertions(+), 18 deletions(-) diff --git a/src/views/mdc/base/modules/HolidayManagement/HolidayManagementList.vue b/src/views/mdc/base/modules/HolidayManagement/HolidayManagementList.vue index bddc15c..0be2eb3 100644 --- a/src/views/mdc/base/modules/HolidayManagement/HolidayManagementList.vue +++ b/src/views/mdc/base/modules/HolidayManagement/HolidayManagementList.vue @@ -25,9 +25,9 @@ <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-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> @@ -35,10 +35,23 @@ <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 --> @@ -147,7 +160,7 @@ { title: '绫诲瀷', align: 'center', - dataIndex: 'type' + dataIndex: 'vacationType' }, { title: '澶囨敞', @@ -164,6 +177,7 @@ ], url: { list: '/mdc/mdcVacationManagement/pageList', + delete: '/mdc/mdcVacationManagement/deleteVacation', deleteBatch: '/mdc/mdcVacationManagement/deleteBatchVacation', getEquipmentByPid: '/mdc/mdcequipment/getEquipmentByPid', exportXlsUrl: "/mdc/MdcTorqueConfig/exportXls", @@ -289,7 +303,11 @@ } //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 @@ -334,7 +352,11 @@ 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 @@ -372,7 +394,11 @@ 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 @@ -414,7 +440,11 @@ 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 @@ -448,7 +478,11 @@ } //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 @@ -461,21 +495,86 @@ this.selectedRowKeys = [] }, handleDelete: function (id) { - if(!this.url.deleteBatch){ + if(!this.url.delete){ this.$message.error("璇疯缃畊rl.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("璇疯缃畊rl.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) @@ -507,7 +606,11 @@ _this.equipment = res.result _this.searchQuery() } else { - _this.$message.warning('璇烽厤缃澶囷紒') + // _this.$message.warning('璇烽厤缃澶囷紒') + _this.$notification.warning({ + message:'娑堟伅', + description:'璇疯仈绯荤鐞嗗憳锛屽紑鏀捐澶囨潈闄愶紒' + }); } } }) -- Gitblit v1.9.3