From 0c4bdf3dca76f9b8c348f2f7e48f9a6319dee4e1 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 17 四月 2026 17:09:22 +0800
Subject: [PATCH] 进销存升级 1.销售台账不能删除和编辑别人维护的数据 2.产品维护固定产品大类为:成品、半成品、原材料。

---
 src/views/equipmentManagement/spareParts/index.vue |   83 ++++++++++++++++++++---------------------
 1 files changed, 40 insertions(+), 43 deletions(-)

diff --git a/src/views/equipmentManagement/spareParts/index.vue b/src/views/equipmentManagement/spareParts/index.vue
index 823071f..45e0157 100644
--- a/src/views/equipmentManagement/spareParts/index.vue
+++ b/src/views/equipmentManagement/spareParts/index.vue
@@ -21,20 +21,21 @@
             <el-button type="primary" @click="addCategory">鏂板</el-button>
           </div>
         </div>
-
-        <PIMTable
-          rowKey="id"
-          :column="columns"
-          :tableData="renderTableData"
-          :tableLoading="loading"
-          :page="pagination"
-          :isShowPagination="true"
-          @pagination="handleSizeChange"
-        >
-          <template #status="{ row }">
-            <el-tag type="success" size="small">{{ row.status }}</el-tag>
-          </template>
-        </PIMTable>
+				<div class="table_list">
+					<PIMTable
+						rowKey="id"
+						:column="columns"
+						:tableData="renderTableData"
+						:tableLoading="loading"
+						:page="pagination"
+						:isShowPagination="true"
+						@pagination="handleSizeChange"
+					>
+						<template #status="{ row }">
+							<el-tag type="success" size="small">{{ row.status }}</el-tag>
+						</template>
+					</PIMTable>
+				</div>
 
         <el-dialog title="鍒嗙被绠$悊" v-model="dialogVisible" width="60%">
           <el-form :model="form" :rules="rules" ref="formRef" label-width="100px">
@@ -98,12 +99,12 @@
         <div class="search_form">
           <el-form :inline="true" :model="usageQuery" class="search-form">
             <el-form-item label="澶囦欢鍚嶇О">
-              <el-input v-model="usageQuery.sparePartName" placeholder="璇疯緭鍏ュ浠跺悕绉�" clearable style="width: 240px" />
+              <el-input v-model="usageQuery.sparePartsName" placeholder="璇疯緭鍏ュ浠跺悕绉�" clearable style="width: 240px" />
             </el-form-item>
             <el-form-item label="鏉ユ簮">
-              <el-select v-model="usageQuery.source" placeholder="璇烽�夋嫨" clearable style="width: 200px">
-                <el-option label="缁翠慨" value="repair" />
-                <el-option label="淇濆吇" value="upkeep" />
+              <el-select v-model="usageQuery.sourceType" placeholder="璇烽�夋嫨" clearable style="width: 200px">
+                <el-option label="缁翠慨" :value="0" />
+                <el-option label="淇濆吇" :value="1" />
               </el-select>
             </el-form-item>
             <el-form-item>
@@ -112,16 +113,17 @@
             </el-form-item>
           </el-form>
         </div>
-
-        <PIMTable
-          rowKey="rowKey"
-          :column="usageColumns"
-          :tableData="usageTableData"
-          :tableLoading="usageLoading"
-          :page="usagePagination"
-          :isShowPagination="true"
-          @pagination="handleUsagePageChange"
-        />
+				<div class="table_list">
+					<PIMTable
+						rowKey="rowKey"
+						:column="usageColumns"
+						:tableData="usageTableData"
+						:tableLoading="usageLoading"
+						:page="usagePagination"
+						:isShowPagination="true"
+						@pagination="handleUsagePageChange"
+					/>
+				</div>
       </el-tab-pane>
     </el-tabs>
   </div>
@@ -167,8 +169,8 @@
 // 澶囦欢棰嗙敤璁板綍
 const usageLoading = ref(false);
 const usageQuery = reactive({
-  sparePartName: "",
-  source: "",
+  sparePartsName: "",
+  sourceType: "",
 });
 const usagePagination = reactive({
   current: 1,
@@ -180,10 +182,10 @@
   { label: "鏉ユ簮", prop: "sourceText" },
   { label: "鍗曟嵁/璁板綍ID", prop: "sourceId" },
   { label: "璁惧鍚嶇О", prop: "deviceName" },
-  { label: "澶囦欢鍚嶇О", prop: "sparePartName" },
-  { label: "棰嗙敤鏁伴噺", prop: "qty" },
+  { label: "澶囦欢鍚嶇О", prop: "sparePartsName" },
+  { label: "棰嗙敤鏁伴噺", prop: "quantity" },
   { label: "鎿嶄綔浜�", prop: "operator" },
-  { label: "鏃堕棿", prop: "time" },
+  { label: "鏃堕棿", prop: "createTime" },
 ]);
 
 const handleTabChange = async (name) => {
@@ -340,8 +342,8 @@
     const res = await getSparePartsUsagePage({
       current: usagePagination.current,
       size: usagePagination.size,
-      sparePartName: usageQuery.sparePartName || undefined,
-      source: usageQuery.source || undefined,
+      sparePartsName: usageQuery.sparePartsName || undefined,
+      sourceType: usageQuery.sourceType || undefined,
     });
     if (res?.code === 200) {
       const records = res?.data?.records || [];
@@ -349,11 +351,7 @@
       usageTableData.value = records.map((r, idx) => ({
         rowKey: r.id ?? `${usagePagination.current}-${idx}`,
         ...r,
-        sourceText:
-          r.source === "缁翠慨" ? "缁翠慨" :
-          r.source === "淇濆吇" ? "淇濆吇" :
-          r.source === "manual" ? "鎵嬪伐" :
-          (r.source || "-"),
+        sourceText: r.sourceText === "" ? "-" : r.sourceText,
       }));
     } else {
       usagePagination.total = 0;
@@ -369,8 +367,8 @@
   fetchUsageData();
 };
 const resetUsageQuery = () => {
-  usageQuery.sparePartName = "";
-  usageQuery.source = "";
+  usageQuery.sparePartsName = "";
+  usageQuery.sourceType = "";
   usagePagination.current = 1;
   fetchUsageData();
 };
@@ -542,7 +540,6 @@
   margin-top: 20px;
   display: flex;
   justify-content: flex-end;
-  padding: 16px 0;
 }
 
 .el-table__header-wrapper th {

--
Gitblit v1.9.3