feat: 家具初版

This commit is contained in:
砂糖
2025-09-03 11:55:00 +08:00
parent 623fa846a4
commit 82faee4f7c
44 changed files with 1824 additions and 943 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="客户名称" prop="name">
<el-input
v-model="queryParams.name"
@@ -18,18 +18,19 @@
/>
</el-form-item>
<el-form-item label="客户来源" prop="source">
<el-select v-model="queryParams.source" placeholder="请选择客户来源" clearable>
<el-select v-model="queryParams.source" placeholder="请选择客户来源" style="width: 150px;" clearable>
<el-option
v-for="dict in dict.type.customer_from"
v-for="dict in customer_from"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<!-- <el-input v-model="queryParams.source" placeholder="请输入客户来源" clearable @keyup.enter.native="handleQuery" /> -->
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button type="primary" icon="Search" size="small" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" size="small" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
@@ -38,8 +39,8 @@
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
icon="Plus"
size="small"
@click="handleAdd"
>新增</el-button>
</el-col>
@@ -47,8 +48,8 @@
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
icon="Edit"
size="small"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
@@ -57,8 +58,8 @@
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
icon="Delete"
size="small"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
@@ -67,17 +68,17 @@
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
icon="Download"
size="small"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<KLPTable v-loading="loading" :data="customerList" @selection-change="handleSelectionChange" :customColumns="customColumns">
<el-table v-loading="loading" :data="customerList" @selection-change="handleSelectionChange" :customColumns="customColumns">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="编号,主键自增" align="center" prop="customerId" v-if="false"/>
<el-table-column label="编号,主键自增" align="center" prop="customerId" v-if="false"/>
<el-table-column label="客户名称" align="center" prop="name" />
<el-table-column label="手机" align="center" prop="mobile" />
<el-table-column label="电话" align="center" prop="telephone" />
@@ -88,28 +89,28 @@
<el-table-column label="详细地址" align="center" prop="detailAddress" />
<el-table-column label="客户等级" align="center" prop="level" />
<el-table-column label="客户来源" align="center" prop="source">
<template slot-scope="scope">
<dict-tag :options="dict.type.customer_from" :value="scope.row.source"/>
<template #default="scope">
<dict-tag :options="customer_from" :value="scope.row.source"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<template #default="scope">
<el-button
size="mini"
size="small"
type="text"
icon="el-icon-edit"
icon="Edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
size="small"
type="text"
icon="el-icon-delete"
icon="Delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column> -->
</KLPTable>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
@@ -120,7 +121,7 @@
/>
<!-- 添加或修改CRM 客户对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="客户名称" prop="name">
<el-input v-model="form.name" placeholder="请输入客户名称" />
@@ -152,12 +153,13 @@
<el-form-item label="客户来源" prop="source">
<el-select v-model="form.source" placeholder="请选择客户来源">
<el-option
v-for="dict in dict.type.customer_from"
v-for="dict in customer_from"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
<!-- <el-input v-model="form.source" placeholder="请输入客户来源" /> -->
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
@@ -173,74 +175,76 @@
<script>
import { listCustomer, getCustomer, delCustomer, addCustomer, updateCustomer } from "@/api/wms/customer";
import KLPTable from '@/components/KLPUI/KLPTable/index.vue';
export default {
name: "Customer",
dicts: ['customer_from'],
components: {
KLPTable
setup() {
const { proxy } = getCurrentInstance();
const { customer_from } = proxy.useDict("customer_from");
return {
customer_from
}
},
data() {
return {
customColumns: [
{
label: '客户名称',
prop: 'name'
},
{
label: '手机',
prop: 'mobile'
},
{
label: '电话',
prop: 'telephone'
},
{
label: 'QQ',
prop: 'qq'
},
{
label: '微信',
prop: 'wechat'
},
{
label: '邮箱',
prop: 'email'
},
{
label: '地区编号',
prop: 'areaId'
},
{
label: '详细地址',
prop: 'detailAddress',
eclipse: true
},
{
label: '客户等级',
prop: 'level'
},
{
label: '客户来源',
prop: 'source'
},
{
label: '备注',
prop: 'remark'
},
{
label: '操作',
width: 150,
fixed: 'right',
render: (h, row) => {
const actions = [];
actions.push(<el-button type="text" size="mini" icon="el-icon-edit" onClick={() => this.handleUpdate(row)}>修改</el-button>)
actions.push(<el-button type="text" size="mini" icon="el-icon-delete" onClick={() => this.handleDelete(row)}>删除</el-button>)
return actions;
}
}
],
// customColumns: [
// {
// label: '客户名称',
// prop: 'name'
// },
// {
// label: '手机',
// prop: 'mobile'
// },
// {
// label: '电话',
// prop: 'telephone'
// },
// {
// label: 'QQ',
// prop: 'qq'
// },
// {
// label: '微信',
// prop: 'wechat'
// },
// {
// label: '邮箱',
// prop: 'email'
// },
// {
// label: '地区编号',
// prop: 'areaId'
// },
// {
// label: '详细地址',
// prop: 'detailAddress',
// eclipse: true
// },
// {
// label: '客户等级',
// prop: 'level'
// },
// {
// label: '客户来源',
// prop: 'source'
// },
// {
// label: '备注',
// prop: 'remark'
// },
// {
// label: '操作',
// width: 150,
// fixed: 'right',
// render: (h, row) => {
// const actions = [];
// actions.push(<el-button type="text" size="small" icon="el-icon-edit" onClick={() => this.handleUpdate(row)}>修改</el-button>)
// actions.push(<el-button type="text" size="small" icon="el-icon-delete" onClick={() => this.handleDelete(row)}>删除</el-button>)
// return actions;
// }
// }
// ],
// 按钮loading
buttonLoading: false,
// 遮罩层