src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue
@@ -41,21 +41,20 @@
      <a-button v-has="'secondMaintenanceOrder:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-button v-has="'secondMaintenanceOrder:batchAdd'" @click="handleBatchAdd" type="primary" icon="plus">批量新增
      </a-button>
      <a-button v-has="'secondMaintenanceOrder:batchAbolish'" @click="handlerBatchAbolish" type="primary"
                icon="delete" :disabled="selectedRowKeys.length===0">
        批量作废
      </a-button>
      <a-button v-has="'secondMaintenanceOrder:batchCollect'" @click="handlerBatchCollect" type="primary" icon="form"
                :disabled="selectedRowKeys.length===0">
        批量领取
      </a-button>
      <a-button v-has="'secondMaintenanceOrder:batchRestore'" @click="handlerBatchRestore" type="primary"
                :disabled="selectedRowKeys.length===0"
                icon="reload">
        批量还原
      <a-button @click="handleBatchPrint" type="primary" icon="monitor" :disabled="selectedRowKeys.length===0">批量预览
      </a-button>
      <a-button v-has="'secondMaintenanceOrder:batchAdd'" @click="handleBatchPrint" type="primary" icon="monitor"
                :disabled="selectedRowKeys.length===0">批量预览
      <a-button v-has="'secondMaintenanceOrder:batchAbolish'" @click="handlerBatchAbolish" type="danger"
                icon="delete" :disabled="selectedRowKeys.length===0">
        批量作废
      </a-button>
      <a-button v-has="'secondMaintenanceOrder:batchRestore'" @click="handlerBatchRestore"
                :disabled="selectedRowKeys.length===0" icon="reload">
        批量还原
      </a-button>
      <!-- <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
@@ -446,102 +445,68 @@
      //批量还原
      handlerBatchRestore() {
        if (!this.url.restoreBatch) {
          this.$message.error('请设置url.restoreBatch属性!')
          return
        var ids = ''
        for (var a = 0; a < this.selectedRowKeys.length; a++) {
          ids += this.selectedRowKeys[a] + ','
        }
        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.$notification.success({
                  message: '消息',
                  description: res.message
                })
                that.loadData()
                that.onClearSelected()
              } else {
                that.$notification.warning({
                  message: '消息',
                  description: res.message
                })
              }
            }).finally(() => {
              that.loading = false
            })
          }
          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) {
          this.$message.error('请设置url.abolishBatch属性!')
          return
        var ids = ''
        for (var a = 0; a < this.selectedRowKeys.length; a++) {
          ids += this.selectedRowKeys[a] + ','
        }
        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.collectBatch, { ids: ids }).then((res) => {
              if (res.success) {
                that.$notification.success({
                  message: '消息',
                  description: res.message
                })
                that.loadData()
                that.onClearSelected()
              } else {
                that.$notification.warning({
                  message: '消息',
                  description: res.message
                })
              }
            }).finally(() => {
              that.loading = false
            })
          }
          var that = this
          this.$confirm({
            title: '确认领取',
            content: '是否领取选中数据,只有待保养状态的数据才可领取成功?',
            onOk: function() {
              that.loading = true
              deleteAction(that.url.collectBatch, { 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
              })
            }
          })
        }
        })
      },
      // 批量打印