gaoluyang
2025-02-15 d73f643144694aa5176c0bfa0466296c3dad69e4
src/views/system/customer/index.vue
@@ -59,7 +59,7 @@
<script>
import limsTable from '@/components/Table/lims-table.vue'
import {addCustom, selectCustomPageList, upCustom} from "@/api/system/customer";
import {addCustom, delCustomById, selectCustomPageList, upCustom} from "@/api/system/customer";
export default {
  components: {
    limsTable
@@ -89,6 +89,12 @@
              type: 'text',
              clickFun: (row) => {
                this.openFormDia('edit', row);
              },
            },{
              name: '删除',
              type: 'text',
              clickFun: (row) => {
                this.delete(row);
              },
            },
          ]
@@ -128,8 +134,8 @@
      selectCustomPageList({...this.queryParams, ...this.page}).then(res => {
        this.tableLoading = false
        if (res.code === 200) {
          this.tableData = res.data
          this.page.total = res.total
          this.tableData = res.data.records
          this.page.total = res.data.total
        }
      }).catch(err => {
        this.tableLoading = false
@@ -144,6 +150,9 @@
      this.addDia = true
      this.formTitle = type === 'add' ? '新增客户' : '编辑客户'
      this.operationType = type
      if (type === 'edit') {
        this.user = row
      }
    },
    customAdd() {
      this.$refs['userForm'].validate((valid) => {
@@ -176,6 +185,23 @@
    reset () {
      this.addDia = false
      this.resetForm("userForm");
    },
    delete (row) {
      this.$confirm('是否删除当前数据?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        delCustomById({id: row.id}).then(res => {
          if (res.code === 500) {
            return
          }
          this.$message.success('删除成功')
          this.getList()
        }).catch(e => {
          this.$message.error('删除失败')
        })
      }).catch(() => {})
    }
  }
}