Blame view

src/views/workflow/components/batchDel.vue 2.48 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
<!--
 * @Description:
 * @Autor: renchao
 * @LastEditTime: 2023-04-26 16:05:28
-->
<!-- 批量删除弹框 -->
<template>
  <div class='batchDel'>
    <lb-table :column="columns" :data="formData.dataList" :maxHeight="460" :heightNumSetting="true" :pagination="false"
      @selection-change="handleSelectionChange">
    </lb-table>
    <div class="text-center">
      <el-button @click="$popupCacel">取消</el-button>
      <el-button type="primary" @click="submitdelclick" plain>确定</el-button>
    </div>
  </div>
</template>
<script>
  import { deleteFlow } from "@/api/workFlow.js"
  import store from '@/store/index.js'
  export default {
    components: {},
    props: {
      formData: {
        type: Object,
        default: {}
      }
    },
    data () {
      return {
        columns: [
          {
            type: 'selection',
            label: '全选'
          },
          {
            label: '序号',
            type: 'index',
            width: '50',
          },
          {
            prop: "bdcdyh",
            label: "不动产单元号",
44 45 46 47 48 49 50 51 52 53 54 55 56
            width: '250',
          },
          {
            prop: "qllxmc",
            label: "权利类型",
          },
          {
            prop: "jzwmc",
            label: "建筑物名称",
          },
          {
            prop: "xmmc",
            label: "项目名称",
57 58 59 60
          },
          {
            prop: "zl",
            label: "坐落",
61
          }
62 63 64 65 66 67 68
        ],
        dataList: [],
        selectBdcdy: [],
      }
    },
    methods: {
      // 批量删除确定按钮
yuanbo committed
69 70 71 72
      /**
       * @description: 批量删除确定按钮
       * @author: renchao
       */
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
      submitdelclick () {
        var formdata = new FormData();
        formdata.append("bsmSldyList", this.selectBdcdy);
        formdata.append("bsmSlsq", this.formData.bsmSlsq);
        deleteFlow(formdata).then(res => {
          if (res.code == 200) {
            this.$popupCacel();
            store.dispatch('user/refreshPage', true);
            this.$message.success("删除成功");
          } else {
            this.$message.error(res.message)
          }
        })
      },
      // 批量删除勾选事件
yuanbo committed
88 89 90 91 92
      /**
       * @description: 批量删除勾选事件
       * @param {*} e
       * @author: renchao
       */
93 94 95 96 97 98 99 100 101 102 103
      handleSelectionChange (e) {
        this.selectBdcdy = [];
        e.forEach((item, index) => {
          this.selectBdcdy.push(item.bsmSldy)
        })
      }
    }
  }
</script>
<style scoped lang='scss'>
</style>