-
+
-
-
+
+
+
+
+
+
+
@@ -26,6 +31,7 @@
+
+
+
@@ -91,10 +107,41 @@ const relatedLinks = [
]
const tableData = ref(genRawStorageData(28))
+const activeTab = ref('storage')
const searchText = ref('')
const statusFilter = ref('')
const modalVisible = ref(false)
+// 毛菜台账(按品种汇总)
+const ledgerData = computed(() => {
+ const map = new Map
()
+ tableData.value.forEach(r => {
+ const qty = parseFloat(r.quantity)
+ if (!map.has(r.material)) {
+ map.set(r.material, { material: r.material, currentStock: 0, totalIn: 0, totalOut: 0, lastIn: '' })
+ }
+ const item = map.get(r.material)!
+ item.totalIn += qty
+ if (r.status === 'stored' || r.status === 'pending') item.currentStock += qty
+ if (r.status === 'processing') item.totalOut += qty
+ if (!item.lastIn || r.receiveDate > item.lastIn) item.lastIn = r.receiveDate
+ })
+ return Array.from(map.values()).map(d => ({
+ ...d,
+ currentStock: d.currentStock.toFixed(0) + 'kg',
+ totalIn: d.totalIn.toFixed(0) + 'kg',
+ totalOut: d.totalOut.toFixed(0) + 'kg',
+ }))
+})
+
+const ledgerColumns = [
+ { title: '品种', dataIndex: 'material', width: 120 },
+ { title: '当前库存', dataIndex: 'currentStock', width: 120 },
+ { title: '入库总量', dataIndex: 'totalIn', width: 120 },
+ { title: '出库总量', dataIndex: 'totalOut', width: 120 },
+ { title: '最近入库', dataIndex: 'lastIn', width: 120 },
+]
+
const materialOptions = ['白菜', '萝卜', '番茄', '黄瓜', '茄子', '青椒', '猪里脊', '鸡胸肉']
const supplierOptions = ['绿源农业', '丰禾食品', '天然牧场', '鲜美水产', '有机之家']
diff --git a/zhican/admin/src/views/nutrition-dining/algorithm-standard/index.vue b/zhican/admin/src/views/nutrition-dining/algorithm-standard/index.vue
index bb2931a..00c7fbf 100644
--- a/zhican/admin/src/views/nutrition-dining/algorithm-standard/index.vue
+++ b/zhican/admin/src/views/nutrition-dining/algorithm-standard/index.vue
@@ -1,7 +1,16 @@
-
+
+
+
+
+
+
+
+
+
@@ -69,6 +78,47 @@
保存配置
重置
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ record.status }}
+
+
+ 编辑
+ 详情
+
+
+
+
+
+
+
+
+
+
+ {{ s }}
+
+
+ 编辑
+ 详情
+
+
+
+
+