From b12c9e77a6b6a7b410ac421c5a3d68da88823460 Mon Sep 17 00:00:00 2001
From: zhuguifei <312353457@qq.com>
Date: 星期五, 06 三月 2026 15:20:51 +0800
Subject: [PATCH] feat: 烟丝单柜产耗统计

---
 ruoyi-plus-soybean/src/views/analy/store-silk/index.vue |  120 ++++++++++++++++++++++++++----------------------------------
 1 files changed, 52 insertions(+), 68 deletions(-)

diff --git a/ruoyi-plus-soybean/src/views/analy/store-silk/index.vue b/ruoyi-plus-soybean/src/views/analy/store-silk/index.vue
index b772674..89f96b8 100644
--- a/ruoyi-plus-soybean/src/views/analy/store-silk/index.vue
+++ b/ruoyi-plus-soybean/src/views/analy/store-silk/index.vue
@@ -10,6 +10,7 @@
 import ButtonIcon from '@/components/custom/button-icon.vue';
 import StoreSilkOperateDrawer from './modules/store-silk-operate-drawer.vue';
 import StoreSilkSearch from './modules/store-silk-search.vue';
+import StoreSilkDetail from './modules/store-silk-detail.vue';
 
 defineOptions({
   name: 'StoreSilkList'
@@ -18,6 +19,9 @@
 const appStore = useAppStore();
 const { download } = useDownload();
 const { hasAuth } = useAuth();
+
+const selectedRollerDetailList = ref<any[]>([]);
+const selectedPackerDetailList = ref<any[]>([]);
 
 const searchParams = ref<Api.Analy.StoreSilkSearchParams>({
   pageNum: 1,
@@ -50,11 +54,6 @@
     },
     columns: () => [
       {
-        type: 'selection',
-        align: 'center',
-        width: 48
-      },
-      {
         key: 'index',
         title: $t('common.index'),
         align: 'center',
@@ -74,16 +73,26 @@
         minWidth: 130
       },
       {
-        key: 'roller',
-        title: '鍗锋帴浜ч噺',
+        key: 'rollerOutput',
+        title: '鍗锋帴浜ч噺(绠�)',
         align: 'center',
-        minWidth: 100
+        minWidth: 120,
+        render: row => {
+          const v = calcRollerBox((row as any).rollerOutput);
+          if (v === null) return '-';
+          return v.toFixed(1);
+        }
       },
       {
-        key: 'packer',
-        title: '鍖呰浜ч噺',
+        key: 'packerOutput',
+        title: '鍖呰浜ч噺(绠�)',
         align: 'center',
-        minWidth: 100
+        minWidth: 120,
+        render: row => {
+          const v = calcPackerBox((row as any).packerOutput);
+          if (v === null) return '-';
+          return v.toFixed(1);
+        }
       },
       {
         key: 'actualstarttime',
@@ -120,60 +129,6 @@
         title: '鏌滃瓙鍙�(鏈綅)',
         align: 'center',
         width: 160
-      },
-      {
-        key: 'operate',
-        title: $t('common.operate'),
-        align: 'center',
-        fixed: 'right',
-        width: 130,
-        render: row => {
-          const divider = () => {
-            if (!hasAuth('analy:storeSilk:edit') || !hasAuth('analy:storeSilk:remove')) {
-              return null;
-            }
-            return <NDivider vertical />;
-          };
-
-          const editBtn = () => {
-            if (!hasAuth('analy:storeSilk:edit')) {
-              return null;
-            }
-            return (
-              <ButtonIcon
-                text
-                type="primary"
-                icon="material-symbols:drive-file-rename-outline-outline"
-                tooltipContent={$t('common.edit')}
-                onClick={() => edit(row.id)}
-              />
-            );
-          };
-
-          const deleteBtn = () => {
-            if (!hasAuth('analy:storeSilk:remove')) {
-              return null;
-            }
-            return (
-              <ButtonIcon
-                text
-                type="error"
-                icon="material-symbols:delete-outline"
-                tooltipContent={$t('common.delete')}
-                popconfirmContent={$t('common.confirmDelete')}
-                onPositiveClick={() => handleDelete(row.id)}
-              />
-            );
-          };
-
-          return (
-            <div class="flex-center gap-8px">
-              {editBtn()}
-              {divider()}
-              {deleteBtn()}
-            </div>
-          );
-        }
       }
     ]
   });
@@ -202,6 +157,30 @@
 function handleExport() {
   download('/analy/storeSilk/export', searchParams.value, `鍌ㄤ笣鏌滀骇閲廮${new Date().getTime()}.xlsx`);
 }
+
+function calcRollerBox(val: unknown) {
+  if (val === null || val === undefined) return null;
+  const v = Number(val) / 50;
+  if (!Number.isFinite(v)) return null;
+  return v;
+}
+
+function calcPackerBox(val: unknown) {
+  if (val === null || val === undefined) return null;
+  const v = Number(val) / 10 / 250;
+  if (!Number.isFinite(v)) return null;
+  return v;
+}
+
+function handleRowClick(row: any) {
+  return {
+    onClick: () => {
+      selectedRollerDetailList.value = row.rollerDetailList || [];
+      selectedPackerDetailList.value = row.packerDetailList || [];
+    },
+    style: 'cursor: pointer;'
+  };
+}
 </script>
 
 <template>
@@ -213,8 +192,8 @@
           v-model:columns="columnChecks"
           :disabled-delete="checkedRowKeys.length === 0"
           :loading="loading"
-          :show-add="hasAuth('analy:storeSilk:add')"
-          :show-delete="hasAuth('analy:storeSilk:remove')"
+          :show-add="false"
+          :show-delete="false"
           :show-export="hasAuth('analy:storeSilk:export')"
           @add="handleAdd"
           @delete="handleBatchDelete"
@@ -243,7 +222,6 @@
         </TableHeaderOperation>
       </template>
       <NDataTable
-        v-model:checked-row-keys="checkedRowKeys"
         :columns="columns"
         :data="data"
         :size="tableSize"
@@ -253,6 +231,7 @@
         remote
         :row-key="row => row.id"
         :pagination="mobilePagination"
+        :row-props="handleRowClick"
         class="sm:h-full"
       />
       <StoreSilkOperateDrawer
@@ -262,6 +241,11 @@
         @submitted="getDataByPage"
       />
     </NCard>
+    <StoreSilkDetail
+      :roller-detail-list="selectedRollerDetailList"
+      :packer-detail-list="selectedPackerDetailList"
+      class="h-[192px] overflow-hidden"
+    />
   </div>
 </template>
 

--
Gitblit v1.9.3