From 7f080a4c548ffe33634166b800fec871d666e3f3 Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Sat, 10 Jun 2023 01:29:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AE=A2=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86;=20=E6=96=B0=E5=A2=9E=E5=90=88=E5=90=8C=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 - src/api/oa/customer/index.ts | 56 +- src/api/oa/customer/model/index.ts | 47 +- src/api/tower/contract/index.ts | 119 ++++ src/api/tower/contract/model/index.ts | 46 ++ src/api/tower/contractEquipment/index.ts | 133 ++++ .../tower/contractEquipment/model/index.ts | 39 ++ src/api/tower/contractFile/index.ts | 133 ++++ src/api/tower/contractFile/model/index.ts | 24 + .../components/select-data.vue | 156 +++++ src/components/ProjectSelectModel/index.vue | 65 ++ .../SelectCustomer/components/select-data.vue | 13 +- src/styles/common.less | 104 ++++ src/styles/index.less | 1 + src/views/oa/customer/index.ts | 139 +++++ src/views/oa/customer/model/index.ts | 49 ++ .../contract/components/contract-edit.vue | 570 ++++++++++++++++++ .../{customer-info.vue => contract-info.vue} | 0 .../contract/components/customer-edit.vue | 266 -------- .../tower/contract/components/search.vue | 5 +- src/views/tower/contract/index.vue | 77 +-- .../customer/components/customer-edit.vue | 61 +- src/views/tower/customer/index.vue | 38 +- yarn.lock | 322 +++++++++- 24 files changed, 2017 insertions(+), 447 deletions(-) create mode 100644 src/api/tower/contract/index.ts create mode 100644 src/api/tower/contract/model/index.ts create mode 100644 src/api/tower/contractEquipment/index.ts create mode 100644 src/api/tower/contractEquipment/model/index.ts create mode 100644 src/api/tower/contractFile/index.ts create mode 100644 src/api/tower/contractFile/model/index.ts create mode 100644 src/components/ProjectSelectModel/components/select-data.vue create mode 100644 src/components/ProjectSelectModel/index.vue create mode 100644 src/styles/common.less create mode 100644 src/views/oa/customer/index.ts create mode 100644 src/views/oa/customer/model/index.ts create mode 100644 src/views/tower/contract/components/contract-edit.vue rename src/views/tower/contract/components/{customer-info.vue => contract-info.vue} (100%) delete mode 100644 src/views/tower/contract/components/customer-edit.vue diff --git a/package.json b/package.json index 6d04be6..db84680 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,6 @@ "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-vue": "^9.4.0", "less": "^4.1.3", - "postcss": "^8.4.16", "prettier": "^2.7.1", "rimraf": "^3.0.2", "terser": "^5.15.0", diff --git a/src/api/oa/customer/index.ts b/src/api/oa/customer/index.ts index 00950e8..734b3e0 100644 --- a/src/api/oa/customer/index.ts +++ b/src/api/oa/customer/index.ts @@ -1,13 +1,13 @@ import request from '@/utils/request'; -import type { ApiResult, PageResult } from '@/api'; -import type { Customer, CustomerParam } from './model'; +import type {ApiResult, PageResult} from '@/api'; +import type {Customer, CustomerParam} from './model'; /** * 分页查询客户 */ export async function pageCustomer(params: CustomerParam) { const res = await request.get>>( - '/oa/customer/page', + '/tower/tower-customer/page', { params } @@ -22,9 +22,12 @@ export async function pageCustomer(params: CustomerParam) { * 查询客户列表 */ export async function listCustomer(params?: CustomerParam) { - const res = await request.get>('/oa/customer', { - params - }); + const res = await request.get>( + '/tower/tower-customer', + { + params + } + ); if (res.data.code === 0 && res.data.data) { return res.data.data; } @@ -35,7 +38,9 @@ export async function listCustomer(params?: CustomerParam) { * 根据id查询客户 */ export async function getCustomer(id: number) { - const res = await request.get>('/oa/customer/' + id); + const res = await request.get>( + '/tower/tower-customer/' + id + ); if (res.data.code === 0 && res.data.data) { return res.data.data; } @@ -46,7 +51,10 @@ export async function getCustomer(id: number) { * 添加客户 */ export async function addCustomer(data: Customer) { - const res = await request.post>('/oa/customer', data); + const res = await request.post>( + '/tower/tower-customer', + data + ); if (res.data.code === 0) { return res.data.message; } @@ -57,7 +65,10 @@ export async function addCustomer(data: Customer) { * 修改客户 */ export async function updateCustomer(data: Customer) { - const res = await request.put>('/oa/customer', data); + const res = await request.put>( + '/tower/tower-customer', + data + ); if (res.data.code === 0) { return res.data.message; } @@ -68,7 +79,10 @@ export async function updateCustomer(data: Customer) { * 批量修改客户 */ export async function updateBatchCustomer(data: Customer[]) { - const res = await request.put>('/oa/customer/batch', data); + const res = await request.put>( + '/tower/tower-customer/batch', + data + ); if (res.data.code === 0) { return res.data.message; } @@ -79,7 +93,9 @@ export async function updateBatchCustomer(data: Customer[]) { * 删除客户 */ export async function removeCustomer(id?: number) { - const res = await request.delete>('/oa/customer/' + id); + const res = await request.delete>( + '/tower/tower-customer/' + id + ); if (res.data.code === 0) { return res.data.message; } @@ -90,9 +106,12 @@ export async function removeCustomer(id?: number) { * 批量删除客户 */ export async function removeBatchCustomer(data: (number | undefined)[]) { - const res = await request.delete>('/oa/customer/batch', { - data - }); + const res = await request.delete>( + '/tower/tower-customer/batch', + { + data + } + ); if (res.data.code === 0) { return res.data.message; } @@ -107,9 +126,12 @@ export async function checkExistence( value: string, id?: number ) { - const res = await request.get>('/oa/customer/existence', { - params: { field, value, id } - }); + const res = await request.get>( + '/tower/tower-customer/existence', + { + params: {field, value, id} + } + ); if (res.data.code === 0) { return res.data.message; } diff --git a/src/api/oa/customer/model/index.ts b/src/api/oa/customer/model/index.ts index 722296a..23c9bb4 100644 --- a/src/api/oa/customer/model/index.ts +++ b/src/api/oa/customer/model/index.ts @@ -6,59 +6,44 @@ import type { PageParam } from '@/api'; export interface Customer { // 客户id customerId?: number; - // 客户类型 - customerType?: string; - // 客户来源 - customerSource?: string; // 客户标识 - customerCode: string; + creditCode: string; // 客户名称 - customerName?: string; + name: string; // 客户全称 - customerFullName?: string; + fullName?: string; // 客户头像 - customerAvatar?: string; + avatar?: string; // 座机电话 - customerPhone?: string; + phone?: string; // 手机号码 - customerMobile?: string; + telPhone?: string; // 联系人 - customerContacts?: string; + contact?: string; // 联系地址 - customerAddress?: string; - customerProvince?: string; - customerCity?: string; - customerRegion?: string; - longitude?: string; - latitude?: string; - // 跟进状态 - progress?: string; + address?: string; // 排序 sortNumber?: number; - // 备注 - comments?: string; // 创建时间 createTime?: string; - // 状态 - status?: string; + // 备注 + remark?: string; // 用户ID userId?: any; - // 发布者昵称 - nickname?: string; + projectName?: any; + companyName?: any; + customerName?: any; + } /** * 客户搜索条件 */ export interface CustomerParam extends PageParam { - customerName?: string; - customerCode?: string; - customerType?: string; + name?: string; + creditCode?: string; createTimeStart?: string; createTimeEnd?: string; - customerCategory?: string; - progress?: string; - customerSource?: string; betweenTime?: any; userId?: number; nickname?: string; diff --git a/src/api/tower/contract/index.ts b/src/api/tower/contract/index.ts new file mode 100644 index 0000000..bc90d7b --- /dev/null +++ b/src/api/tower/contract/index.ts @@ -0,0 +1,119 @@ +import request from '@/utils/request'; +import type {ApiResult, PageResult} from '@/api'; +import type {Contract, ContractParam} from './model'; + +/** + * 分页查询合同 + */ +export async function pageContract(params: ContractParam) { + const res = await request.get>>( + '/tower/tower-contract/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询合同列表 + */ +export async function listContract(params?: ContractParam) { + const res = await request.get>( + '/tower/tower-contract', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询合同 + */ +export async function getContract(id: number) { + const res = await request.get>( + '/tower/tower-contract/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加合同 + */ +export async function addContract(data: Contract) { + const res = await request.post>( + '/tower/tower-contract', + data + ); + if (res.data.code === 0) { + return res.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改合同 + */ +export async function updateContract(data: Contract) { + const res = await request.put>( + '/tower/tower-contract', + data + ); + if (res.data.code === 0) { + return res.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量修改合同 + */ +export async function updateBatchContract(data: Contract[]) { + const res = await request.put>( + '/tower/tower-contract/batch', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除合同 + */ +export async function removeContract(id?: number) { + const res = await request.delete>( + '/tower/tower-contract/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除合同 + */ +export async function removeBatchContract(data: (number | undefined)[]) { + const res = await request.delete>( + '/tower/tower-contract/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/tower/contract/model/index.ts b/src/api/tower/contract/model/index.ts new file mode 100644 index 0000000..5cef615 --- /dev/null +++ b/src/api/tower/contract/model/index.ts @@ -0,0 +1,46 @@ +import type { PageParam } from '@/api'; + +/** + * 合同 + */ +export interface Contract { + // 合同id + contractId?: any; + // 项目id + projectId: any; + // 承租方 + companyId: any; + // 出租方 + customerId: any; + // 业务负责人 + customerContact?: string; + // 合同编号 + contactNumber: string; + // 签订日期 + signDate?: string; + // 开始日期 + startDate?: string; + // 截止日期 + endDate?: string; + // 合同金额 + contractAmount?: number; + // 合同约定金额 + contactAgreeAmount?: string; + // 合同是否已存档 + isInStock?: number; + // 是否自动结算 + autoSettle?: number; + userId?: any; + +} + +/** + * 合同搜索条件 + */ +export interface ContractParam extends PageParam { + contactNumber?: string; + createTimeStart?: string; + createTimeEnd?: string; + betweenTime?: any; + +} diff --git a/src/api/tower/contractEquipment/index.ts b/src/api/tower/contractEquipment/index.ts new file mode 100644 index 0000000..d12e0bb --- /dev/null +++ b/src/api/tower/contractEquipment/index.ts @@ -0,0 +1,133 @@ +import request from '@/utils/request'; +import type {ApiResult, PageResult} from '@/api'; +import type {ContractEquipment, ContractEquipmentParam} from './model'; + +/** + * 分页查询合同设备 + */ +export async function pageContract(params: ContractEquipmentParam) { + const res = await request.get>>( + '/tower/tower-contract-equipment/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询合同设备列表 + */ +export async function listContractEquipment(params?: ContractEquipmentParam) { + const res = await request.get>( + '/tower/tower-contract-equipment', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询合同设备 + */ +export async function getContractEquipment(id: number) { + const res = await request.get>( + '/tower/tower-contract-equipment/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加合同设备 + */ +export async function addContractEquipment(data: ContractEquipment) { + const res = await request.post>( + '/tower/tower-contract-equipment', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改合同设备 + */ +export async function updateContractEquipment(data: ContractEquipment) { + const res = await request.put>( + '/tower/tower-contract-equipment', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量修改合同设备 + */ +export async function updateBatchContractEquipment(data: ContractEquipment[]) { + const res = await request.put>( + '/tower/tower-contract-equipment/batch', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量添加合同设备 + */ +export async function addBatchContractEquipment(data: ContractEquipment[]) { + const res = await request.post>( + '/tower/tower-contract-equipment/batch', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除合同设备 + */ +export async function removeContractEquipment(id?: number) { + const res = await request.delete>( + '/tower/tower-contract-equipment/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除合同设备 + */ +export async function removeBatchContractEquipment(data: (number | undefined)[]) { + const res = await request.delete>( + '/tower/tower-contract-equipment/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/tower/contractEquipment/model/index.ts b/src/api/tower/contractEquipment/model/index.ts new file mode 100644 index 0000000..e2af015 --- /dev/null +++ b/src/api/tower/contractEquipment/model/index.ts @@ -0,0 +1,39 @@ +import type { PageParam } from '@/api'; + +/** + * 合同 + */ +export interface ContractEquipment { + contractEquipmentId?: any; + // 合同id + contractId: any; + // 设备名 + equipmentName: string; + // 规格 + equipmentModel: string; + // 数量 + num: any; + // 租期 + planRentMonth: any; + // 租金 + rentAmount: any; + // 进退场费 + inOutAmount: any; + // 劳务费 + workerAmount: any; + // 其他费用 + otherAmount: any; + // 预埋费 + preBuryAmount: any; + // 备注 + remark?: any; + userId?: any; + +} + +/** + * 合同搜索条件 + */ +export interface ContractEquipmentParam extends PageParam { + contactId?: string; +} diff --git a/src/api/tower/contractFile/index.ts b/src/api/tower/contractFile/index.ts new file mode 100644 index 0000000..5e8eda5 --- /dev/null +++ b/src/api/tower/contractFile/index.ts @@ -0,0 +1,133 @@ +import request from "@/utils/request"; +import type { ApiResult, PageResult } from "@/api"; +import type { ContractFile, ContractFileParam } from "./model"; + +/** + * 分页查询合同文件 + */ +export async function pageContract(params: ContractFileParam) { + const res = await request.get>>( + "/tower/tower-contract/page", + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询合同文件列表 + */ +export async function listContractFile(params?: ContractFileParam) { + const res = await request.get>( + "/tower/tower-contract-file", + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询合同文件 + */ +export async function getContractFile(id: number) { + const res = await request.get>( + "/tower/tower-contract-file/" + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加合同文件 + */ +export async function addContractFile(data: ContractFile) { + const res = await request.post>( + "/tower/tower-contract-file", + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改合同文件 + */ +export async function updateContractFile(data: ContractFile) { + const res = await request.put>( + "/tower/tower-contract-file", + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量修改合同文件 + */ +export async function updateBatchContractFile(data: ContractFile[]) { + const res = await request.put>( + "/tower/tower-contract-file/batch", + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量添加合同文件 + */ +export async function addBatchContractFile(data: ContractFile[]) { + const res = await request.post>( + "/tower/tower-contract-file/batch", + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除合同文件 + */ +export async function removeContractFile(id?: number) { + const res = await request.delete>( + "/tower/tower-contract-file/" + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除合同文件 + */ +export async function removeBatchContractFile(data: (number | undefined)[]) { + const res = await request.delete>( + "/tower/tower-contract-file/batch", + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/tower/contractFile/model/index.ts b/src/api/tower/contractFile/model/index.ts new file mode 100644 index 0000000..24d2a7d --- /dev/null +++ b/src/api/tower/contractFile/model/index.ts @@ -0,0 +1,24 @@ +import type { PageParam } from '@/api'; + +/** + * 合同 + */ +export interface ContractFile { + // 文件id + contractFileId?: any; + // 项目id + contractId?: any; + // 路径 + path: string; + // 文件类型 + type?: any; + userId?: any; + +} + +/** + * 合同搜索条件 + */ +export interface ContractFileParam extends PageParam { + contactId?: string; +} diff --git a/src/components/ProjectSelectModel/components/select-data.vue b/src/components/ProjectSelectModel/components/select-data.vue new file mode 100644 index 0000000..91ea886 --- /dev/null +++ b/src/components/ProjectSelectModel/components/select-data.vue @@ -0,0 +1,156 @@ + + + + diff --git a/src/components/ProjectSelectModel/index.vue b/src/components/ProjectSelectModel/index.vue new file mode 100644 index 0000000..7eefe0c --- /dev/null +++ b/src/components/ProjectSelectModel/index.vue @@ -0,0 +1,65 @@ + + + diff --git a/src/components/SelectCustomer/components/select-data.vue b/src/components/SelectCustomer/components/select-data.vue index a5e3c11..de53ea1 100644 --- a/src/components/SelectCustomer/components/select-data.vue +++ b/src/components/SelectCustomer/components/select-data.vue @@ -94,17 +94,16 @@ customRender: ({ index }) => index + (tableRef.value?.tableIndex ?? 0) }, { - title: '企业名称', - dataIndex: 'customerName' + title: '客户名称', + dataIndex: 'name' }, { - title: '企业类型', - dataIndex: 'customerType' + title: '联系人', + dataIndex: 'contact' }, { - title: '企业LOGO', - dataIndex: 'customerLogo', - key: 'customerLogo' + title: '联系电话', + dataIndex: 'telPhone' }, { title: '操作', diff --git a/src/styles/common.less b/src/styles/common.less new file mode 100644 index 0000000..134846b --- /dev/null +++ b/src/styles/common.less @@ -0,0 +1,104 @@ +.text-white { + color: white; +} + +.h-full{ + height: 100%; +} + +.border{ + border: 1px solid #ebeef5; +} + +.border-r-white { + border-right: 1px solid white; +} + +.p-05{ + padding: .5rem 0; +} + +.bg-blue { + background-color: #1890ff; +} + +.flex { + display: flex; +} + +.flex-wrap { + flex-wrap: wrap; +} + +.justify-center { + justify-content: center; +} + +.justify-start { + justify-content: flex-start; +} + +.justify-end { + justify-content: flex-end; +} + +.justify-between { + justify-content: space-between; +} + +.justify-around { + justify-content: space-around; +} + +.items-center { + align-items: center; +} + +.items-start { + align-items: flex-start; +} + +.items-end { + align-items: flex-end; +} + +.flex-col { + flex-direction: column; +} + +.flex-1 { + flex: 1; +} + +.flex-2 { + flex: 2; +} + +.flex-shrink { + flex-shrink: 0; +} + +.flex-none { + flex: none; +} + +.flex-grow { + flex-grow: 1 +} + +.flex-grow-0 { + flex-grow: 0 +} + +.text-center{ + text-align: center; +} + +.text-grey{ + color: #999; +} + +.my-05{ + margin-top: .5rem; + margin-bottom: .5rem; +} diff --git a/src/styles/index.less b/src/styles/index.less index 33b2f2f..01cb779 100644 --- a/src/styles/index.less +++ b/src/styles/index.less @@ -2,6 +2,7 @@ @style-entry-file: as-needed; @import './@{style-entry-file}.less'; @import './transition/index.less'; +@import './common.less'; // 主题 @import 'ele-admin-pro/es/style/themes/dynamic.less'; diff --git a/src/views/oa/customer/index.ts b/src/views/oa/customer/index.ts new file mode 100644 index 0000000..734b3e0 --- /dev/null +++ b/src/views/oa/customer/index.ts @@ -0,0 +1,139 @@ +import request from '@/utils/request'; +import type {ApiResult, PageResult} from '@/api'; +import type {Customer, CustomerParam} from './model'; + +/** + * 分页查询客户 + */ +export async function pageCustomer(params: CustomerParam) { + const res = await request.get>>( + '/tower/tower-customer/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询客户列表 + */ +export async function listCustomer(params?: CustomerParam) { + const res = await request.get>( + '/tower/tower-customer', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询客户 + */ +export async function getCustomer(id: number) { + const res = await request.get>( + '/tower/tower-customer/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加客户 + */ +export async function addCustomer(data: Customer) { + const res = await request.post>( + '/tower/tower-customer', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改客户 + */ +export async function updateCustomer(data: Customer) { + const res = await request.put>( + '/tower/tower-customer', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量修改客户 + */ +export async function updateBatchCustomer(data: Customer[]) { + const res = await request.put>( + '/tower/tower-customer/batch', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除客户 + */ +export async function removeCustomer(id?: number) { + const res = await request.delete>( + '/tower/tower-customer/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除客户 + */ +export async function removeBatchCustomer(data: (number | undefined)[]) { + const res = await request.delete>( + '/tower/tower-customer/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 检查IP是否存在 + */ +export async function checkExistence( + field: string, + value: string, + id?: number +) { + const res = await request.get>( + '/tower/tower-customer/existence', + { + params: {field, value, id} + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/views/oa/customer/model/index.ts b/src/views/oa/customer/model/index.ts new file mode 100644 index 0000000..5ab8482 --- /dev/null +++ b/src/views/oa/customer/model/index.ts @@ -0,0 +1,49 @@ +import type { PageParam } from '@/api'; + +/** + * 客户 + */ +export interface Customer { + // 客户id + customerId?: number; + // 客户标识 + creditCode: string; + // 客户名称 + name: string; + // 客户全称 + fullName?: string; + // 客户头像 + avatar?: string; + // 座机电话 + phone?: string; + // 手机号码 + telPhone?: string; + // 联系人 + contact?: string; + // 联系地址 + address?: string; + // 排序 + sortNumber?: number; + // 创建时间 + createTime?: string; + // 备注 + remark?: string; + // 用户ID + userId?: any; + +} + +/** + * 客户搜索条件 + */ +export interface CustomerParam extends PageParam { + name?: string; + creditCode?: string; + createTimeStart?: string; + createTimeEnd?: string; + betweenTime?: any; + userId?: number; + nickname?: string; + // 商户编号 + merchantCode?: string; +} diff --git a/src/views/tower/contract/components/contract-edit.vue b/src/views/tower/contract/components/contract-edit.vue new file mode 100644 index 0000000..b524ff9 --- /dev/null +++ b/src/views/tower/contract/components/contract-edit.vue @@ -0,0 +1,570 @@ + + + + + diff --git a/src/views/tower/contract/components/customer-info.vue b/src/views/tower/contract/components/contract-info.vue similarity index 100% rename from src/views/tower/contract/components/customer-info.vue rename to src/views/tower/contract/components/contract-info.vue diff --git a/src/views/tower/contract/components/customer-edit.vue b/src/views/tower/contract/components/customer-edit.vue deleted file mode 100644 index 475a7b4..0000000 --- a/src/views/tower/contract/components/customer-edit.vue +++ /dev/null @@ -1,266 +0,0 @@ - - - - - diff --git a/src/views/tower/contract/components/search.vue b/src/views/tower/contract/components/search.vue index 634741a..bb9c274 100644 --- a/src/views/tower/contract/components/search.vue +++ b/src/views/tower/contract/components/search.vue @@ -66,9 +66,8 @@ // 表单数据 const { where } = useSearch({ - customerName: '', - customerCode: '', - nickname: '', + name: '', + creditCode: '', keywords: '', userId: undefined }); diff --git a/src/views/tower/contract/index.vue b/src/views/tower/contract/index.vue index 7a6ebcc..90f157e 100644 --- a/src/views/tower/contract/index.vue +++ b/src/views/tower/contract/index.vue @@ -22,45 +22,6 @@ />