| | |
| | | <a-icon type="form"/> |
| | | 领取 |
| | | </a-menu-item> |
| | | <a-menu-item key="3" @click="handlerBatchRestore"> |
| | | <a-icon type="form"/> |
| | | 还原 |
| | | </a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> 批量操作 |
| | | <a-icon type="down"/> |
| | |
| | | |
| | | <template v-else> |
| | | <a @click="handleDetail(record)">详情</a> |
| | | |
| | | |
| | | <a-divider v-if="record.maintenanceStatus === 'ABOLISH'" type="vertical"/> |
| | | |
| | | <a-popconfirm v-if="record.maintenanceStatus === 'ABOLISH'" title="确定还原吗?" @confirm="() => handlerRestore(record.id)"> |
| | | <a>还原</a> |
| | | </a-popconfirm> |
| | | |
| | | <a-divider type="vertical" v-if="record.maintenanceStatus === 'COMPLETE'"/> |
| | | <a v-if="record.maintenanceStatus === 'COMPLETE'" @click="handlePrint(record)">打印</a> |
| | | </template> |
| | |
| | | list: '/eam/secondMaintenanceOrder/list', |
| | | abolish: '/eam/secondMaintenanceOrder/abolish', |
| | | collect: '/eam/secondMaintenanceOrder/collect', |
| | | restore:'/eam/secondMaintenanceOrder/restore', |
| | | abolishBatch: '/eam/secondMaintenanceOrder/abolishBatch', |
| | | collectBatch: '/eam/secondMaintenanceOrder/collectBatch' |
| | | collectBatch: '/eam/secondMaintenanceOrder/collectBatch', |
| | | restoreBatch: '/eam/secondMaintenanceOrder/restoreBatch', |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | }) |
| | | }, |
| | | //还原 |
| | | handlerRestore(id){ |
| | | let that = this |
| | | this.loading = true |
| | | getAction(that.url.restore, { id }) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: '消息', |
| | | description: res.message |
| | | }) |
| | | that.loadData() |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: '消息', |
| | | description: res.message |
| | | }) |
| | | this.loading = false |
| | | } |
| | | }) |
| | | }, |
| | | //批量还原 |
| | | handlerBatchRestore(){ |
| | | if (!this.url.restoreBatch) { |
| | | this.$message.error('请设置url.restoreBatch属性!') |
| | | 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.restoreBatch, { 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 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | //批量领取 |
| | | handlerBatchCollect() { |
| | | if (!this.url.collectBatch) { |