haoxuan
2023-08-28 6365989d130a8f5e222687b7441aa19a8b5eb9d6
src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue
File was renamed from src/views/purchaseManage/purchase/components/SelectClientDialog.vue
@@ -1,7 +1,7 @@
<template>
  <div class="edit-selClient-box">
    <el-dialog
      :title="'客户管理'"
      :title="'供应商名称'"
      :visible.sync="editConfig.editVisible"
      :width="dialogWidth"
      :before-close="handleClose"
@@ -38,9 +38,7 @@
</template>
<script>
import {
  getClientList
} from "@/api/purchaseManage/purchase";
import { getSupplierList } from "@/api/supplierManage/supplier"
export default {
  name: "EditSelClientDialog",
  props: {
@@ -80,15 +78,14 @@
      this.tableList = {
        tableInfomation: [],
        tableColumn: [
          { label: "客户名称", prop: "name", min: 100, isClick: true },
          { label: "客户编号", prop: "number" },
          { label: "客户状态", prop: "client_status" },
          { label: "销售负责人", prop: "member_name", min: 100 },
          { label: "法定代表人", prop: "representative", min: 100 },
          { label: "注册时间", prop: "registration_time" },
          { label: "经营范围", prop: "business_scope" },
          { label: "详细地址", prop: "detail_address" },
          { label: "备注", prop: "remark" }
         { label: "供应商编号", prop: "number", min: 190, isCommonClick: true },
          { label: "供应商名称", prop: "name", min: 130 },
          { label: "供应商类型", prop: "supplierType", min: 130 },
          { label: "所属行业", prop: "industry", min: 130 },
          { label: "联系人", prop: "contact", min: 130 },
          { label: "联系电话", prop: "phone", min: 130 },
          { label: "状态", prop: "status_name", min: 130 },
          { label: "创建时间", prop: "member_name", min: 130 }
        ]
      }
      this.searchOptions = []
@@ -102,22 +99,20 @@
      this.editConfig.editVisible = false
    },
    // 请求数据
    async getData() {
    async getData(val, content) {
      this.loading = true
      await getClientList({
        search_map: this.search_map,
        page: 0,
        pageSize: 0
      await getSupplierList({
        [val]: content,
        page:1,
        pageSize: 10
      })
        .then((res) => {
          console.log(res)
          if (res.code === 200) {
            if (res.data.list && res.data.list.length > 0) {
              const list = res.data.list.map((item) => {
          if (res.data.code == 200) {
            if (res.data.data.list && res.data.data.list.length > 0) {
              const list = res.data.data.list.map((item) => {
                return {
                  ...item,
                  client_status: item.client_status.name,
                  member_name: item.member.username
                  status_name: item.status === 0 ? "未启用" : "启用"
                }
              })
              this.tableList.tableInfomation = list.slice(0, 5) || []
@@ -131,7 +126,7 @@
        })
        .catch((err) => {
          console.log(err)
          this.this.tableList.tableInfomation = []
          this.tableList.tableInfomation = []
          this.loading = false
        })
    },
@@ -141,14 +136,9 @@
    },
    // 搜索
    searchClick(val, content) {
      console.log(val, content)
      this.search_map = {
        [val.value]: content
      }
      this.getData()
      this.getData(val.value, content)
    },
    resetClick() {
      this.search_map = {}
      this.getData()
    }
  }