From 896f9758ed0dad473531b611dbbc019cb084e311 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 7 Feb 2024 15:41:07 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20ERP=EF=BC=9A=E5=A2=9E=E5=8A=A0=20ER?= =?UTF-8?q?P=20=E5=AE=A2=E6=88=B7=E7=9A=84=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/erp/sale/customer/index.ts | 58 +++++ src/views/erp/sale/customer/CustomerForm.vue | 210 +++++++++++++++++++ src/views/erp/sale/customer/index.vue | 199 ++++++++++++++++++ src/views/erp/stock/in/index.vue | 4 +- src/views/erp/stock/out/StockOutForm.vue | 7 +- src/views/erp/stock/out/index.vue | 13 +- 6 files changed, 480 insertions(+), 11 deletions(-) create mode 100644 src/api/erp/sale/customer/index.ts create mode 100644 src/views/erp/sale/customer/CustomerForm.vue create mode 100644 src/views/erp/sale/customer/index.vue diff --git a/src/api/erp/sale/customer/index.ts b/src/api/erp/sale/customer/index.ts new file mode 100644 index 00000000..3aaefb56 --- /dev/null +++ b/src/api/erp/sale/customer/index.ts @@ -0,0 +1,58 @@ +import request from '@/config/axios' + +// ERP 客户 VO +export interface CustomerVO { + id: number // 客户编号 + name: string // 客户名称 + contact: string // 联系人 + mobile: string // 手机号码 + telephone: string // 联系电话 + email: string // 电子邮箱 + fax: string // 传真 + remark: string // 备注 + status: number // 开启状态 + sort: number // 排序 + taxNo: string // 纳税人识别号 + taxPercent: number // 税率 + bankName: string // 开户行 + bankAccount: string // 开户账号 + bankAddress: string // 开户地址 +} + +// ERP 客户 API +export const CustomerApi = { + // 查询客户分页 + getCustomerPage: async (params: any) => { + return await request.get({ url: `/erp/customer/page`, params }) + }, + + // 查询客户精简列表 + getCustomerSimpleList: async () => { + return await request.get({ url: `/erp/customer/simple-list` }) + }, + + // 查询客户详情 + getCustomer: async (id: number) => { + return await request.get({ url: `/erp/customer/get?id=` + id }) + }, + + // 新增客户 + createCustomer: async (data: CustomerVO) => { + return await request.post({ url: `/erp/customer/create`, data }) + }, + + // 修改客户 + updateCustomer: async (data: CustomerVO) => { + return await request.put({ url: `/erp/customer/update`, data }) + }, + + // 删除客户 + deleteCustomer: async (id: number) => { + return await request.delete({ url: `/erp/customer/delete?id=` + id }) + }, + + // 导出客户 Excel + exportCustomer: async (params) => { + return await request.download({ url: `/erp/customer/export-excel`, params }) + } +} diff --git a/src/views/erp/sale/customer/CustomerForm.vue b/src/views/erp/sale/customer/CustomerForm.vue new file mode 100644 index 00000000..da6e004f --- /dev/null +++ b/src/views/erp/sale/customer/CustomerForm.vue @@ -0,0 +1,210 @@ + + diff --git a/src/views/erp/sale/customer/index.vue b/src/views/erp/sale/customer/index.vue new file mode 100644 index 00000000..e79cccb9 --- /dev/null +++ b/src/views/erp/sale/customer/index.vue @@ -0,0 +1,199 @@ + + + diff --git a/src/views/erp/stock/in/index.vue b/src/views/erp/stock/in/index.vue index dd08c649..e5eb53cc 100644 --- a/src/views/erp/stock/in/index.vue +++ b/src/views/erp/stock/in/index.vue @@ -199,7 +199,7 @@ link type="primary" @click="handleUpdateStatus(scope.row.id, 20)" - v-hasPermi="['erp:stock-in:update']" + v-hasPermi="['erp:stock-in:update-status']" v-if="scope.row.status === 10" > 审批 @@ -208,7 +208,7 @@ link type="danger" @click="handleUpdateStatus(scope.row.id, 10)" - v-hasPermi="['erp:stock-in:update']" + v-hasPermi="['erp:stock-in:update-status']" v-else > 反审批 diff --git a/src/views/erp/stock/out/StockOutForm.vue b/src/views/erp/stock/out/StockOutForm.vue index c8f04666..888475c2 100644 --- a/src/views/erp/stock/out/StockOutForm.vue +++ b/src/views/erp/stock/out/StockOutForm.vue @@ -34,7 +34,7 @@ class="!w-1/1" > formType.value === 'detail') const formRef = ref() // 表单 Ref -const supplierList = ref([]) // 客户列表 +const customerList = ref([]) // 客户列表 /** 子表的表单 */ const subTabsName = ref('item') @@ -125,7 +126,7 @@ const open = async (type: string, id?: number) => { } } // 加载客户列表 - supplierList.value = await SupplierApi.getSupplierSimpleList() + customerList.value = await CustomerApi.getCustomerSimpleList() } defineExpose({ open }) // 提供 open 方法,用于打开弹窗 diff --git a/src/views/erp/stock/out/index.vue b/src/views/erp/stock/out/index.vue index 39fd61b3..443fe736 100644 --- a/src/views/erp/stock/out/index.vue +++ b/src/views/erp/stock/out/index.vue @@ -51,7 +51,7 @@ class="!w-240px" > - + 审批 @@ -208,7 +208,7 @@ link type="danger" @click="handleUpdateStatus(scope.row.id, 10)" - v-hasPermi="['erp:stock-out:update']" + v-hasPermi="['erp:stock-out:update-status']" v-else > 反审批 @@ -249,6 +249,7 @@ import { SupplierApi, SupplierVO } from '@/api/erp/purchase/supplier' import { UserVO } from '@/api/system/user' import * as UserApi from '@/api/system/user' import { erpCountTableColumnFormatter, erpPriceTableColumnFormatter } from '@/utils' +import { CustomerApi, CustomerVO } from '@/api/erp/sale/customer' /** ERP 其它出库单列表 */ defineOptions({ name: 'ErpStockOut' }) @@ -273,7 +274,7 @@ const queryFormRef = ref() // 搜索的表单 const exportLoading = ref(false) // 导出的加载中 const productList = ref([]) // 产品列表 const warehouseList = ref([]) // 仓库列表 -const supplierList = ref([]) // 客户列表 TODO 芋艿:需要改下 +const customerList = ref([]) // 客户列表 const userList = ref([]) // 用户列表 /** 查询列表 */ @@ -360,7 +361,7 @@ onMounted(async () => { // 加载产品、仓库列表、客户 productList.value = await ProductApi.getProductSimpleList() warehouseList.value = await WarehouseApi.getWarehouseSimpleList() - supplierList.value = await SupplierApi.getSupplierSimpleList() + customerList.value = await CustomerApi.getCustomerSimpleList() userList.value = await UserApi.getSimpleUserList() }) // TODO 芋艿:可优化功能:列表界面,支持导入