From 274bbaf2ed74f11138e1789ad0294e8e3e9a40c8 Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期一, 15 十二月 2025 14:27:00 +0800
Subject: [PATCH] 新增客户管理
---
ui/admin-ui3/src/api/cwgl/customerManagement.ts | 67 ++++++++++++++++
ui/admin-ui3/src/views/cwgl/customerManagement/index.vue | 163 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 230 insertions(+), 0 deletions(-)
diff --git a/ui/admin-ui3/src/api/cwgl/customerManagement.ts b/ui/admin-ui3/src/api/cwgl/customerManagement.ts
new file mode 100644
index 0000000..4ea9a5e
--- /dev/null
+++ b/ui/admin-ui3/src/api/cwgl/customerManagement.ts
@@ -0,0 +1,67 @@
+import request,{download,requestType} from "@/utils/request";
+import {BaseEntityInterface} from "@/utils/globalInterface";
+export interface CustomerManagementI extends BaseEntityInterface{
+ id ?: number , customerFullName ?: string , customerShortName ?: string , customerType ?: string , contactPerson ?: string , address ?: string , contactPhone ?: string , customerCode ?: string , status ?: number , remark ?: string , createBy ?: string , updateBy ?: string , createTime ?: string , updateTime ?: string , deleted ?: number }
+
+
+/**
+ * 鏌ヨ瀹㈡埛绠$悊鍒楄〃
+ */
+export const listCustomerManagement:requestType = (query) => {
+ return request({
+ url: '/cwgl/customerManagement/list',
+ method:'get',
+ params:query
+ })
+}
+/**
+ * 鏌ヨ瀹㈡埛绠$悊璇︾粏
+ */
+export const getCustomerManagement:requestType = (id) => {
+ return request({
+ url: '/cwgl/customerManagement/' + id,
+ method:'get'
+ })
+}
+
+/**
+ * 鏂板瀹㈡埛绠$悊
+ */
+export const addCustomerManagement:requestType = (data) => {
+ return request({
+ url: '/cwgl/customerManagement',
+ method: 'post',
+ data
+ })
+}
+
+/**
+ * 淇敼瀹㈡埛绠$悊
+ */
+export const updateCustomerManagement:requestType = (data) => {
+ return request({
+ url: '/cwgl/customerManagement',
+ method: 'put',
+ data
+ })
+}
+
+/**
+ * 鍒犻櫎瀹㈡埛绠$悊
+ */
+export const delCustomerManagement:requestType = (id) => {
+ return request({
+ url: '/cwgl/customerManagement/' + id,
+ method: 'delete'
+ })
+}
+
+
+/**
+ * 瀵煎嚭瀹㈡埛绠$悊
+ */
+export const exportCustomerManagement:requestType = (query) => {
+ return new Promise<any>(()=>{
+ download('/cwgl/customerManagement/export',query);
+ })
+}
diff --git a/ui/admin-ui3/src/views/cwgl/customerManagement/index.vue b/ui/admin-ui3/src/views/cwgl/customerManagement/index.vue
new file mode 100644
index 0000000..2b8eb3e
--- /dev/null
+++ b/ui/admin-ui3/src/views/cwgl/customerManagement/index.vue
@@ -0,0 +1,163 @@
+<template>
+ <basicContainer >
+ <avue-crud
+ :option="option"
+ :table-loading="pageF.loading"
+ :data="tableData"
+ :page="page"
+ :permission="permissionList"
+ :before-open="beforeOpen"
+ v-model="form"
+ ref="crudRef"
+ @row-update="rowUpdate"
+ @row-save="rowSave"
+ @refresh-change="refreshChange"
+ @row-del="rowDel"
+ @search-change="searchChange"
+ @search-reset="searchReset"
+ @selection-change="selectionChange"
+ @current-change="currentChange"
+ @size-change="sizeChange"
+ @on-load="onLoad"
+ >
+ <template #menu-left>
+ <el-button
+ type="success"
+ icon="Edit"
+ :disabled="pageF.single"
+ v-hasPermi="['cwgl:customerManagement:edit']"
+ @click="handleUpdate">淇敼
+ </el-button>
+ <el-button
+ type="danger"
+ icon="Delete"
+ :disabled="pageF.multiple"
+ @click="handleDelete"
+ v-hasPermi="['cwgl:customerManagement:remove']"
+ >鍒犻櫎
+ </el-button>
+ <el-button
+ type="warning"
+ plain
+ icon="Download"
+ @click="handleExport"
+ v-hasPermi="['cwgl:customerManagement:export']"
+ >瀵煎嚭
+ </el-button>
+ </template>
+ </avue-crud>
+ </basicContainer>
+</template>
+
+<script setup name="customerManagement" lang="ts">
+ import {CustomerManagementI,addCustomerManagement, delCustomerManagement, exportCustomerManagement, getCustomerManagement, listCustomerManagement, updateCustomerManagement} from "@/api/cwgl/customerManagement";
+ import useCurrentInstance from "@/utils/useCurrentInstance";
+ import {computed,reactive, ref, toRefs} from "vue";
+ import {PagesInterface, PageQueryInterface} from "@/utils/globalInterface";
+ import {usePagePlus} from "@/hooks/usePagePlus";
+ import {hasPermission} from "@/utils/permissionUtils";
+
+ const { proxy } = useCurrentInstance();
+ const crudRef = ref();
+
+ const permissionList = computed(()=>{
+ return {
+ addBtn: hasPermission(["cwgl:customerManagement:add"]),
+ delBtn: hasPermission(["cwgl:customerManagement:remove"]),
+ editBtn: hasPermission(["cwgl:customerManagement:edit"]),
+ viewBtn: hasPermission(["cwgl:customerManagement:query"]),
+ }
+ })
+
+ const data = reactive({
+ form:<CustomerManagementI>{},
+ queryParams:<CustomerManagementI&PageQueryInterface>{},
+ page: <PagesInterface>{
+ pageSize: 10,
+ total: 0,
+ currentPage: 1,
+ },
+ selectionList:[],
+ })
+ const {queryParams,form,page,selectionList} = toRefs(data);
+ const option = ref({
+ pageKey: 'CustomerManagement',
+ rowKey: 'id',
+ column: {
+ id: {
+ label: 'ID',
+ },
+ customerFullName: {
+ label: '瀹㈡埛鍏ㄧО',
+ rules: [
+ {
+ required: true,
+ message: "瀹㈡埛鍏ㄧО涓嶈兘涓虹┖", trigger: "blur" }
+ ], },
+ customerShortName: {
+ label: '瀹㈡埛绠�绉�',
+ },
+ customerType: {
+ label: '瀹㈡埛绫诲瀷',
+ },
+ contactPerson: {
+ label: '鑱旂郴浜哄鍚�',
+ },
+ address: {
+ label: '鍦板潃',
+ type: 'textarea', minRows: 3, maxRows: 5,
+ },
+ contactPhone: {
+ label: '鑱旂郴浜虹數璇�',
+ },
+ customerCode: {
+ label: '瀹㈡埛缂栫爜',
+ },
+ status: {
+ label: '鐘舵��',
+ },
+ remark: {
+ label: '澶囨敞',
+ type: 'textarea', minRows: 3, maxRows: 5,
+ },
+ createBy: {
+ label: '鍒涘缓浜�',
+ },
+ updateBy: {
+ label: '鏇存柊浜�',
+ },
+ createTime: {
+ label: '鍒涘缓鏃堕棿',
+ },
+ updateTime: {
+ label: '鏇存柊鏃堕棿',
+ },
+ deleted: {
+ label: '鍒犻櫎鏍囪(0:姝e父;1:鍒犻櫎)',
+ },
+ }
+ })
+
+ const { tableData,pageF,rowSave,rowUpdate,rowDel,beforeOpen,searchChange,
+ searchReset,selectionChange,onLoad,currentChange,sizeChange,handleDelete,handleExport,handleUpdate,refreshChange} = usePagePlus({
+ form:form,
+ option:option,
+ queryParams:queryParams,
+ idKey:'id',
+ page:page.value,
+ getListApi:listCustomerManagement,
+ getDetailApi:getCustomerManagement,
+ exportApi:exportCustomerManagement,
+ deleteApi:delCustomerManagement,
+ addApi:addCustomerManagement,
+ updateApi:updateCustomerManagement,
+ handleUpdateFunc:()=>{
+ crudRef.value.rowEdit(selectionList.value[0]);
+ },
+ handleSelectionChangeFunc:(selection:any)=>{
+ selectionList.value = selection;
+ }
+ })
+
+
+</script>
--
Gitblit v1.8.0