File was renamed from src/views/purchaseManage/purchase/components/SelectClientDialog.vue |
| | |
| | | <template> |
| | | <div class="edit-selClient-box"> |
| | | <el-dialog |
| | | :title="'客户管理'" |
| | | :title="'供应商名称'" |
| | | :visible.sync="editConfig.editVisible" |
| | | :width="dialogWidth" |
| | | :before-close="handleClose" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getClientList |
| | | } from "@/api/purchaseManage/purchase"; |
| | | import { getSupplierList } from "@/api/supplierManage/supplier" |
| | | export default { |
| | | name: "EditSelClientDialog", |
| | | props: { |
| | |
| | | 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 = [] |
| | |
| | | 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) || [] |
| | |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | | this.this.tableList.tableInfomation = [] |
| | | this.tableList.tableInfomation = [] |
| | | this.loading = false |
| | | }) |
| | | }, |
| | |
| | | }, |
| | | // 搜索 |
| | | 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() |
| | | } |
| | | } |