diff --git a/src/api/system/company/model/index.ts b/src/api/system/company/model/index.ts
index f8d4970..b950b3e 100644
--- a/src/api/system/company/model/index.ts
+++ b/src/api/system/company/model/index.ts
@@ -6,6 +6,7 @@ export interface Company {
shortName?: string;
companyName?: string;
companyType?: number;
+ companyTypeMultiple?: string;
companyLogo?: string;
companyCode?: string;
domain?: string;
@@ -28,6 +29,7 @@ export interface Company {
address?: string;
latitude?: string;
longitude?: string;
+ businessEntity?: string;
comments?: string;
authentication?: number;
industryId?: number;
diff --git a/src/api/tower/accessory/model/index.ts b/src/api/tower/accessory/model/index.ts
index cc9f887..85e228b 100644
--- a/src/api/tower/accessory/model/index.ts
+++ b/src/api/tower/accessory/model/index.ts
@@ -4,8 +4,9 @@ export interface Accessory {
accessoryId?: undefined;
accessoryName?: string;
accessoryNo?: string;
- accessoryCategory?: string;
+ accessoryCategory?: object;
accessoryModel?: string;
+ accessoryModelMultiple?: string[];
accessorySpecs?: string;
accessoryPrice?: number;
accessoryUnit?: string;
diff --git a/src/api/tower/model/model/index.ts b/src/api/tower/model/model/index.ts
index a74eddb..1f5c6d7 100644
--- a/src/api/tower/model/model/index.ts
+++ b/src/api/tower/model/model/index.ts
@@ -5,9 +5,11 @@ import type { PageParam } from '@/api';
*/
export interface TowerModel {
// 型号分类id
- categoryId?: number;
- // 型号分类
- title?: string;
+ modelId?: number;
+ // 设备名称
+ name?: string;
+ // 设备型号
+ model?: string;
// 型号分类图片
image?: string;
// 使用年限
@@ -37,8 +39,6 @@ export interface TowerModel {
//
merchantCode?: string;
value?: number;
- // 子菜单
- children?: TowerModel[];
}
/**
diff --git a/src/components/AccessoryCategory/index.vue b/src/components/AccessoryCategory/index.vue
new file mode 100644
index 0000000..5a6ddfe
--- /dev/null
+++ b/src/components/AccessoryCategory/index.vue
@@ -0,0 +1,81 @@
+
+
+
+
+
+
diff --git a/src/components/AccessoryCategory/types/index.ts b/src/components/AccessoryCategory/types/index.ts
new file mode 100644
index 0000000..7c49435
--- /dev/null
+++ b/src/components/AccessoryCategory/types/index.ts
@@ -0,0 +1,15 @@
+/**
+ * 行业类型
+ */
+export interface IndustryData {
+ label: string;
+ value: string;
+ children?: {
+ value: string;
+ label: string;
+ children?: {
+ value: string;
+ label: string;
+ }[];
+ }[];
+}
diff --git a/src/components/TowerSelectModel/components/select-data.vue b/src/components/TowerSelectModel/components/select-data.vue
new file mode 100644
index 0000000..ab37c93
--- /dev/null
+++ b/src/components/TowerSelectModel/components/select-data.vue
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 选择
+
+
+
+
+
+
+
+
+
diff --git a/src/components/TowerSelectModel/index.vue b/src/components/TowerSelectModel/index.vue
new file mode 100644
index 0000000..0c3deb9
--- /dev/null
+++ b/src/components/TowerSelectModel/index.vue
@@ -0,0 +1,63 @@
+
+
+
+
+
diff --git a/src/components/TowerSelectModelMultiple/components/select-data.vue b/src/components/TowerSelectModelMultiple/components/select-data.vue
new file mode 100644
index 0000000..281be3a
--- /dev/null
+++ b/src/components/TowerSelectModelMultiple/components/select-data.vue
@@ -0,0 +1,143 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 选择
+
+
+
+
+
+
+
+
+
diff --git a/src/components/TowerSelectModelMultiple/index.vue b/src/components/TowerSelectModelMultiple/index.vue
new file mode 100644
index 0000000..554c353
--- /dev/null
+++ b/src/components/TowerSelectModelMultiple/index.vue
@@ -0,0 +1,62 @@
+
+
+
+
+
diff --git a/src/views/tower/accessory/components/accessory-edit.vue b/src/views/tower/accessory/components/accessory-edit.vue
index 381731b..7c7744b 100644
--- a/src/views/tower/accessory/components/accessory-edit.vue
+++ b/src/views/tower/accessory/components/accessory-edit.vue
@@ -24,10 +24,11 @@
v-bind="styleResponsive ? { md: 8, sm: 24, xs: 24 } : { span: 8 }"
>
-
@@ -77,11 +78,10 @@
v-bind="styleResponsive ? { md: 8, sm: 24, xs: 24 } : { span: 8 }"
>
-
@@ -114,11 +114,6 @@
:customer-type="`产权单位`"
@done="chooseCompanyName"
/>
-
-
-
-
-
-
-
+
@@ -198,10 +193,7 @@
import { Accessory } from '@/api/tower/accessory/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
- import CategorySelect from './category-select.vue';
- import ModelSelect from './model-select.vue';
import { FormInstance } from 'ant-design-vue/es/form';
- import { Warehouse } from '@/api/tower/warehouse/model';
import { Customer } from '@/api/oa/customer/model';
import { Category } from '@/api/goods/category/model';
import { TowerModel } from '@/api/tower/model/model';
@@ -232,6 +224,7 @@
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
+ // 表格选中数据
const formRef = ref(null);
// 用户信息
@@ -239,8 +232,9 @@
accessoryId: undefined,
accessoryName: '',
accessoryNo: '',
- accessoryCategory: '',
+ accessoryCategory: undefined,
accessoryModel: '',
+ accessoryModelMultiple: [],
accessorySpecs: '',
accessoryPrice: 0,
accessoryUnit: '',
@@ -270,7 +264,7 @@
accessoryCategory: [
{
required: true,
- type: 'number',
+ type: 'array',
message: '请输入配件分类',
trigger: 'blur'
}
@@ -286,7 +280,7 @@
accessoryModel: [
{
required: true,
- type: 'number',
+ type: 'string',
message: '请输入设备型号',
trigger: 'blur'
}
@@ -318,22 +312,17 @@
});
const { resetFields } = useForm(form, rules);
-
- const chooseModel = (data: Warehouse) => {
- form.accessoryModel = data.warehouseName;
- };
-
const chooseCompanyName = (data: Customer) => {
form.companyName = data.customerName;
};
-
- const handleModel = (index) => {
- props.modelList?.map((d) => {
- console.log(index);
- console.log(d.categoryId);
- if (index == d.categoryId) {
- form.lifeYear = Number(d.yearLife);
- }
+ const chooseAccessoryModel = (data: TowerModel) => {
+ form.accessoryModel = data.name?.concat(String(data.model));
+ form.lifeYear = data.yearLife;
+ };
+ const chooseMultiple = (data) => {
+ form.accessoryModelMultiple = [];
+ data.map((d) => {
+ form.accessoryModelMultiple?.push(`${d.name}${d.model}`);
});
};
@@ -346,8 +335,11 @@
.validate()
.then(() => {
loading.value = true;
+ console.log(form.accessoryCategory?.[0]);
const formData = {
- ...form
+ ...form,
+ accessoryCategory: `${form.accessoryCategory?.[0]} / ${form.accessoryCategory?.[1]}`,
+ accessoryModelMultiple: JSON.stringify(form.accessoryModelMultiple)
};
const saveOrUpdate = isUpdate.value ? updateAccessory : addAccessory;
saveOrUpdate(formData)
@@ -371,6 +363,16 @@
if (visible) {
if (props.data) {
assignObject(form, props.data);
+ const accessoryCategory = String(props.data.accessoryCategory);
+ const split = accessoryCategory?.split(' / ');
+ if (typeof split == 'object') {
+ form.accessoryCategory = split;
+ }
+ if (props.data.accessoryModelMultiple) {
+ form.accessoryModelMultiple = JSON.parse(
+ String(form.accessoryModelMultiple)
+ );
+ }
isUpdate.value = true;
} else {
isUpdate.value = false;
diff --git a/src/views/tower/accessory/index.vue b/src/views/tower/accessory/index.vue
index 348ab50..93c7b3f 100644
--- a/src/views/tower/accessory/index.vue
+++ b/src/views/tower/accessory/index.vue
@@ -370,41 +370,6 @@
});
};
- /* 查询 */
- const query2 = () => {
- loading.value = true;
- listTowerModel()
- .then((list) => {
- loading.value = false;
- data2List.value = list;
- const eks: number[] = [];
- list.forEach((d) => {
- d.key = d.categoryId;
- d.value = d.categoryId;
- if (typeof d.categoryId === 'number') {
- eks.push(d.categoryId);
- }
- });
- expandedRowKeys.value = eks;
- data2.value = toTreeData({
- data: list,
- idField: 'categoryId',
- parentIdField: 'parentId'
- });
- if (list.length) {
- if (typeof list[0].categoryId === 'number') {
- selectedRowKeys.value = [list[0].categoryId];
- }
- } else {
- selectedRowKeys.value = [];
- }
- })
- .catch((e) => {
- loading.value = false;
- message.error(e.message);
- });
- };
-
/* 自定义行属性 */
const customRow = (record: Accessory) => {
return {
@@ -420,7 +385,6 @@
};
query();
- query2();
+
+
diff --git a/src/views/tower/model/index.vue b/src/views/tower/model/index.vue
index a58d873..1d52523 100644
--- a/src/views/tower/model/index.vue
+++ b/src/views/tower/model/index.vue
@@ -4,17 +4,14 @@
@@ -24,12 +21,6 @@
新建
-
- 展开全部
-
-
- 折叠全部
-
-
- 外链
-
- 内链
-
- 目录
- 分类
- 按钮
-
-
-
-
- {{ record.title }}
-
-
-
- 显示
- 隐藏
-
-
+
- 添加
-
修改
删除
@@ -84,13 +49,7 @@
-
+
@@ -100,20 +59,14 @@
import { PlusOutlined } from '@ant-design/icons-vue';
import type {
DatasourceFunction,
- ColumnItem,
- EleProTableDone
+ ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
- import {
- messageLoading,
- toDateString,
- isExternalLink,
- toTreeData,
- eachTreeData
- } from 'ele-admin-pro/es';
+ import { messageLoading, toDateString } from 'ele-admin-pro/es';
import type { EleProTable } from 'ele-admin-pro/es';
- import CategoryEdit from './components/category-edit.vue';
import type { TowerModel, TowerModelParam } from '@/api/tower/model/model';
import { listTowerModel, removeTowerModel } from '@/api/tower/model';
+ import ModelEdit from '@/views/tower/model/components/model-edit.vue';
+ import { TowerEquipment } from "@/api/tower/equipment/model";
// 表格实例
const tableRef = ref | null>(null);
@@ -128,9 +81,17 @@
hideInSetting: true,
customRender: ({ index }) => index + (tableRef.value?.tableIndex ?? 0)
},
+ {
+ title: '设备名称',
+ dataIndex: 'name',
+ key: 'name',
+ showSorterTooltip: false,
+ ellipsis: true
+ },
{
title: '设备型号',
- key: 'title',
+ dataIndex: 'model',
+ key: 'model',
showSorterTooltip: false,
ellipsis: true
},
@@ -141,22 +102,6 @@
showSorterTooltip: false,
ellipsis: true
},
- {
- title: '排序',
- dataIndex: 'sortNumber',
- sorter: true,
- width: 180,
- showSorterTooltip: false
- },
- {
- title: '状态',
- dataIndex: 'status',
- key: 'status',
- sorter: true,
- width: 180,
- showSorterTooltip: false,
- customRender: ({ text }) => ['显示', '隐藏'][text]
- },
{
title: '创建时间',
dataIndex: 'createTime',
@@ -176,40 +121,18 @@
// 当前编辑数据
const current = ref(null);
-
+ const searchText = ref('');
// 是否显示编辑弹窗
const showEdit = ref(false);
- // 上级分类id
- const parentId = ref();
-
- // 分类数据
- const categoryData = ref([]);
-
- // 表格展开的行
- const expandedRowKeys = ref([]);
-
// 表格数据源
const datasource: DatasourceFunction = ({ where }) => {
+ if (searchText.value) {
+ where.keywords = searchText.value;
+ }
return listTowerModel({ ...where });
};
- /* 数据转为树形结构 */
- const parseData = (data: TowerModel[]) => {
- return toTreeData({
- data: data.map((d) => {
- return { ...d, key: d.categoryId, value: d.categoryId };
- }),
- idField: 'categoryId',
- parentIdField: 'parentId'
- });
- };
-
- /* 表格渲染完成回调 */
- const onDone: EleProTableDone = ({ data }) => {
- categoryData.value = data;
- };
-
/* 刷新表格 */
const reload = (where?: TowerModelParam) => {
tableRef?.value?.reload({ where });
@@ -218,22 +141,17 @@
/* 打开编辑弹窗 */
const openEdit = (row?: TowerModel | null, id?: number) => {
current.value = row ?? null;
- parentId.value = id;
showEdit.value = true;
};
const search = (searchText) => {
- reload({ title: searchText });
+ reload({ keywords: searchText });
};
/* 删除单个 */
const remove = (row: TowerModel) => {
- if (row.children?.length) {
- message.error('请先删除子节点');
- return;
- }
const hide = messageLoading('请求中..', 0);
- removeTowerModel(row.categoryId)
+ removeTowerModel(row.modelId)
.then((msg) => {
hide();
message.success(msg);
@@ -245,39 +163,18 @@
});
};
- /* 展开全部 */
- const expandAll = () => {
- let keys: number[] = [];
- eachTreeData(categoryData.value, (d) => {
- if (d.children && d.children.length && d.categoryId) {
- keys.push(d.categoryId);
+ /* 自定义行属性 */
+ const customRow = (record: TowerModel) => {
+ return {
+ // 行点击事件
+ onClick: () => {
+ // console.log(record);
+ },
+ // 行双击事件
+ onDblclick: () => {
+ openEdit(record);
}
- });
- expandedRowKeys.value = keys;
- };
-
- /* 折叠全部 */
- const foldAll = () => {
- expandedRowKeys.value = [];
- };
-
- /* 点击展开图标时触发 */
- const onExpand = (expanded: boolean, record: TowerModel) => {
- if (expanded) {
- expandedRowKeys.value = [
- ...expandedRowKeys.value,
- record.categoryId as number
- ];
- } else {
- expandedRowKeys.value = expandedRowKeys.value.filter(
- (d) => d !== record.categoryId
- );
- }
- };
-
- /* 判断是否是目录 */
- const isDirectory = (d: TowerModel) => {
- return !!d.children?.length;
+ };
};
diff --git a/src/views/tower/service/components/company-edit.vue b/src/views/tower/service/components/company-edit.vue
new file mode 100644
index 0000000..6cfd464
--- /dev/null
+++ b/src/views/tower/service/components/company-edit.vue
@@ -0,0 +1,348 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/tower/service/components/company-info.vue b/src/views/tower/service/components/company-info.vue
new file mode 100644
index 0000000..49702f5
--- /dev/null
+++ b/src/views/tower/service/components/company-info.vue
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/tower/service/index.vue b/src/views/tower/service/index.vue
index 161096e..6c3b37e 100644
--- a/src/views/tower/service/index.vue
+++ b/src/views/tower/service/index.vue
@@ -4,7 +4,7 @@
-
+
@@ -36,16 +36,17 @@
{{
- record.customerName
+ record.companyName
}}
-
-
- {{
- d.value
- }}
-
+
+
+ {{ d }}
+
正常
@@ -57,6 +58,10 @@
+
+ 是
+ 否
+
{{ timeAgo(record.createTime) }}
@@ -79,11 +84,11 @@
-
+
-
+
-
+
@@ -102,30 +107,27 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import { toDateString } from 'ele-admin-pro';
import Search from './components/search.vue';
- import CustomerEdit from './components/customer-edit.vue';
- import CustomerInfo from './components/customer-info.vue';
+ import CompanyEdit from './components/company-edit.vue';
+ import CompanyInfo from './components/company-info.vue';
import {
- pageCustomer,
- removeCustomer,
- removeBatchCustomer
- } from '@/api/oa/customer';
+ pageCompany,
+ removeCompany,
+ removeBatchCompany
+ } from '@/api/system/company';
import { timeAgo } from 'ele-admin-pro';
- import type { Customer, CustomerParam } from '@/api/oa/customer/model';
+ import type { Company, CompanyParam } from '@/api/system/company/model';
import { useUserStore } from '@/store/modules/user';
import { FILE_THUMBNAIL } from '@/config/setting';
const userStore = useUserStore();
- // 当前用户信息
- const loginUser = computed(() => userStore.info ?? {});
- const customerType = localStorage.getItem('customerType');
// 表格实例
const tableRef = ref | null>(null);
// 表格选中数据
- const selection = ref([]);
+ const selection = ref([]);
// 当前编辑数据
- const current = ref(null);
+ const current = ref(null);
// 是否显示资产详情
const showInfo = ref(false);
@@ -144,11 +146,11 @@
}) => {
if (filters) {
where.progress = filters.progress;
- where.customerSource = filters.customerSource;
- where.customerType = filters.customerType;
+ where.companySource = filters.companySource;
+ where.companyType = filters.companyType;
where.status = filters.status;
}
- return pageCustomer({
+ return pageCompany({
...where,
...orders,
page,
@@ -168,25 +170,26 @@
},
{
title: '企业名称',
- dataIndex: 'customerName',
- key: 'customerName'
+ dataIndex: 'companyName',
+ key: 'companyName'
},
{
title: '企业类型',
- dataIndex: 'customerType',
- key: 'customerType'
+ dataIndex: 'companyTypeMultiple',
+ key: 'companyTypeMultiple'
},
{
title: '企业负责人',
- dataIndex: 'customerContacts'
+ dataIndex: 'businessEntity'
},
{
title: '联系电话',
- dataIndex: 'customerPhone'
+ dataIndex: 'phone'
},
{
title: '是否含税',
- dataIndex: 'customerMobile'
+ dataIndex: 'isTax',
+ key: 'isTax'
},
{
title: '操作',
@@ -198,14 +201,14 @@
]);
/* 搜索 */
- const reload = (where?: CustomerParam) => {
+ const reload = (where?: CompanyParam) => {
console.log(where);
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
- const openEdit = (row?: Customer) => {
+ const openEdit = (row?: Company) => {
current.value = row ?? null;
showEdit.value = true;
};
@@ -216,15 +219,15 @@
};
/* 打开用户详情弹窗 */
- const openInfo = (row?: Customer) => {
+ const openInfo = (row?: Company) => {
current.value = row ?? null;
showInfo.value = true;
};
/* 删除单个 */
- const remove = (row: Customer) => {
+ const remove = (row: Company) => {
const hide = message.loading('请求中..', 0);
- removeCustomer(row.customerId)
+ removeCompany(row.companyId)
.then((msg) => {
hide();
message.success(msg);
@@ -255,13 +258,7 @@
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
- removeBatchCustomer(
- selection.value.map((d) => {
- if (loginUser.value.userId === d.userId) {
- return d.customerId;
- }
- })
- )
+ removeBatchCompany(selection.value.map((d) => d.companyId))
.then((msg) => {
hide();
message.success(msg);
@@ -276,7 +273,7 @@
};
/* 自定义行属性 */
- const customRow = (record: Customer) => {
+ const customRow = (record: Company) => {
return {
// 行点击事件
onClick: () => {