gaoluyang
2025-02-15 d73f643144694aa5176c0bfa0466296c3dad69e4
客户管理联调
已修改4个文件
50 ■■■■ 文件已修改
src/api/system/customer.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/system/user.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/customer/index.vue 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/user/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/system/customer.js
@@ -3,7 +3,7 @@
// 查询客户列表
export function selectCustomPageList(query) {
  return request({
    url: '/system/user/selectCustomPageList',
    url: '/system/custom/selectCustomPageList',
    method: 'get',
    params: query
  })
@@ -11,23 +11,23 @@
// 新增客户
export function addCustom(query) {
  return request({
    url: '/system/user/addCustom',
    url: '/system/custom/addCustom',
    method: 'post',
    params: query
    data: query
  })
}
// 修改客户
export function upCustom(query) {
  return request({
    url: '/system/user/upCustom',
    url: '/system/custom/upCustom',
    method: 'post',
    params: query
    data: query
  })
}
// 删除客户
export function delCustomById(query) {
  return request({
    url: '/system/user/delCustomById',
    url: '/system/custom/delCustomById',
    method: 'post',
    params: query
  })
src/api/system/user.js
@@ -168,7 +168,7 @@
// 获取单位
export function selectCustomEnum() {
  return request({
    url: '/user/selectCustomEnum',
    url: '/system/custom/selectCustomEnum',
    method: 'get',
  })
}
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(() => {})
    }
  }
}
src/views/system/user/index.vue
@@ -127,8 +127,8 @@
        <el-row>
          <el-col :span="12">
            <el-form-item label="单位" prop="company">
              <el-select v-model="form.company" placeholder="请选择岗位" style="width: 100%" clearable>
                <el-option v-for="item in postOptions" :key="item.postId" :label="item.postName" :value="item.postId"></el-option>
              <el-select v-model="form.company" placeholder="请选择单位" style="width: 100%" clearable>
                <el-option v-for="item in postOptions" :key="item.id" :label="item.company" :value="item.id"></el-option>
              </el-select>
            </el-form-item>
          </el-col>