charles
2024-08-06 5ecb7958c96d3f0b6d47b79aff7eb306c2cf690f
src/views/warehouseManage/bussinessType/index.vue
@@ -13,10 +13,11 @@
      <div class="table">
        <TableCommonView ref="tableListRef" :table-list="tableList" :show-checkcol="false">
          <template slot="tableButton">
            <el-table-column label="操作" width="100">
            <el-table-column label="操作" width="120">
              <template slot-scope="scope">
                <el-button @click="tableRowClick(scope.row, '查看')" type="text" size="small">查看</el-button>
                <el-button @click="tableRowClick(scope.row, '编辑')" type="text" size="small">编辑</el-button>
                <el-button @click.stop="deleteRow(scope.row)" type="text" size="small">删除</el-button>
              </template>
            </el-table-column>
          </template>
@@ -33,7 +34,7 @@
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import { getOperationTypeList } from "@/api/warehouseManage/warehouse"
import { getOperationTypeList,deleteOperationType } from "@/api/warehouseManage/warehouse"
// import DetailProduct from "@/views/productManage/product/DetailProduct"
import AddBussinessType from "@/views/warehouseManage/bussinessType/AddBussinessType"
@@ -164,6 +165,37 @@
        defaultLocationDestId: null
      }
      this.editConfig.visible = true
    },
    //删除
    deleteRow(row){
      this.$confirm('此操作将永久删除该业务类型, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning',
        })
          .then(() => {
            deleteOperationType({
              id: row.id,
            }).then((res) => {
              if (res.code == 200) {
                this.$message({
                  type: 'success',
                  message: '删除成功!',
                })
                this.getData()
              }else{
                this.$message.error('删除时出错,请稍后重试或联系管理员...');
              }
            })
          })
          .catch(() => {
            // this.$message({
            //   type: 'info',
            //   message: '已取消删除',
            // })
          })
    }
  }
}