From d626d72d43560f685ded50c6955a9ba82c33f2d7 Mon Sep 17 00:00:00 2001 From: re-JZzzz Date: Wed, 24 Sep 2025 20:06:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E7=89=A9=E6=96=99?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=A8=A1=E5=9D=97=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 新增采购计划草稿存储功能 2. 优化出入库单和备件管理界面 3. 完善表单验证和交互逻辑 4. 调整表格列对齐方式 5. 移除冗余的审批备注字段 ps:出入口页面未完成 --- src/api/renyuan/paiban/index.ts | 12 +- src/store/modules/procurementDraft.ts | 80 ++ .../components/detailInfo.vue | 23 - .../inventoryManagement.vue | 202 ++++- .../materialManagement/procurementPlan.vue | 694 ++++++++++++++---- src/views/materialManagement/spareParts.vue | 330 +++++++-- 6 files changed, 1084 insertions(+), 257 deletions(-) create mode 100644 src/store/modules/procurementDraft.ts diff --git a/src/api/renyuan/paiban/index.ts b/src/api/renyuan/paiban/index.ts index f279452..baccd17 100644 --- a/src/api/renyuan/paiban/index.ts +++ b/src/api/renyuan/paiban/index.ts @@ -61,12 +61,12 @@ export function updatePaiban(data:any): AxiosPromise { /** * 运维-人员排班-批量修改排班 */ -export function updateAllPaiban(): AxiosPromise { - return request({ - url: `/ops/personnel/scheduling/all`, - method: 'put', - }); -} +// export function updateAllPaiban(): AxiosPromise { +// return request({ +// url: `/ops/personnel/scheduling/all`, +// method: 'put', +// }); +// } /** * 运维-人员排班-删除排班 diff --git a/src/store/modules/procurementDraft.ts b/src/store/modules/procurementDraft.ts new file mode 100644 index 0000000..3b042d2 --- /dev/null +++ b/src/store/modules/procurementDraft.ts @@ -0,0 +1,80 @@ +import { defineStore } from 'pinia'; +import { ref } from 'vue'; +import $cache from '@/plugins/cache'; + +// 草稿数据类型 +export interface ProcurementDraft { + id: string; + draftNumber: string; + planName: string; + saveTime: string; + content: any; +} + +// 保存草稿到本地存储 +const saveDraftsToStorage = (drafts: ProcurementDraft[]) => { + $cache.local.setJSON('procurementDrafts', drafts); +}; + +// 从本地存储获取草稿 +const getDraftsFromStorage = (): ProcurementDraft[] => { + const stored = $cache.local.getJSON('procurementDrafts'); + return stored && Array.isArray(stored) ? stored : []; +}; + +export const useProcurementDraftStore = defineStore('procurementDraft', () => { + const draftList = ref(getDraftsFromStorage()); + + // 保存草稿 + const saveDraft = (planName: string, content: any): ProcurementDraft => { + const today = new Date(); + const dateStr = today.getFullYear() + '-' + + String(today.getMonth() + 1).padStart(2, '0') + '-' + + String(today.getDate()).padStart(2, '0'); + const randomNum = Math.floor(100 + Math.random() * 900); + const draftNumber = `DRAFT-${dateStr}-${randomNum}`; + + const newDraft: ProcurementDraft = { + id: `draft_${Date.now()}_${randomNum}`, + draftNumber, + planName, + saveTime: new Date().toLocaleString(), + content: JSON.parse(JSON.stringify(content)) // 深拷贝内容 + }; + + // 添加到草稿列表并保存到本地存储 + draftList.value.unshift(newDraft); + saveDraftsToStorage(draftList.value); + + return newDraft; + }; + + // 获取草稿列表 + const getDraftList = (): ProcurementDraft[] => { + return draftList.value; + }; + + // 获取单个草稿 + const getDraft = (draftId: string): ProcurementDraft | undefined => { + return draftList.value.find(draft => draft.id === draftId); + }; + + // 删除草稿 + const deleteDraft = (draftId: string): boolean => { + const index = draftList.value.findIndex(draft => draft.id === draftId); + if (index !== -1) { + draftList.value.splice(index, 1); + saveDraftsToStorage(draftList.value); + return true; + } + return false; + }; + + return { + draftList, + saveDraft, + getDraftList, + getDraft, + deleteDraft + }; +}); \ No newline at end of file diff --git a/src/views/materialManagement/components/detailInfo.vue b/src/views/materialManagement/components/detailInfo.vue index 0c23bdd..f404af7 100644 --- a/src/views/materialManagement/components/detailInfo.vue +++ b/src/views/materialManagement/components/detailInfo.vue @@ -67,15 +67,6 @@ - - - - - - - - @@ -92,11 +83,6 @@ - - - - @@ -121,15 +107,6 @@ - - - - - - - - diff --git a/src/views/materialManagement/inventoryManagement.vue b/src/views/materialManagement/inventoryManagement.vue index 04aeec7..ff796e8 100644 --- a/src/views/materialManagement/inventoryManagement.vue +++ b/src/views/materialManagement/inventoryManagement.vue @@ -15,7 +15,6 @@
- - - - - - + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 单据编号: + {{ currentRow.formNumber }} +
+
+ 设备类型: + {{ currentRow.equipmentType }} +
+
+ 操作时间: + {{ currentRow.operationTime }} +
+
+ 总数量: + {{ currentRow.totalQuantity }} +
+
+ 经手人: + {{ currentRow.handler }} +
+
+ 状态: + {{ currentRow.status }} +
+
+ +
- \ No newline at end of file diff --git a/src/views/materialManagement/spareParts.vue b/src/views/materialManagement/spareParts.vue index c81a6af..bd78daf 100644 --- a/src/views/materialManagement/spareParts.vue +++ b/src/views/materialManagement/spareParts.vue @@ -157,20 +157,18 @@
- - - - - - - + + + + + + + - + - \ No newline at end of file