diff --git a/src/api/tower/part/goods/index.ts b/src/api/tower/part/goods/index.ts new file mode 100644 index 0000000..f6502f0 --- /dev/null +++ b/src/api/tower/part/goods/index.ts @@ -0,0 +1,102 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { Goods, GoodsParam } from '@/api/tower/part/goods/model'; +/** + * 分页查询仓库 + */ +export async function pageGoods(params: GoodsParam) { + const res = await request.get>>( + '/tower/tower-part-goods/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询仓库列表 + */ +export async function listGoods(params?: GoodsParam) { + const res = await request.get>('/tower/tower-part-goods', { + params + }); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加仓库 + */ +export async function addGoods(data: Goods) { + const res = await request.post>( + '/tower/tower-part-goods', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改仓库 + */ +export async function updateGoods(data: Goods) { + const res = await request.put>( + '/tower/tower-part-goods', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 绑定仓库 + */ +export async function bindGoods(data: Goods) { + const res = await request.put>( + '/tower/tower-part-goods/bind', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除仓库 + */ +export async function removeGoods(id?: number) { + const res = await request.delete>( + '/tower/tower-part-goods/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除仓库 + */ +export async function removeBatchGoods(data: (number | undefined)[]) { + const res = await request.delete>( + '/tower/tower-part-goods/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/part/goods/model/index.ts b/src/api/tower/part/goods/model/index.ts new file mode 100644 index 0000000..62d96e1 --- /dev/null +++ b/src/api/tower/part/goods/model/index.ts @@ -0,0 +1,30 @@ +import type { PageParam } from '@/api'; + +export interface Goods { + goodsId?: number; + goodsName?: string; + goodsCode?: string; + category?: string; + specs?: string; + position?: string; + stock?: number; + stockMoney?: number; + price?: number; + salePrice?: number; + stockMin?: number; + stockLower?: boolean; + status?: number; + userId?: number; + comments?: string; + sortNumber?: number; +} + +/** + * 搜索条件 + */ +export interface GoodsParam extends PageParam { + goodsId?: number; + goodsCode?: string; + status?: number; + keywords?: string; +} diff --git a/src/api/tower/security-record/model/index.ts b/src/api/tower/security-record/model/index.ts index 6709db1..aff9fb0 100644 --- a/src/api/tower/security-record/model/index.ts +++ b/src/api/tower/security-record/model/index.ts @@ -23,6 +23,32 @@ export interface SecurityRecord { accessoryNo?: string; accessorySpecs?: string; accessoryModel?: string; + before1?: string; + before2?: string; + before3?: string; + before4?: string; + before5?: string; + before6?: string; + before7?: string; + before8?: string; + before9?: string; + before10?: string; + before11?: string; + before12?: string; + before13?: string; + after1?: string; + after2?: string; + after3?: string; + after4?: string; + after5?: string; + after6?: string; + after7?: string; + after8?: string; + after9?: string; + after10?: string; + after11?: string; + after12?: string; + after13?: string; } /** diff --git a/src/views/tower/accessory/index.vue b/src/views/tower/accessory/index.vue index a2a3350..6e53b70 100644 --- a/src/views/tower/accessory/index.vue +++ b/src/views/tower/accessory/index.vue @@ -190,10 +190,10 @@ hideInSetting: true, customRender: ({ index }) => index + (tableRef.value?.tableIndex ?? 0) }, - { - title: '配件编号', - dataIndex: 'accessoryNo' - }, + // { + // title: '配件编号', + // dataIndex: 'accessoryNo' + // }, { title: '生产厂家', dataIndex: 'accessoryName' diff --git a/src/views/tower/maintenance/security-record/components/security-record-edit.vue b/src/views/tower/maintenance/security-record/components/security-record-edit.vue index 668b2e4..43af096 100644 --- a/src/views/tower/maintenance/security-record/components/security-record-edit.vue +++ b/src/views/tower/maintenance/security-record/components/security-record-edit.vue @@ -1,7 +1,7 @@ 新建 - - - - - - - + + + + + ([ { - title: '配件编号', - dataIndex: 'accessoryNo', - key: 'accessoryNo' + title: '保养编号', + dataIndex: 'securityCode', + key: 'securityCode', + width: 200 }, { - title: '生产厂家', - dataIndex: 'accessoryName', - key: 'accessoryName' - }, - { - title: '配件分类', - dataIndex: 'accessoryCategory', - key: 'accessoryCategory' - }, - { - title: '适用设备型号', - dataIndex: 'accessoryModel', - key: 'accessoryModel' - }, - { - title: '配件规格', - dataIndex: 'accessorySpecs', - key: 'accessorySpecs' - }, - { - title: '保养内容', + title: '备注信息', dataIndex: 'comments', key: 'comments' }, @@ -143,7 +118,7 @@ width: 180 }, { - title: '保养人', + title: '操作人', dataIndex: 'userId', key: 'userId', width: 180 @@ -160,10 +135,8 @@ // 当前编辑数据 const current = ref(null); const searchText = ref(''); - const searchStatus = ref(''); // 是否显示编辑弹窗 const showEdit = ref(false); - const projectName = ref(''); // 日期范围选择 const dateRange = ref<[string, string]>(['', '']); diff --git a/src/views/tower/maintenance/security/components/security-edit.vue b/src/views/tower/maintenance/security/components/security-edit.vue index 55c2cc2..bab556e 100644 --- a/src/views/tower/maintenance/security/components/security-edit.vue +++ b/src/views/tower/maintenance/security/components/security-edit.vue @@ -29,12 +29,11 @@ @done="chooseProject" /> - - + + + 塔式起重机 + 施工电梯 + - - - - - diff --git a/src/views/tower/maintenance/security2/components/security-edit.vue b/src/views/tower/maintenance/security2/components/security-edit.vue index ca73a83..92357fa 100644 --- a/src/views/tower/maintenance/security2/components/security-edit.vue +++ b/src/views/tower/maintenance/security2/components/security-edit.vue @@ -29,7 +29,7 @@ @done="chooseProject" /> - + - + @@ -63,13 +63,6 @@ - - - @@ -140,35 +133,41 @@ type: 'string', trigger: 'blur', validator: async (_rule: RuleObject, value: string) => { - if (value == "") { + if (!value) { return Promise.reject("请输入项目名称"); } return Promise.resolve(); } } ], - model: [ + problem: [ { required: true, - message: '请输入设备型号', + message: '请输入问题描述', type: 'string', trigger: 'blur' } ], - yearLife: [ + processingMethod: [ { required: true, - message: '请输入设备使用年限', - type: 'number', + message: '请输入处理方法', + type: 'string', trigger: 'blur' } ], - sortNumber: [ + files: [ { required: true, - message: '请输入排序号', - type: 'number', - trigger: 'blur' + message: '请上传图片', + type: 'string', + trigger: 'blur', + validator: async (_rule: RuleObject, value: string) => { + if (files.value.length == 0) { + return Promise.reject("请上传图片"); + } + return Promise.resolve(); + } } ] }); diff --git a/src/views/tower/maintenance/security2/index.vue b/src/views/tower/maintenance/security2/index.vue index da82175..6e57794 100644 --- a/src/views/tower/maintenance/security2/index.vue +++ b/src/views/tower/maintenance/security2/index.vue @@ -21,7 +21,6 @@ 新建 - 正常 待修 异常已修 异常未修 @@ -58,7 +57,6 @@