Explorar el Código

Merge branch 'V2.0_CF.APP' of http://192.168.0.104:18899/zhangwy/ChickenFarm into V2.0_CF.APP

Yue hace 3 semanas
padre
commit
b0c4adefa4
Se han modificado 28 ficheros con 2306 adiciones y 1090 borrados
  1. 5 2
      .gitignore
  2. 27 62
      SERVER/ChickenFarmV3/.script/sql/20251128/init.sql
  3. 5 4
      SERVER/ChickenFarmV3/.script/sql/20251215/init.sql
  4. 4 4
      SERVER/ChickenFarmV3/vb-admin/src/main/resources/application-dev.yml
  5. 6 0
      SERVER/ChickenFarmV3/vb-modules/vb-app/src/main/java/cn/vber/app/controller/AppBreedingController.java
  6. 2 0
      SERVER/ChickenFarmV3/vb-modules/vb-app/src/main/java/cn/vber/app/service/IGeneralService.java
  7. 26 1
      SERVER/ChickenFarmV3/vb-modules/vb-app/src/main/java/cn/vber/app/service/impl/GeneralServiceImpl.java
  8. 1 1
      SERVER/ChickenFarmV3/vb-modules/vb-breeding/src/main/java/cn/vber/breeding/controller/BatchDayStatisticsController.java
  9. 10 6
      SERVER/ChickenFarmV3/vb-modules/vb-breeding/src/main/java/cn/vber/breeding/service/impl/CageChangeServiceImpl.java
  10. 1 1
      SERVER/ChickenFarmV3/vb-modules/vb-breeding/src/main/java/cn/vber/breeding/service/impl/ChickenServiceImpl.java
  11. 87 15
      SERVER/ChickenFarmV3/vb-modules/vb-breeding/src/main/java/cn/vber/breeding/service/impl/CoopBatchDayStatisticsServiceImpl.java
  12. 26 20
      SERVER/ChickenFarmV3/vb-modules/vb-breeding/src/main/java/cn/vber/breeding/service/impl/FamilyServiceImpl.java
  13. 4 1
      SERVER/ChickenFarmV3/vb-modules/vb-erp/src/main/java/cn/vber/erp/service/impl/CustomerServiceImpl.java
  14. 1 1
      UI/VB.VUE/src/views/base/chickenCage/index.vue
  15. 3 3
      UI/VB.VUE/src/views/base/drugSop/index.vue
  16. 2 2
      UI/VB.VUE/src/views/base/feedSop/index.vue
  17. 2 2
      UI/VB.VUE/src/views/base/vaccineSop/index.vue
  18. 2 2
      UI/VB.VUE/src/views/breeding/batch/index.vue
  19. 2 2
      UI/VB.VUE/src/views/breeding/cageChange/index.vue
  20. 1 1
      UI/VB.VUE/src/views/breeding/chicken/index.vue
  21. 1 1
      UI/VB.VUE/src/views/common/modal/chickenModal.vue
  22. 1 1
      UI/VB.VUE/src/views/eggLaying/eggCurrentStore/index.vue
  23. 13 1
      UI/VB.VUE/src/views/eggLaying/family/index.vue
  24. 504 0
      UI/VB.VUE/src/views/report/batchDay/index copy 2.vue
  25. 0 588
      UI/VB.VUE/src/views/report/batchDay/index copy.vue
  26. 650 177
      UI/VB.VUE/src/views/report/batchDay/index.vue
  27. 535 0
      UI/VB.VUE/src/views/report/coopBatchDay/index copy 2.vue
  28. 385 192
      UI/VB.VUE/src/views/report/coopBatchDay/index.vue

+ 5 - 2
.gitignore

@@ -72,6 +72,9 @@ UI/VAP_V3.VUE/pnpm-lock.yaml
 
 .data/
 
-docs/部署文档/*.rar
+docs/部署文档/*.rar
 /SERVER/ChickenFarmV3/vber/server
-UI/VB.VUE/pnpm-lock.yaml
+UI/VB.VUE/pnpm-lock.yaml
+
+## 硬件调式工具
+/tools/

+ 27 - 62
SERVER/ChickenFarmV3/.script/sql/20251128/init.sql

@@ -2745,54 +2745,7 @@ CREATE TABLE `xxl_job_user`  (
 ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
 
 
--- ----------------------------
--- Procedure structure for generate_wing_tags_batched
--- ----------------------------
-DROP PROCEDURE IF EXISTS `generate_wing_tags_batched`;
-delimiter ;;
-CREATE PROCEDURE `generate_wing_tags_batched`()
-BEGIN
-    DECLARE batch_start INT DEFAULT 21;
-    DECLARE batch_end INT DEFAULT 999999;
-    DECLARE tag_id VARCHAR(20);
-    DECLARE i INT;
-
-    WHILE batch_start <= 999999 DO
-            SET i = batch_start;
-
-            WHILE i <= batch_end AND i <= 999999 DO
-                    SET tag_id = LPAD(i, 6, '0');
-
-                    INSERT INTO f_wing_tag VALUES (
-                                                      tag_id,
-                                                      NULL,
-                                                      0,
-                                                      100,
-                                                      1,
-                                                      NOW(),
-                                                      1,
-                                                      NOW(),
-                                                      NULL,
-                                                      '0'
-                                                  );
-
-                    SET i = i + 1;
-                END WHILE;
 
-            -- 输出进度
-            SELECT CONCAT('Inserted records from ', batch_start, ' to ', LEAST(batch_end, 999999)) as progress;
-
-            SET batch_start = batch_end + 1;
-            SET batch_end = batch_end + 100000;
-
-            COMMIT;
-        END WHILE;
-
-END
-;;
-delimiter ;
-
--- SET FOREIGN_KEY_CHECKS = 1;
 
 /*
  基础 数据信息
@@ -2825,6 +2778,8 @@ INSERT INTO `sys_config` VALUES (12, '000000', '可入孵出库的蛋类型', 'b
 INSERT INTO `sys_config` VALUES (13, '000000', '仓库管理人员Ids', 'erp:Store:userIds', '1005,1006,1007', 'Y', 100, 1, '2025-10-15 12:00:00', 1, '2025-11-28 11:12:37', '维修人员ID');
 INSERT INTO `sys_config` VALUES (14, '000000', '实验审核人员USER_ID', 'sys.experiment.review.userIds', '1010', 'Y', 100, 1, '2025-10-15 12:00:00', 1, '2025-11-28 11:13:20', '实验审核人员ID');
 INSERT INTO `sys_config` VALUES (15, '000000', '销售组织结构ID', 'erp:sale:org:id', '104,211', 'Y', 100, 1, '2025-10-28 16:36:05', 1, '2025-11-28 11:13:45', NULL);
+INSERT INTO `sys_config` VALUES (16, '000000', '死亡淘汰类型value', 'breeding:batch:cullReason:death', '5', 'Y', 100, 1, '2025-10-28 16:36:05', 1, '2025-11-28 11:13:45', NULL);
+INSERT INTO `sys_config` VALUES (17, '000000', '打包淘汰类型value', 'breeding:batch:cullReason:packageCull', '6', 'Y', 100, 1, '2025-10-28 16:36:05', 1, '2025-11-28 11:13:45', NULL);
 
 -- ----------------------------
 -- Records of sys_dict_data
@@ -2906,16 +2861,18 @@ INSERT INTO `sys_dict_data` VALUES (141, '000000', 2, '腹水', '2', 'chicken_cu
 INSERT INTO `sys_dict_data` VALUES (142, '000000', 3, '细菌感染', '3', 'chicken_cull_reason', NULL, 'primary', 'N', 100, 1, '2025-07-17 18:57:15', 1, '2025-07-17 18:57:15', NULL);
 INSERT INTO `sys_dict_data` VALUES (143, '000000', 4, '外伤', '4', 'chicken_cull_reason', NULL, 'primary', 'N', 100, 1, '2025-07-17 18:57:39', 1, '2025-07-17 18:57:39', NULL);
 INSERT INTO `sys_dict_data` VALUES (172, '000000', 9, '转群', '5', 'chicken_cull_reason', NULL, 'primary', 'N', 100, 1, '2025-07-17 18:57:39', 1, '2025-07-17 18:57:39', NULL);
+INSERT INTO `sys_dict_data` VALUES (180, '000000', 5, '死亡', '6', 'chicken_cull_reason', NULL, 'primary', 'N', 100, 1, '2025-07-17 18:57:39', 1, '2025-07-17 18:57:39', NULL);
+INSERT INTO `sys_dict_data` VALUES (181, '000000', 6, '打包淘汰', '7', 'chicken_cull_reason', NULL, 'primary', 'N', 100, 1, '2025-07-17 18:57:39', 1, '2025-07-17 18:57:39', NULL);
 INSERT INTO `sys_dict_data` VALUES (144, '000000', 1, '无害化', '0', 'chicken_disposal_method', NULL, 'primary', 'Y', 100, 1, '2025-07-17 18:58:01', 1, '2025-07-17 18:58:01', NULL);
 INSERT INTO `sys_dict_data` VALUES (145, '000000', 2, '食堂', '1', 'chicken_disposal_method', NULL, 'primary', 'N', 100, 1, '2025-07-17 18:58:19', 1, '2025-07-17 18:58:19', NULL);
 INSERT INTO `sys_dict_data` VALUES (146, '000000', 3, '屠宰场', '2', 'chicken_disposal_method', NULL, 'primary', 'N', 100, 1, '2025-07-17 18:58:31', 1, '2025-07-17 18:58:31', NULL);
 INSERT INTO `sys_dict_data` VALUES (171, '000000', 9, '转群', '3', 'chicken_disposal_method', NULL, 'primary', 'N', 100, 1, '2025-07-17 18:58:31', 1, '2025-07-17 18:58:31', NULL);
 INSERT INTO `sys_dict_data` VALUES (147, '000000', 1, '正常', '0', 'family_status', NULL, 'primary', 'Y', 100, 1, '2025-07-18 10:26:25', 1, '2025-07-24 11:00:55', NULL);
 INSERT INTO `sys_dict_data` VALUES (148, '000000', 2, '异常', '1', 'family_status', NULL, 'info', 'N', 100, 1, '2025-07-18 10:26:48', 1, '2025-07-24 11:07:07', NULL);
-#INSERT INTO `sys_dict_data` VALUES (150, '000000', 1, '好种蛋', '0', 'breeding_egg_type', NULL, 'primary', 'Y', 100, 1, '2025-07-21 09:53:31', 1, '2025-07-21 09:53:31', NULL);
-#INSERT INTO `sys_dict_data` VALUES (151, '000000', 2, '好菜蛋', '1', 'breeding_egg_type', NULL, 'primary', 'N', 100, 1, '2025-07-21 09:53:44', 1, '2025-07-21 09:54:30', NULL);
-#INSERT INTO `sys_dict_data` VALUES (152, '000000', 3, '畸形蛋', '2', 'breeding_egg_type', NULL, 'info', 'N', 100, 1, '2025-07-21 09:54:03', 1, '2025-07-31 13:16:00', NULL);
-#INSERT INTO `sys_dict_data` VALUES (153, '000000', 4, '破蛋', '3', 'breeding_egg_type', NULL, 'warning', 'N', 100, 1, '2025-07-21 09:54:21', 1, '2025-07-31 13:16:09', NULL);
+--INSERT INTO `sys_dict_data` VALUES (150, '000000', 1, '好种蛋', '0', 'breeding_egg_type', NULL, 'primary', 'Y', 100, 1, '2025-07-21 09:53:31', 1, '2025-07-21 09:53:31', NULL);
+--INSERT INTO `sys_dict_data` VALUES (151, '000000', 2, '好菜蛋', '1', 'breeding_egg_type', NULL, 'primary', 'N', 100, 1, '2025-07-21 09:53:44', 1, '2025-07-21 09:54:30', NULL);
+--INSERT INTO `sys_dict_data` VALUES (152, '000000', 3, '畸形蛋', '2', 'breeding_egg_type', NULL, 'info', 'N', 100, 1, '2025-07-21 09:54:03', 1, '2025-07-31 13:16:00', NULL);
+--INSERT INTO `sys_dict_data` VALUES (153, '000000', 4, '破蛋', '3', 'breeding_egg_type', NULL, 'warning', 'N', 100, 1, '2025-07-21 09:54:21', 1, '2025-07-31 13:16:09', NULL);
 INSERT INTO `sys_dict_data` VALUES (154, '000000', 1, '待确认', '0', 'cage_change_status', NULL, 'primary', 'Y', 100, 1, '2025-07-28 13:53:25', 1, '2025-07-28 16:45:12', NULL);
 INSERT INTO `sys_dict_data` VALUES (155, '000000', 2, '审核通过', '1', 'cage_change_status', NULL, 'success', 'N', 100, 1, '2025-07-28 13:54:07', 1, '2025-07-28 13:54:07', NULL);
 INSERT INTO `sys_dict_data` VALUES (156, '000000', 3, '作废', '2', 'cage_change_status', NULL, 'info', 'N', 100, 1, '2025-07-28 13:54:31', 1, '2025-07-28 13:54:31', NULL);
@@ -3054,9 +3011,9 @@ INSERT INTO `sys_dict_type` VALUES (510, '000000', '种蛋类型', 'egg_type', 1
 INSERT INTO `sys_dict_data` VALUES (511, '000000', 1, '纯系种蛋', '1', 'egg_type', NULL, 'primary', 'Y', 100, 1, '2025-07-21 09:53:31', 1, '2025-07-21 09:53:31', NULL);
 INSERT INTO `sys_dict_data` VALUES (512, '000000', 2, '祖代蛋', '2', 'egg_type', NULL, 'primary', 'Y', 100, 1, '2025-07-21 09:53:31', 1, '2025-07-21 09:53:31', NULL);
 INSERT INTO `sys_dict_data` VALUES (513, '000000', 3, '父母代蛋', '3', 'egg_type', NULL, 'primary', 'Y', 100, 1, '2025-07-21 09:53:31', 1, '2025-07-21 09:53:31', NULL);
-INSERT INTO `sys_dict_data` VALUES (514, '000000', 3, '菜蛋', '3', 'egg_type', NULL, 'primary', 'Y', 100, 1, '2025-07-21 09:53:31', 1, '2025-07-21 09:53:31', NULL);
-INSERT INTO `sys_dict_data` VALUES (515, '000000', 3, '畸形蛋', '3', 'egg_type', NULL, 'primary', 'Y', 100, 1, '2025-07-21 09:53:31', 1, '2025-07-21 09:53:31', NULL);
-INSERT INTO `sys_dict_data` VALUES (516, '000000', 3, '破蛋', '3', 'egg_type', NULL, 'primary', 'Y', 100, 1, '2025-07-21 09:53:31', 1, '2025-07-21 09:53:31', NULL);
+INSERT INTO `sys_dict_data` VALUES (514, '000000', 4, '菜蛋', '4', 'egg_type', NULL, 'primary', 'Y', 100, 1, '2025-07-21 09:53:31', 1, '2025-07-21 09:53:31', NULL);
+INSERT INTO `sys_dict_data` VALUES (515, '000000', 5, '畸形蛋', '5', 'egg_type', NULL, 'primary', 'Y', 100, 1, '2025-07-21 09:53:31', 1, '2025-07-21 09:53:31', NULL);
+INSERT INTO `sys_dict_data` VALUES (516, '000000', 6, '破蛋', '6', 'egg_type', NULL, 'primary', 'Y', 100, 1, '2025-07-21 09:53:31', 1, '2025-07-21 09:53:31', NULL);
 
 INSERT INTO `sys_dict_type` VALUES (520, '000000', '供应商等级', 'supplier_level', 100, 1, '2025-07-21 09:53:04', 1, '2025-07-21 09:53:04', '供应商等级分类(1:一级, 2:二级, 3:三级)');
 INSERT INTO `sys_dict_data` VALUES (521, '000000', 1, '一级', '1', 'supplier_level', NULL, 'warning', 'Y', 100, 1, '2025-07-21 09:53:31', 1, '2025-07-21 09:53:31', NULL);
@@ -3283,10 +3240,13 @@ INSERT INTO `sys_menu` VALUES (232, '育种场蛋入库', 12, 0, 'breedingEggInY
 INSERT INTO `sys_menu` VALUES (233, '育种场蛋出库', 12, 1, 'breedingEggOutYz', 'eggLaying/breedingEggOut/yzEggOut', '', 1, 0, 'C', '0', '0', 'breeding:breedingEggOut', '#', NULL, NULL, 100, 1, '2025-07-30 13:17:45', 1, '2025-08-11 15:22:07', '');
 INSERT INTO `sys_menu` VALUES (234, '入孵管理', 12, 4, 'incubation', 'breeding/incubation/index', '', 1, 0, 'C', '0', '0', 'breeding:incubation', '#', NULL, NULL, 100, 1, '2025-07-21 10:08:18', NULL, '2025-07-21 10:08:18', '');
 
-INSERT INTO `sys_menu` VALUES (241, '育成舍报表', 13, 1, 'coop', 'report/coop/index', NULL, 1, 0, 'C', '0', '0', 'breeding:coopBatchReport', '#', NULL, NULL, 100, 1, '2025-08-20 19:40:17', 1, '2025-08-20 19:40:17', '');
-INSERT INTO `sys_menu` VALUES (242, '产蛋舍报表', 13, 2, 'egg', 'report/egg/index', NULL, 1, 0, 'C', '0', '0', 'breeding:coopBatchReport', '#', NULL, NULL, 100, 1, '2025-08-20 19:40:17', 1, '2025-08-20 19:40:17', '');
-INSERT INTO `sys_menu` VALUES (243, '育雏舍报表', 13, 3, 'brood', 'report/brood/index', NULL, 1, 0, 'C', '0', '0', 'breeding:coopBatchReport', '#', NULL, NULL, 100, 1, '2025-08-20 19:40:17', 1, '2025-08-20 19:40:17', '');
-INSERT INTO `sys_menu` VALUES (244, '测定舍报表', 13, 4, 'measure', 'report/measure/index', NULL, 1, 0, 'C', '0', '0', 'breeding:coopBatchReport', '#', NULL, NULL, 100, 1, '2025-08-20 19:40:17', 1, '2025-08-20 19:40:17', '');
+INSERT INTO `sys_menu` VALUES (241, '育成舍报表', 13, 1, 'coop', 'report/coop/index', NULL, 1, 0, 'C', '1', '0', 'breeding:coopBatchReport', '#', NULL, NULL, 100, 1, '2025-08-20 19:40:17', 1, '2025-08-20 19:40:17', '');
+INSERT INTO `sys_menu` VALUES (242, '产蛋舍报表', 13, 2, 'egg', 'report/egg/index', NULL, 1, 0, 'C', '1', '0', 'breeding:coopBatchReport', '#', NULL, NULL, 100, 1, '2025-08-20 19:40:17', 1, '2025-08-20 19:40:17', '');
+INSERT INTO `sys_menu` VALUES (243, '育雏舍报表', 13, 3, 'brood', 'report/brood/index', NULL, 1, 0, 'C', '1', '0', 'breeding:coopBatchReport', '#', NULL, NULL, 100, 1, '2025-08-20 19:40:17', 1, '2025-08-20 19:40:17', '');
+INSERT INTO `sys_menu` VALUES (244, '测定舍报表', 13, 4, 'measure', 'report/measure/index', NULL, 1, 0, 'C', '1', '0', 'breeding:coopBatchReport', '#', NULL, NULL, 100, 1, '2025-08-20 19:40:17', 1, '2025-08-20 19:40:17', '');
+INSERT INTO `sys_menu` VALUES (245, '批次日报表', 13, 5, 'batchDay', 'report/batchDay/index', NULL, 1, 0, 'C', '0', '0', 'breeding:coopBatchReport', '#', NULL, NULL, 100, 1, '2025-08-20 19:40:17', 1, '2025-08-20 19:40:17', '');
+INSERT INTO `sys_menu` VALUES (246, '鸡舍批次日报表', 13, 6, 'coopBatchDay', 'report/coopBatchDay/index', NULL, 1, 0, 'C', '0', '0', 'breeding:coopBatchReport', '#', NULL, NULL, 100, 1, '2025-08-20 19:40:17', 1, '2025-08-20 19:40:17', '');
+
 
 INSERT INTO `sys_menu` VALUES (251, '饲喂SOP', 15, 10, 'feedSop', 'base/feedSop/index', '', 1, 0, 'C', '0', '0', 'base:feedSop', '#', NULL, NULL, 100, 1, '2025-07-15 10:21:08', NULL, '2025-07-15 10:21:08', '');
 INSERT INTO `sys_menu` VALUES (252, '免疫使用SOP', 15, 9, 'vaccineSop', 'base/vaccineSop/index', '', 1, 0, 'C', '0', '0', 'base:vaccineSop', '#', NULL, NULL, 100, 1, '2025-07-16 09:40:53', NULL, '2025-07-16 09:40:53', '');
@@ -3388,10 +3348,10 @@ INSERT INTO `sys_menu` VALUES (1637, '批次疫苗SOP管理', 221, 7, '#', NULL,
 
 
 
-INSERT INTO `sys_menu` VALUES (1641, '查询换舍管理', 222, 0, '#', NULL, '', 1, 0, 'F', '0', '0', 'breeding:cageChange:query', 'eye', '', '', 100, 1, '2025-07-21 09:42:09', NULL, '2025-07-21 09:42:09', '');
-INSERT INTO `sys_menu` VALUES (1642, '新增换舍管理', 222, 0, '#', NULL, '', 1, 0, 'F', '0', '0', 'breeding:cageChange:add', 'plus-square', 'btn btn-light-primary', 'handleCreate', 100, 1, '2025-07-21 09:42:09', NULL, '2025-07-21 09:42:09', '');
-INSERT INTO `sys_menu` VALUES (1643, '修改换舍管理', 222, 0, '#', NULL, '', 1, 0, 'F', '1', '0', 'breeding:cageChange:edit', 'pencil-square', 'btn btn-light-success', 'handleUpdate@1', 100, 1, '2025-07-21 09:42:09', NULL, '2025-07-21 09:42:09', '');
-INSERT INTO `sys_menu` VALUES (1644, '删除换舍管理', 222, 0, '#', NULL, '', 1, 0, 'F', '1', '0', 'breeding:cageChange:remove', 'dash-square', 'btn btn-light-danger', 'handleDelete@0', 100, 1, '2025-07-21 09:42:09', NULL, '2025-07-21 09:42:09', '');
+INSERT INTO `sys_menu` VALUES (1641, '查询换舍管理', 222, 0, '#', NULL, '', 1, 0, 'F', '0', '0', 'breeding:coopChange:query', 'eye', '', '', 100, 1, '2025-07-21 09:42:09', NULL, '2025-07-21 09:42:09', '');
+INSERT INTO `sys_menu` VALUES (1642, '新增换舍管理', 222, 0, '#', NULL, '', 1, 0, 'F', '0', '0', 'breeding:coopChange:add', 'plus-square', 'btn btn-light-primary', 'handleCreate', 100, 1, '2025-07-21 09:42:09', NULL, '2025-07-21 09:42:09', '');
+INSERT INTO `sys_menu` VALUES (1643, '修改换舍管理', 222, 0, '#', NULL, '', 1, 0, 'F', '1', '0', 'breeding:coopChange:edit', 'pencil-square', 'btn btn-light-success', 'handleUpdate@1', 100, 1, '2025-07-21 09:42:09', NULL, '2025-07-21 09:42:09', '');
+INSERT INTO `sys_menu` VALUES (1644, '删除换舍管理', 222, 0, '#', NULL, '', 1, 0, 'F', '1', '0', 'breeding:coopChange:remove', 'dash-square', 'btn btn-light-danger', 'handleDelete@0', 100, 1, '2025-07-21 09:42:09', NULL, '2025-07-21 09:42:09', '');
 
 
 INSERT INTO `sys_menu` VALUES (1651, '查询家系', 231, 0, '#', NULL, '', 1, 0, 'F', '0', '0', 'breeding:family:query', 'eye', '', '', 100, 1, '2025-07-20 14:43:59', NULL, '2025-07-20 14:43:59', '');
@@ -3758,6 +3718,11 @@ INSERT INTO `sys_menu` VALUES (2602, '结算库存', 622, 1, '#', NULL, '', 1, 0
 INSERT INTO `sys_menu` VALUES (623, '蛋库库存', 12, 0,'eggCurrentStore', 'eggLaying/eggCurrentStore/index', '', 9, 0, 'C', '0', '0', 'breeding:eggCurrentStore', '#', NULL, NULL, 100, 1, '2025-10-15 15:02:26', NULL, '2025-10-15 15:02:26', '');
 INSERT INTO `sys_menu` VALUES (2701, '查询实时库存', 623, 0, '#', NULL, '', 1, 0, 'F', '0', '0', 'breeding:eggCurrentStore:query', 'eye', '', '', 100, 1, '2025-10-15 15:02:26', NULL, '2025-10-15 15:02:26', '');
 
+INSERT INTO `sys_menu` VALUES (17, '移动端App', 0, 18, 'mobile', NULL, NULL, 1, 0, 'M', '1', '0', NULL, 'bootstrap-fill', NULL, NULL, 100, 1, '2025-07-14 15:02:36', 1, '2025-08-11 15:23:59', '');
+INSERT INTO `sys_menu` VALUES (631, '添加个体', 17, 0,'appAddChicken', '', '', 9, 0, 'F', '1', '0', 'app:breeding:addChicken', '#', NULL, NULL, 100, 1, '2025-10-15 15:02:26', NULL, '2025-10-15 15:02:26', '');
+INSERT INTO `sys_menu` VALUES (632, '添加个体', 17, 1,'appChangeCage', '', '', 9, 0, 'F', '1', '0', 'app:breeding:changeCage', '#', NULL, NULL, 100, 1, '2025-10-15 15:02:26', NULL, '2025-10-15 15:02:26', '');
+INSERT INTO `sys_menu` VALUES (633, '添加个体', 17, 2,'appCullChicken', '', '', 9, 0, 'F', '1', '0', 'app:breeding:cullChicken', '#', NULL, NULL, 100, 1, '2025-10-15 15:02:26', NULL, '2025-10-15 15:02:26', '');
+INSERT INTO `sys_menu` VALUES (634, '添加个体', 17, 3,'appChickenWeight', '', '', 9, 0, 'F', '1', '0', 'app:breeding:chickenWeight', '#', NULL, NULL, 100, 1, '2025-10-15 15:02:26', NULL, '2025-10-15 15:02:26', '');
 
 
 

+ 5 - 4
SERVER/ChickenFarmV3/.script/sql/20251215/init.sql

@@ -3376,9 +3376,9 @@ INSERT INTO `sys_menu` VALUES (201, '批次管理', 10, 1, 'batch', 'breeding/ba
 INSERT INTO `sys_menu` VALUES (202,'翅号管理表', 10, 2, 'wingTag', 'breeding/wingTag/index', '', 1, 0, 'C', '1', '0', 'breeding:wingTag', '#', NULL, NULL, 100, 1, '2025-07-16 17:02:35', NULL, '2025-07-16 17:02:35', '');
 INSERT INTO `sys_menu` VALUES (203, '个体维护', 10, 3, 'chicken', 'breeding/chicken/index', '', 1, 0, 'C', '1', '0', 'breeding:chicken', '#', NULL, NULL, 100, 1, '2025-07-17 19:04:01', NULL, '2025-07-17 19:04:01', '');
 INSERT INTO `sys_menu` VALUES (204, '换笼管理', 10, 4, 'cageChange', 'breeding/cageChange/index', '', 1, 0, 'C', '0', '0', 'breeding:cageChange', '#', NULL, NULL, 100, 1, '2025-07-21 09:42:09', NULL, '2025-07-21 09:42:09', '');
-INSERT INTO `sys_menu` VALUES (205, '育种喂养记录', 10, 5, 'feedRecord1', 'breeding/feedRecord/indexHasChicken', '', 1, 0, 'C', '0', '0', 'breeding:cageChange', '#', NULL, NULL, 100, 1, '2025-07-21 09:42:09', NULL, '2025-07-21 09:42:09', '');
-INSERT INTO `sys_menu` VALUES (206, '育种用药记录', 10, 6, 'drugRecord1', 'breeding/drugRecord/indexHasChicken', '', 1, 0, 'C', '0', '0', 'breeding:cageChange', '#', NULL, NULL, 100, 1, '2025-07-21 09:42:09', NULL, '2025-07-21 09:42:09', '');
-INSERT INTO `sys_menu` VALUES (207, '育种疫苗记录', 10, 7, 'vaccineRecord1', 'breeding/vaccineRecord/indexHasChicken', '', 1, 0, 'C', '0', '0', 'breeding:cageChange', '#', NULL, NULL, 100, 1, '2025-07-21 09:42:09', NULL, '2025-07-21 09:42:09', '');
+INSERT INTO `sys_menu` VALUES (205, '育种喂养记录', 10, 5, 'feedRecord1', 'breeding/feedRecord/indexHasChicken', '', 1, 0, 'C', '0', '0', 'breeding:feedRecord', '#', NULL, NULL, 100, 1, '2025-07-21 09:42:09', NULL, '2025-07-21 09:42:09', '');
+INSERT INTO `sys_menu` VALUES (206, '育种用药记录', 10, 6, 'drugRecord1', 'breeding/drugRecord/indexHasChicken', '', 1, 0, 'C', '0', '0', 'breeding:drugRecord', '#', NULL, NULL, 100, 1, '2025-07-21 09:42:09', NULL, '2025-07-21 09:42:09', '');
+INSERT INTO `sys_menu` VALUES (207, '育种疫苗记录', 10, 7, 'vaccineRecord1', 'breeding/vaccineRecord/indexHasChicken', '', 1, 0, 'C', '0', '0', 'breeding:vaccineRecord', '#', NULL, NULL, 100, 1, '2025-07-21 09:42:09', NULL, '2025-07-21 09:42:09', '');
 INSERT INTO `sys_menu` VALUES (212, '测定管理', 10, 12, 'measure', 'breeding/measure/index', '', 1, 0, 'C', '0', '0', 'breeding:measure', '#', NULL, NULL, 100, 1, '2025-08-12 09:44:38', NULL, '2025-08-12 09:44:38', '');
 INSERT INTO `sys_menu` VALUES (213, '测定记录详情', 10, 13, 'measureDetail', 'breeding/measureDetail/index', '', 1, 0, 'C', '1', '0', 'breeding:measureDetail', '#', NULL, NULL, 100, 1, '2025-08-12 09:44:41', NULL, '2025-08-12 09:44:41', '');
 
@@ -4216,6 +4216,7 @@ INSERT INTO `sys_role_menu` VALUES (1005, 353);
 INSERT INTO `sys_role_menu` VALUES (1005, 355);
 INSERT INTO `sys_role_menu` VALUES (1005, 368);
 INSERT INTO `sys_role_menu` VALUES (1005, 369);
+INSERT INTO `sys_role_menu` VALUES (1005, 2016);
 INSERT INTO `sys_role_menu` VALUES (1005, 2021);
 INSERT INTO `sys_role_menu` VALUES (1005, 2022);
 INSERT INTO `sys_role_menu` VALUES (1005, 2023);
@@ -4709,6 +4710,6 @@ INSERT INTO `f_variety` VALUES (4, '白羽鸡', 'C', 4, '母系', 0, 100, 1, '20
 INSERT INTO `f_variety` VALUES (6, '白羽鸡', 'D', 3, '母系', 0, 100, 1, '2025-08-21 12:56:01', 1, '2025-09-06 10:21:01', NULL, '0');
 INSERT INTO `f_variety` VALUES (9, '白羽鸡', 'A', 2, '父系', 0, 100, 1, '2025-08-21 13:06:39', 1, '2025-09-06 10:21:15', NULL, '0');
 
-
+INSERT INTO `f_family` (`id`, `family_num`, `male_chicken_id`, `male_batch_num`, `female_chicken_id`, `female_batch_num`, `breed_date`, `status`, `create_org`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`, `del_flag`) VALUES (1, '000-000', NULL, '-', NULL, '-', '2026-01-01', 0, 100, 1, '2026-01-01 09:10:21', 1, '2026-01-01 09:10:29', NULL, '0');
 
 SET FOREIGN_KEY_CHECKS = 1;

+ 4 - 4
SERVER/ChickenFarmV3/vb-admin/src/main/resources/application-dev.yml

@@ -24,12 +24,12 @@ spring:
           # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
           # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
           # url: jdbc:mysql://127.0.0.1:3326/ChickenFarmDB_DEV?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
-          url: jdbc:mysql://192.168.0.104:3316/ChickenFarmDB_DEV2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
-          #url: jdbc:mysql://192.168.0.81:3326/ChickenFarmDB_V2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
+          # url: jdbc:mysql://192.168.0.104:3316/ChickenFarmDB_DEV2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
+          url: jdbc:mysql://192.168.0.81:3326/ChickenFarmDB_V2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
           username: root
           # password: root
-          password: 123456
-          #password: rootcf
+          # password: 123456
+          password: rootcf
         #        # 从库数据源
         #        slave:
         #          lazy: true

+ 6 - 0
SERVER/ChickenFarmV3/vb-modules/vb-app/src/main/java/cn/vber/app/controller/AppBreedingController.java

@@ -2,6 +2,7 @@ package cn.vber.app.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.vber.breeding.domain.vo.BatchVo;
+import cn.vber.breeding.domain.vo.ChickenVo;
 import cn.vber.breeding.domain.vo.FamilyVo;
 import cn.vber.common.core.domain.R;
 import cn.vber.common.mybatis.core.page.PageQuery;
@@ -28,6 +29,11 @@ public class AppBreedingController extends BaseController {
 
     private final IGeneralService generalService;
     private final IBreedingService breedingService;
+    @GetMapping("/getChicken/{electronicId}")
+    public R<ChickenVo> getChickenDetail(@PathVariable String electronicId) {
+        ChickenVo chickenVo = generalService.getChickenDetailByElectronicId(electronicId);
+        return R.ok(chickenVo);
+    }
 
     /**
      * 查询批次信息列表

+ 2 - 0
SERVER/ChickenFarmV3/vb-modules/vb-app/src/main/java/cn/vber/app/service/IGeneralService.java

@@ -19,5 +19,7 @@ public interface IGeneralService {
     FamilyVo getFamilyById(Long id);
     //boolean validateElectronicIdsBindState(List<String> electricIds);
     List<ChickenVo> getChickenByElectronicIds(List<String> electronicIds);
+    ChickenVo getChickenDetailByElectronicId(String id);
+
 
 }

+ 26 - 1
SERVER/ChickenFarmV3/vb-modules/vb-app/src/main/java/cn/vber/app/service/impl/GeneralServiceImpl.java

@@ -12,6 +12,7 @@ import cn.vber.app.service.IGeneralService;
 import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
 
+import java.util.Comparator;
 import java.util.List;
 
 @Service
@@ -165,7 +166,31 @@ public class GeneralServiceImpl implements IGeneralService {
         return chickenMapper.selectVoList(lqw);
     }
 
-
+    /**
+     * 根据电子鸡编号查询鸡群详情 只能查询出一条记录,先查询正在育的鸡,
+     * 如果查不到,再过滤出最近一次淘汰的个体,
+     * 如果记录就说明rfID没有被使用过
+     * @param id 电子鸡编号
+     * @return
+     */
+    @Override
+    public ChickenVo getChickenDetailByElectronicId(String id) {
+        LambdaQueryWrapper<Chicken> lqw = new LambdaQueryWrapper<>();
+        lqw.eq(Chicken::getElectronicId, id);
+        List<ChickenVo> chickenVoList = chickenMapper.selectVoList(lqw);
+        if (!chickenVoList.isEmpty()){
+            ChickenVo chickenVo = chickenVoList.stream().filter(v -> v.getStatus()
+                    .equals(ChickenStatusEnum.BREEDING.getCode()))
+                    .findFirst().orElse(null);
+            if (chickenVo == null){
+                chickenVo = chickenVoList.stream().filter(v -> v.getStatus()
+                        .equals(ChickenStatusEnum.ELIMINATED.getCode()))
+                        .max(Comparator.comparing(ChickenVo::getCullTime)).orElse(null);
+            }
+            return chickenVo;
+        }
+        return null;
+    }
 
 
 }

+ 1 - 1
SERVER/ChickenFarmV3/vb-modules/vb-breeding/src/main/java/cn/vber/breeding/controller/BatchDayStatisticsController.java

@@ -116,7 +116,7 @@ public class BatchDayStatisticsController extends BaseController {
     @Log(title = "批次日报表", businessType = BusinessType.INSERT)
     @RepeatSubmit()
     @PostMapping("/statistics")
-    public R<Void> statistics( @RequestBody BatchDaySatInputBo bo) {
+    public R<Void> statistics(@RequestBody BatchDaySatInputBo bo) {
         Date date = DateUtils.parseDate(bo.getRecordDate());
         if (bo.getType() == 0) {
             batchDayStatisticsService.statisticsBatchDay0(date);

+ 10 - 6
SERVER/ChickenFarmV3/vb-modules/vb-breeding/src/main/java/cn/vber/breeding/service/impl/CageChangeServiceImpl.java

@@ -79,6 +79,7 @@ public class CageChangeServiceImpl implements ICageChangeService {
         lqw.between(StringUtils.isNotEmpty(params.get("beginBindTime")) && StringUtils.isNotEmpty(params.get("endBindTime")),
                 CageChange::getBindTime , params.get("beginBindTime"), params.get("endBindTime"));
         lqw.eq(bo.getStatus() != null , CageChange::getStatus, bo.getStatus());
+        lqw.orderByDesc(CageChange::getBindTime);
         return lqw;
     }
 
@@ -137,16 +138,19 @@ public class CageChangeServiceImpl implements ICageChangeService {
         entity.setSourceCageId(chicken.getCageId());
         //entity.setStatus(CageChangeStatusEnum.CREATED.getCode());
         entity.setStatus(CageChangeStatusEnum.AUDITED.getCode());
-        if(entity.getSourceCageId() == null){
-            //entity.setStatus(CageChangeStatusEnum.AUDITED.getCode());
-            //cageId如果为空,就更新个体笼号
-            chicken.setCageId(entity.getTargetCageId());
-            chickenMapper.updateById(chicken);
-        }
+//        if(entity.getSourceCageId() == null){
+//            //entity.setStatus(CageChangeStatusEnum.AUDITED.getCode());
+//            //cageId如果为空,就更新个体笼号
+//            chicken.setCageId(entity.getTargetCageId());
+//            chickenMapper.updateById(chicken);
+//        }
         if(chicken.getCageId().equals(entity.getTargetCageId())){
             entity.setStatus(CageChangeStatusEnum.CANCELLED.getCode());
         }
         entity.setCrossCoop(commonService.isCrossCoop(entity.getSourceCageId(), entity.getTargetCageId())?1:0);
+        //更新个体笼号
+        chicken.setCageId(entity.getTargetCageId());
+        chickenMapper.updateById(chicken);
     }
 
     /**

+ 1 - 1
SERVER/ChickenFarmV3/vb-modules/vb-breeding/src/main/java/cn/vber/breeding/service/impl/ChickenServiceImpl.java

@@ -152,7 +152,7 @@ public class ChickenServiceImpl implements IChickenService, ChickenService {
     private void validEntityBeforeSave(Chicken entity) {
         //TODO 做一些数据校验,如唯一约束
         var preEntity = baseMapper.selectById(entity.getId());
-        //如果不是未知性别的个体,并且修改了性别信息,则不能修改
+        //如果要修改性别信息,要判断 之前如果不是未知性别的个体,并且修改了性别信息,则不能修改
         if(preEntity != null && !ChickenGenderEnum.isUnknown(preEntity.getGender()) && !entity.getGender().equals(preEntity.getGender())){
             throw new ServiceException("只有未知性别的个体可以修改性别信息!");
         }

+ 87 - 15
SERVER/ChickenFarmV3/vb-modules/vb-breeding/src/main/java/cn/vber/breeding/service/impl/CoopBatchDayStatisticsServiceImpl.java

@@ -175,9 +175,67 @@ public class CoopBatchDayStatisticsServiceImpl implements ICoopBatchDayStatistic
            total.setEggCount5(total.getEggCount5() != null ? total.getEggCount5() + item.getEggCount5() : item.getEggCount5());
            total.setEggCount6(total.getEggCount6() != null ? total.getEggCount6() + item.getEggCount6() : item.getEggCount6());
            //todo 计算其他关于蛋的相关指标
+           total.setEggCount6(total.getEggCount6() != null ? total.getEggCount6() + item.getEggCount6() : item.getEggCount6());
+           total.setEggCount7(total.getEggCount7() != null ? total.getEggCount7() + item.getEggCount7() : item.getEggCount7());
+           total.setEggCount8(total.getEggCount8() != null ? total.getEggCount8() + item.getEggCount8() : item.getEggCount8());
+           total.setEggCount9(total.getEggCount9() != null ? total.getEggCount9() + item.getEggCount9() : item.getEggCount9());
+           total.setEggCount10(total.getEggCount10() != null ? total.getEggCount10() + item.getEggCount10() : item.getEggCount10());
         });
+        setEggStatistics(total);
+
         return  total;
     }
+    private void setEggStatistics(Object obj){
+        int eggCountAll = 0;
+        int chicken1Count = 0;
+        int deformedCount = 0;
+        int breakCount = 0;
+
+        String eggDeformedRate = "";
+        String eggBreakRate = "";
+        String eggQualifiedRate = "";
+        String eggProductionRate = "";
+        //母鸡数量
+        if (obj instanceof CoopBatchDayTotalStatisticVo total) {
+            eggCountAll = total.getTotalEggs() == null ? 0 : total.getTotalEggs();
+            chicken1Count = total.getChicken1Count() == null ? 0 : total.getChicken1Count();
+            deformedCount = total.getEggCount5() == null ? 0 : total.getEggCount5();
+            breakCount = total.getEggCount6() == null ? 0 : total.getEggCount6();
+
+            // 畸形蛋率(%)
+            eggDeformedRate = eggCountAll == 0 ? "0.00%" : String.format("%.2f%%", (deformedCount * 100.0) / eggCountAll);
+            // 破蛋率(%)
+            eggBreakRate = eggCountAll == 0 ? "0.00%" : String.format("%.2f%%", (breakCount * 100.0) / eggCountAll);
+            // 合格蛋率(%)
+            eggQualifiedRate = eggCountAll == 0 ? "0.00%" : String.format("%.2f%%", ((eggCountAll - deformedCount - breakCount) * 100.0) / eggCountAll);
+            // 产蛋率(%)
+            eggProductionRate = chicken1Count == 0 ? "0.00%" : String.format("%.2f%%", (eggCountAll * 100.0) / chicken1Count);
+
+            total.setEggDeformedRate(eggDeformedRate);
+            total.setEggBreakRate(eggBreakRate);
+            total.setEggQualifiedRate(eggQualifiedRate);
+            total.setEggProductionRate(eggProductionRate);
+        } else if (obj instanceof CoopBatchDayStatisticsVo vo) {
+            eggCountAll = vo.getTotalEggs() == null ? 0 : vo.getTotalEggs();
+            chicken1Count = vo.getChicken1Count() == null ? 0 : vo.getChicken1Count();
+            deformedCount = vo.getEggCount5() == null ? 0 : vo.getEggCount5();
+            breakCount = vo.getEggCount6() == null ? 0 : vo.getEggCount6();
+
+            // 畸形蛋率(%)
+            eggDeformedRate = eggCountAll == 0 ? "0.00%" : String.format("%.2f%%", (deformedCount * 100.0) / eggCountAll);
+            // 破蛋率(%)
+            eggBreakRate = eggCountAll == 0 ? "0.00%" : String.format("%.2f%%", (breakCount * 100.0) / eggCountAll);
+            // 合格蛋率(%)
+            eggQualifiedRate = eggCountAll == 0 ? "0.00%" : String.format("%.2f%%", ((eggCountAll - deformedCount - breakCount) * 100.0) / eggCountAll);
+            // 产蛋率(%)
+            eggProductionRate = chicken1Count == 0 ? "0.00%" : String.format("%.2f%%", (eggCountAll * 100.0) / chicken1Count);
+
+            vo.setEggDeformedRate(eggDeformedRate);
+            vo.setEggBreakRate(eggBreakRate);
+            vo.setEggQualifiedRate(eggQualifiedRate);
+            vo.setEggProductionRate(eggProductionRate);
+        }
+    }
 
     @Transactional(rollbackFor = Exception.class)
     @Override
@@ -406,9 +464,11 @@ public class CoopBatchDayStatisticsServiceImpl implements ICoopBatchDayStatistic
         for (CoopBatchDayEggInAmountVo batchDayEggInAmountVo : batchDayEggInAmounts) {
             String key = batchDayEggInAmountVo.getCoopId() + "@" + batchDayEggInAmountVo.getBatchNum() + "@" + dateStr;
             CoopBatchDayStatisticsVo vo = initMap.get(key);
+            int eggCountAll = 0;//每日总产单数
             if (vo != null) {
                 Integer eggType = batchDayEggInAmountVo.getEggType();
                 Integer eggCount = batchDayEggInAmountVo.getEggCount();
+                eggCountAll += eggCount==null?0:eggCount;
                 // 使用if-else语句替代switch,因为Java中case后面不能跟变量
                 if (EggTypeEnum.PUREBRED_EGG.getCode().equals(eggType)) {
                     vo.setEggCount1(eggCount);
@@ -429,22 +489,34 @@ public class CoopBatchDayStatisticsServiceImpl implements ICoopBatchDayStatistic
                 }
             }
             //todo 计算其他关于蛋的相关指标,如合格蛋率(%),畸形蛋率(%),破蛋率,产蛋率等
+            if (vo != null) {
+                setEggStatistics(vo);
+//                vo.setTotalEggs(eggCountAll);//设置总产蛋数
+//                //母鸡数量
+//                int chicken1Count = vo.getChicken1Count() == null  ? 0 : vo.getChicken1Count()  ;
+//                int deformedCount = vo.getEggCount5() == null ? 0 : vo.getEggCount5()  ;
+//                int breakCount = vo.getEggCount6() == null  ? 0 : vo.getEggCount6();
+//                vo.setEggDeformedRate(eggCountAll == 0 ? "" :  String.format("%.2f%%",(deformedCount*100.0/eggCountAll)));   // 畸形蛋率(%)
+//                vo.setEggBreakRate(eggCountAll == 0 ? "" :  String.format("%.2f%%",(breakCount*100.0/eggCountAll)));   // 破蛋率(%)
+//                vo.setEggQualifiedRate(eggCountAll == 0 ? "" :  String.format("%.2f%%",((eggCountAll-deformedCount-breakCount)*100.0/eggCountAll)));   // 合格蛋率(%)
+//                vo.setEggProductionRate(eggCountAll == 0 ? "" :  String.format("%.2f%%",(eggCountAll*100.0/chicken1Count)));   // 产蛋率(%)
+            }
         }
         // 计算总蛋数量
-        for (CoopBatchDayStatisticsVo vo : initMap.values()) {
-            vo.setTotalEggs(
-                    (vo.getEggCount0()==null?0:vo.getEggCount0())
-                    + (vo.getEggCount1()==null?0:vo.getEggCount1())
-                    + (vo.getEggCount2()==null?0:vo.getEggCount2())
-                    + (vo.getEggCount3()==null?0:vo.getEggCount3())
-                    + (vo.getEggCount4()==null?0:vo.getEggCount4())
-                    + (vo.getEggCount5()==null?0:vo.getEggCount5())
-                    + (vo.getEggCount6()==null?0:vo.getEggCount6())
-                    + (vo.getEggCount7()==null?0:vo.getEggCount7())
-                    + (vo.getEggCount8()==null?0:vo.getEggCount8())
-                    + (vo.getEggCount9()==null?0:vo.getEggCount9())
-                    + (vo.getEggCount10()==null?0:vo.getEggCount10())
-            );
-        }
+//        for (CoopBatchDayStatisticsVo vo : initMap.values()) {
+//            vo.setTotalEggs(
+//                    (vo.getEggCount0()==null?0:vo.getEggCount0())
+//                    + (vo.getEggCount1()==null?0:vo.getEggCount1())
+//                    + (vo.getEggCount2()==null?0:vo.getEggCount2())
+//                    + (vo.getEggCount3()==null?0:vo.getEggCount3())
+//                    + (vo.getEggCount4()==null?0:vo.getEggCount4())
+//                    + (vo.getEggCount5()==null?0:vo.getEggCount5())
+//                    + (vo.getEggCount6()==null?0:vo.getEggCount6())
+//                    + (vo.getEggCount7()==null?0:vo.getEggCount7())
+//                    + (vo.getEggCount8()==null?0:vo.getEggCount8())
+//                    + (vo.getEggCount9()==null?0:vo.getEggCount9())
+//                    + (vo.getEggCount10()==null?0:vo.getEggCount10())
+//            );
+//        }
     }
 }

+ 26 - 20
SERVER/ChickenFarmV3/vb-modules/vb-breeding/src/main/java/cn/vber/breeding/service/impl/FamilyServiceImpl.java

@@ -120,26 +120,32 @@ public class FamilyServiceImpl implements IFamilyService, FamilyService {
      */
     private void validEntityBeforeSave(Family entity) {
         //TODO 做一些数据校验,如唯一约束
-//        if ((entity.getFemaleChickenId() == null || entity.getFemaleChickenId() == 0) && (entity.getMaleChickenId() == null || entity.getMaleChickenId() == 0)) {
-//            throw new ServiceException("请选择公鸡个体和母鸡个体不能同时为空!");
-//        }
-//        Family f = null;
-//        if(entity.getId() == null || entity.getId() == 0){
-//            f = baseMapper.selectOne(new LambdaQueryWrapper<Family>().eq(Family::getFamilyNum, entity.getFamilyNum()));
-//        }else{
-//            f = baseMapper.selectOne(new LambdaQueryWrapper<Family>().eq(Family::getFamilyNum, entity.getFamilyNum())
-//                    .ne(Family::getId, entity.getId()));
-//        }
-//        if ((entity.getMaleChickenId() != null && entity.getMaleChickenId() > 0) && (entity.getFemaleChickenId() != null && entity.getFemaleChickenId() > 0)) {
-//            f = baseMapper.selectOne(new LambdaQueryWrapper<Family>().eq(Family::getFemaleChickenId, entity.getFemaleChickenId())
-//                    .eq(Family::getMaleChickenId, entity.getMaleChickenId()));
-//            if (f != null) {
-//                throw new ServiceException("公鸡与母鸡已存在家系"+f.getFamilyNum()+"!");
-//            }
-//        }
-//        if (f != null) {
-//            throw new ServiceException("家系号已存在,请使用其他家系号");
-//        }
+        if(entity.getFamilyNum() == null || entity.getFamilyNum().isEmpty()){
+            throw new ServiceException("家系号不能为空!");
+        }
+        if(entity.getFemaleBatchNum() == null || entity.getFemaleBatchNum().isEmpty()){
+            throw new ServiceException("母鸡批次号不能为空!");
+        }
+        if(entity.getMaleBatchNum() == null || entity.getMaleBatchNum().isEmpty()){
+            throw new ServiceException("公鸡批次号不能为空!");
+        }
+        if(entity.getFemaleChickenId() != null && entity.getMaleChickenId() != null && entity.getFemaleChickenId().equals(entity.getMaleChickenId())) {
+            throw new ServiceException("公鸡与母鸡不能为同一只鸡!");
+        }
+        if(entity.getId() == null || entity.getId() == 0){
+            Family f = baseMapper.selectList(new LambdaQueryWrapper<Family>()
+                            .and(s -> {
+                                        s.eq(Family::getFemaleBatchNum, entity.getFemaleBatchNum());
+                                        s.eq(Family::getMaleBatchNum, entity.getMaleBatchNum());
+                            })
+                    .or().eq(Family::getFamilyNum, entity.getFamilyNum()))
+                    .stream().findFirst().orElse(null);
+
+            if (f != null) {
+                throw new ServiceException("公鸡与母鸡已存在家系"+f.getFamilyNum()+"!或者家系号已被使用!");
+            }
+        }
+
     }
 
     /**

+ 4 - 1
SERVER/ChickenFarmV3/vb-modules/vb-erp/src/main/java/cn/vber/erp/service/impl/CustomerServiceImpl.java

@@ -1,5 +1,6 @@
 package cn.vber.erp.service.impl;
 
+import cn.hutool.core.util.StrUtil;
 import cn.vber.base.enums.CustomerSaleBindStatusEnum;
 import cn.vber.common.core.constant.CacheNames;
 import cn.vber.common.core.domain.dto.UserDTO;
@@ -67,7 +68,9 @@ public class CustomerServiceImpl implements ICustomerService, CustomerService {
         //默认只取出默认的部门
         String orgId = SpringUtils.getBean(ConfigService.class).getConfigValue("erp:sale:org:id");
         UserService userService = SpringUtils.getBean(UserService.class);
-        return userService.selectUsersByOrgIds(List.of(Long.parseLong(orgId)));
+        List<String> orgArr = StrUtil.split(orgId, ",");
+        List<Long> orgIds = orgArr.stream().map(Long::parseLong).toList();
+        return userService.selectUsersByOrgIds(orgIds);
     }
 
     /**

+ 1 - 1
UI/VB.VUE/src/views/base/chickenCage/index.vue

@@ -258,7 +258,7 @@ function handleQrCode(row) {
 	qrModalRef.value.show()
 }
 function handleDownloadQr(id: string) {
-	let myImg = document.querySelector("#" + id) as HTMLImageElement
+	let myImg = document.querySelector("#" + id+' img') as HTMLImageElement
 	let url = myImg?.src
 	let a = document.createElement("a")
 	a.href = url

+ 3 - 3
UI/VB.VUE/src/views/base/drugSop/index.vue

@@ -110,7 +110,7 @@ const opts = reactive({
 			props: {
 				dictType: "chicken_gender",
 				type: "radio",
-				valueIsNumber: 1
+				valueIsNumber: true
 			}
 		},
 		{
@@ -145,8 +145,8 @@ const opts = reactive({
 	emptyFormData: {
 		id: undefined,
 		sopName: undefined,
-		gender: undefined,
-		status: undefined,
+		gender: 2,
+		status: 0,
 		remark: undefined
 	}
 })

+ 2 - 2
UI/VB.VUE/src/views/base/feedSop/index.vue

@@ -154,8 +154,8 @@ const opts = reactive({
 	emptyFormData: {
 		id: undefined,
 		sopName: undefined,
-		gender: undefined,
-		status: undefined,
+		gender: 2,
+		status: 0,
 		remark: undefined
 	}
 })

+ 2 - 2
UI/VB.VUE/src/views/base/vaccineSop/index.vue

@@ -134,8 +134,8 @@ const opts = reactive({
 	emptyFormData: {
 		id: undefined,
 		sopName: undefined,
-		gender: undefined,
-		status: undefined,
+		gender: 2,
+		status: 0,
 		remark: undefined
 	}
 })

+ 2 - 2
UI/VB.VUE/src/views/breeding/batch/index.vue

@@ -710,7 +710,7 @@ function handleConvert(row: any) {
 		}
 	]
 	// 获取鸡舍选项数据
-	apis.breeding.commonApi.getCoopsByFactory("2").then((res) => {
+	apis.breeding.commonApi.getCoopsByFactory("1").then((res) => {
 		coopOptions.value = res.data
 		// 如果有鸡舍选项,设置默认选择第一个
 		if (res.data && res.data.length > 0) {
@@ -1054,7 +1054,7 @@ function handleFileSuccess() {
 		<DrugSopDetailModal ref="drugSopDetailModalRef" :drug-sop-id="showDrugSopId" />
 		<VaccineSopDetailModal ref="vaccineSopDetailModalRef" :vaccine-sop-id="showVaccineSopId" />
 
-			<ImportModal
+		<ImportModal
 			ref="importCullModalRef"
 			:options="upload"
 			@on-success="handleFileSuccess"

+ 2 - 2
UI/VB.VUE/src/views/breeding/cageChange/index.vue

@@ -182,11 +182,11 @@ const opts = reactive({
 		// },
 
 		{
-			field: "chickenWingTagNum",
+			field: "electronicId",
 			label: "个体",
 			class: "w-100",
 			required: true,
-			placeholder: "请输入号",
+			placeholder: "请输入电子编号",
 			//component: "slot"
 			disabled: true,
 			appendClickFunc: handleShowChickenModal

+ 1 - 1
UI/VB.VUE/src/views/breeding/chicken/index.vue

@@ -259,7 +259,7 @@ const opts = reactive({
 			field: "familyNum",
 			label: "家系号",
 			class: "w-100",
-			required: false,
+			required: true,
 			placeholder: "请输入家系号",
 			disabled: true,
 			component: "I",

+ 1 - 1
UI/VB.VUE/src/views/common/modal/chickenModal.vue

@@ -112,7 +112,7 @@ defineExpose({
 		<template #body>
 			<VbDataTable
 				ref="tableRef"
-				keyField="wingTagNum"
+				keyField="electronicId"
 				:columns="columns"
 				:tableBoxHeight="500"
 				:search-form-items="searchFormItems"

+ 1 - 1
UI/VB.VUE/src/views/eggLaying/eggCurrentStore/index.vue

@@ -174,7 +174,7 @@ function handleDelete(rows: any[]) {
 			:reset-search-form-fun="resetQuery"
 			:custom-search-fun="handleQuery">
 			<template #eggType="{ row }">
-				<DictTag type="breeding_egg_type" :value-is-number="1" :value="row.eggType"></DictTag>
+				<DictTag type="egg_type" :value-is-number="1" :value="row.eggType"></DictTag>
 			</template>
 		</VbDataTable>
 	</div>

+ 13 - 1
UI/VB.VUE/src/views/eggLaying/family/index.vue

@@ -278,7 +278,19 @@ function handleUpdate(row: any) {
 
 /** 删除按钮操作 */
 function handleDelete(rows: any[]) {
-	tableRef.value.defaultHandleFuns.handleDelete("", rows)
+	//tableRef.value.defaultHandleFuns.handleDelete("", rows)
+	message.confirm("确认释放选中的家系吗?", "提示", {
+		confirmButtonText: "确定",
+		cancelButtonText: "取消",
+		type: "warning"
+	}).then(() => {
+		//tableRef.value.defaultHandleFuns.handleDelete("", rows)
+		apis.breeding.familyApi.del(rows.map((item: any) => item.id)).then(() => {
+			handleQuery()
+		})
+	}).catch(() => {
+		// 取消删除
+	})
 }
 
 /** 提交按钮 */

+ 504 - 0
UI/VB.VUE/src/views/report/batchDay/index copy 2.vue

@@ -0,0 +1,504 @@
+<script setup lang="ts">
+import BatchModal from "@/views/common/modal/batchModal.vue"
+import dayjs from "dayjs"
+import apis from "@/api/breeding"  
+
+// 初始化默认日期范围为最近一个月
+const getDefaultDateRange = () => {
+    const endDate = dayjs()
+    const startDate = endDate.subtract(1, 'month')
+    return [startDate.format('YYYY-MM-DD'), endDate.format('YYYY-MM-DD')]
+}
+
+ 
+const formData = ref({
+	batchNum: "",
+	recordDate: "",
+    dateRange: getDefaultDateRange(),
+	params: {},
+	type: 0
+})
+
+// 批次选择模态框相关
+const batchModalRef = ref()
+const selectedBatch = ref("")
+
+// 打开批次选择模态框
+function openBatchModal() {
+    batchModalRef.value?.open()
+}
+
+// 批次选择确认回调
+function onBatchConfirm(batches: any[]) {
+    if (batches && batches.length > 0) {
+        selectedBatch.value = batches[0].batchNum
+        formData.value.batchNum = selectedBatch.value
+    }
+}
+
+// 育种场信息数据
+const batchInfo = ref({
+    batchNum: "",
+    chickenCount0: "",
+    chickenCount1: "",
+    chickenCount2: "",
+    factoryName: "",
+    coopNames: "",
+    lineage: "",
+    generation: "",
+    hatchDate: "",
+    source: "",
+})
+const reportDataItems=ref([])
+// 查询处理函数
+function handleSearch() {
+    console.log('执行查询操作,批次号:', formData.value.batchNum)
+    console.log('日期范围:', formData.value.dateRange)
+    formData.value.params = {
+        beginRecordDate: formData.value.dateRange[0],
+        endRecordDate: formData.value.dateRange[1]
+    }
+    if(!formData.value.batchNum) {
+        message.msgError("请选择批次")
+        return
+    }
+    apis.batchDayStatisticsApi.getBatchDetail(formData.value.batchNum).then((res: any) => {
+        console.log(res)
+        batchInfo.value = res.data
+    })  
+    apis.batchDayStatisticsApi.listQuery(formData.value).then((res: any) => {
+        console.log(res)
+        reportDataItems.value = res.data
+    })
+    // 这里可以添加实际的查询逻辑
+    // 例如调用API获取数据等
+}
+
+ 
+
+// 导出处理函数
+function handleExport() {
+    console.log('导出报表,批次号:', formData.value.batchNum)
+    if(!formData.value.batchNum) {
+        message.msgError("请选择批次")
+        return
+    }
+    
+   formData.value.params = {
+        beginRecordDate: formData.value.dateRange[0],
+        endRecordDate: formData.value.dateRange[1]
+    }
+    
+    apis.batchDayStatisticsApi.export(formData.value, formData.value.batchNum + "日报表.xlsx").then((res: any) => {
+        console.log(res)
+        message.msgSuccess("导出成功")
+    }).catch((error: any) => {
+        console.error("导出失败:", error)
+        message.msgError("导出失败")
+    })
+}
+
+function handleGenerateReport(type) {
+    if(!formData.value.batchNum) {
+        message.msgError("请选择批次")
+        return
+    }
+	formData.value.recordDate = formData.value.dateRange[1]
+	formData.value.type = type
+    apis.batchDayStatisticsApi.genReportFun(formData.value).then(() => {
+        message.msgSuccess("生成成功")
+    })
+}
+
+// 日期格式化函数
+const formatDate = (row, column, cellValue) => {
+  return dayjs(cellValue).format('YYYY/MM/DD')
+}
+
+ 
+
+// 单元格样式
+const cellStyle = ({ row, column, rowIndex, columnIndex }) => {
+  // 日期列居中对齐
+  if (columnIndex === 0) {  // 日期列
+    return { textAlign: 'center' }
+  }
+  // 数字列右对齐
+  if (columnIndex >= 3) {  // 从第4列开始右对齐
+    return { textAlign: 'right' }
+  }
+  return { textAlign: 'center' }
+}
+
+// 将函数暴露给模板使用
+defineExpose({
+  formatDate,
+  //headerCellStyle,
+  cellStyle
+})
+</script>
+<template>
+   <div class="app-container py-5">
+      <div
+			class="w-100 d-flex flex-column align-items-center mx-auto"
+			:style="{ maxWidth: 1500 + 'px' }">
+        <div class="header d-flex justify-content-center align-items-center mb-10">
+            <el-form :model="formData" label-width="auto" :inline="true" style="margin-left: 20px">
+               <el-form-item label="批次" prop="batchNum">
+                                    <el-input v-model="formData.batchNum" placeholder="请选择批次" readonly>
+                                        <template #append>
+                                            <el-button @click="openBatchModal">选择</el-button>
+                                        </template>
+                                    </el-input>
+               </el-form-item>
+               <el-form-item label="日期范围" prop="dateRange">
+                   <el-date-picker
+                       v-model="formData.dateRange"
+                       type="daterange"
+                       range-separator="至"
+                       start-placeholder="开始日期"
+                       end-placeholder="结束日期"
+                       value-format="YYYY-MM-DD"
+                       format="YYYY-MM-DD"
+                       style="width: 220px;">
+                   </el-date-picker>
+               </el-form-item>
+               <el-form-item>
+                   <el-button type="primary" @click="handleSearch">查询</el-button>
+                   <el-button type="warning" @click="handleExport">导出</el-button>
+				     <el-button type="success" @click="handleGenerateReport(0)">生成日报表0</el-button>
+					   <el-button type="success" @click="handleGenerateReport(1)">生成日报表1</el-button>
+               </el-form-item>           
+           </el-form>
+        </div>  
+        
+      </div>
+      
+      <!-- 批次选择模态框 -->
+    
+	 
+	 <!-- 育种场信息表格 -->
+	 <div class="farm-info-container">
+	    <table class="table table-bordered farm-info-table">
+	      <tbody>
+	        <tr>
+                <th rowspan="3">{{ batchInfo.factoryName }}<br>日报表</th>
+                <th>鸡场</th>
+                <th class="important-cell">弥勒{{ batchInfo.factoryName }}</th>
+                <th>批号</th>
+                <th  class="important-cell">{{ batchInfo.batchNum }}</th>
+                <th>5%产蛋周龄</th>
+                <th  class="important-cell"></th>
+                <th>育雏舍</th>
+                <th class="important-cell"></th>
+            </tr>
+             <tr>
+                <th>品种</th>
+                <th class="important-cell">{{ batchInfo.lineage }}系</th>
+                <th>栋号</th>
+                <th class="important-cell">{{ batchInfo.coopNames }}</th>
+                <th>母鸡进苗数</th>
+                <th class="important-cell">{{ batchInfo.chickenCount1 }}</th>
+                <th>育成舍</th>
+                <th class="important-cell"></th>
+            </tr>
+             <tr>
+                <th>来源</th>
+                <th class="important-cell">{{ batchInfo.source }}</th>
+                <th>进鸡日期</th>
+                <th class="important-cell">{{ dayjs(batchInfo.hatchDate).format("YYYY年MM月DD日") }}</th>
+                <th>公鸡进苗数</th>
+                <th class="important-cell">{{ batchInfo.chickenCount0 }}</th>
+                <th>产蛋舍</th>
+                <th class="important-cell"></th>
+            </tr>
+	      </tbody>
+	    </table>
+	 </div>
+	 
+	 <!-- 使用 Element Plus 的 el-table 替换原生表格 -->
+	 <div class="table-container">
+	   <el-table 
+	     :data="reportDataItems" 
+	     border 
+	     :style="{ width: '100%' }" 
+	     :height="600"
+	     :header-cell-style="{ backgroundColor: '#e6f0ff', color: '#2c5aa0', fontWeight: 600, textAlign: 'center', border: '1px solid #d0d7e0' } "
+	     :cell-style="{ border: '1px solid #d0d7e0', textAlign: 'center' }"
+	     highlight-current-row :native-scrollbar="true">
+	     <!-- 固定列:日期 -->
+	     <el-table-column prop="recordDate" label="日期" fixed width="100" :formatter="formatDate">
+	     </el-table-column>
+	     
+	     <!-- 周龄分组 -->
+	     <el-table-column label="周龄"  fixed  :colspan="3">
+	       <el-table-column prop="dayCount" label="天" width="60" ></el-table-column>
+	       <el-table-column prop="weekAge" label="生长周龄" width="80" ></el-table-column>
+	       <el-table-column prop="layingWeekAge" label="产蛋周龄" width="80" ></el-table-column>
+	     </el-table-column>
+	     
+	     <!-- 存栏鸡数分组 -->
+	     <el-table-column label="存栏鸡数" fixed :colspan="4">
+	       <el-table-column prop="chicken1Count" label="母鸡" width="80" ></el-table-column>
+	       <el-table-column prop="chicken0Count" label="公鸡" width="80" ></el-table-column>
+	       <el-table-column prop="chicken2Count" label="未知" width="80" ></el-table-column>
+	       <el-table-column prop="chickenCountTotal" label="合计" width="80" ></el-table-column>
+	     </el-table-column>
+	     
+	     <!-- 公母比例(%) - 固定列 -->
+	     <el-table-column prop="maleFemaleRatio" label="公母比例(%)" fixed width="80" ></el-table-column>
+	     
+	     <!-- 母鸡死淘分组 -->
+	     <el-table-column label="母鸡死淘" :colspan="7">
+	       <el-table-column label="母鸡死淘数量" :colspan="5">
+	         <el-table-column prop="death1" label="死亡" width="80"></el-table-column>
+	         <el-table-column prop="cull1" label="淘汰" width="80"></el-table-column>
+	         <el-table-column prop="packageCull1" label="打包淘汰" width="100"></el-table-column>
+	         <el-table-column prop="deathCullTotal1" label="合计" width="80"></el-table-column>
+	         <el-table-column prop="deathCullRate1" label="死淘率(%)" width="100"></el-table-column>
+	       </el-table-column>
+	       <el-table-column label="累计" :colspan="2">
+	         <el-table-column prop="accumCullTotal1" label="死淘" width="80"></el-table-column>
+	         <el-table-column prop="accumCullRate1" label="死淘率(%)" width="100"></el-table-column>
+	       </el-table-column>
+	     </el-table-column>
+	     
+	     <!-- 公鸡死淘分组 -->
+	     <el-table-column label="公鸡死淘" :colspan="7">
+	       <el-table-column label="公鸡死淘数量" :colspan="5">
+	         <el-table-column prop="death0" label="死亡" width="80"></el-table-column>
+	         <el-table-column prop="cull0" label="淘汰" width="80"></el-table-column>
+	         <el-table-column prop="packageCull0" label="打包淘汰" width="100"></el-table-column>
+	         <el-table-column prop="deathCullTotal0" label="合计" width="80"></el-table-column>
+	         <el-table-column prop="deathCullRate0" label="死淘率(%)" width="100"></el-table-column>
+	       </el-table-column>
+	       <el-table-column label="累计" :colspan="2">
+	         <el-table-column prop="accumCullTotal0" label="死淘" width="80"></el-table-column>
+	         <el-table-column prop="accumCullRate0" label="死淘率(%)" width="100"></el-table-column>
+	       </el-table-column>
+	     </el-table-column>
+	     
+	     <!-- 未知鸡死淘分组 -->
+	     <el-table-column label="未知鸡死淘" :colspan="7">
+	       <el-table-column label="未知死淘数量" :colspan="5">
+	         <el-table-column prop="death2" label="死亡" width="80"></el-table-column>
+	         <el-table-column prop="cull2" label="淘汰" width="80"></el-table-column>
+	         <el-table-column prop="packageCull2" label="打包淘汰" width="100"></el-table-column>
+	         <el-table-column prop="deathCullTotal2" label="合计" width="80"></el-table-column>
+	         <el-table-column prop="deathCullRate2" label="死淘率(%)" width="100"></el-table-column>
+	       </el-table-column>
+	       <el-table-column label="累计" :colspan="2">
+	         <el-table-column prop="accumCullTotal2" label="死淘" width="80"></el-table-column>
+	         <el-table-column prop="accumCullRate2" label="死淘率(%)" width="100"></el-table-column>
+	       </el-table-column>
+	     </el-table-column>
+	     
+	     <!-- 耗料分组 -->
+	     <el-table-column label="耗料" :colspan="17">
+	       <el-table-column label="耗料量(g)" :colspan="4">
+	         <el-table-column prop="poultDailyFeed1" label="母鸡" width="80"></el-table-column>
+	         <el-table-column prop="poultDailyFeed0" label="公鸡" width="80"></el-table-column>
+	         <el-table-column prop="poultDailyFeed2" label="未知" width="80"></el-table-column>
+	         <el-table-column label="合计" width="80">
+	           <template #default="scope">
+	             {{ (scope.row.poultDailyFeed0 || 0) + (scope.row.poultDailyFeed1 || 0) + (scope.row.poultDailyFeed2 || 0) }}
+	           </template>
+	         </el-table-column>
+	       </el-table-column>
+	       <el-table-column label="耗料量/只/日(g)" :colspan="3">
+	         <el-table-column prop="poultDailyFeedAvg1" label="母鸡" width="80"></el-table-column>
+	         <el-table-column prop="poultDailyFeedAvg0" label="公鸡" width="80"></el-table-column>
+	         <el-table-column prop="poultDailyFeedAvg2" label="未知" width="80"></el-table-column>
+	       </el-table-column>
+	       <el-table-column label="耗料量/只/日(g)" :colspan="3">
+	         <el-table-column prop="poultDailyFeedStandard1" label="母鸡" width="80"></el-table-column>
+	         <el-table-column prop="poultDailyFeedStandard0" label="公鸡" width="80"></el-table-column>
+	         <el-table-column prop="poultDailyFeedStandard2" label="未知" width="80"></el-table-column>
+	       </el-table-column>
+	       <el-table-column label="累计耗料量(g)" :colspan="4">
+	         <el-table-column prop="accumFeedAmount1" label="母鸡" width="80"></el-table-column>
+	         <el-table-column prop="accumFeedAmount0" label="公鸡" width="80"></el-table-column>
+	         <el-table-column prop="accumFeedAmount2" label="未知" width="80"></el-table-column>
+	         <el-table-column label="合计" width="80">
+	           <template #default="scope">
+	             {{ (scope.row.accumFeedAmount0 || 0) + (scope.row.accumFeedAmount1 || 0) + (scope.row.accumFeedAmount2 || 0) }}
+	           </template>
+	         </el-table-column>
+	       </el-table-column>
+	       <el-table-column prop="feed1" label="母鸡喂料种类" width="120"></el-table-column>
+	       <el-table-column prop="feed0" label="公鸡喂料种类" width="120"></el-table-column>
+	       <el-table-column prop="feed2" label="未知喂料种类" width="120"></el-table-column>
+	     </el-table-column>
+	     
+	     <!-- 日体重数据分组 -->
+	     <el-table-column label="日体重数据" :colspan="9">
+	       <el-table-column label="实际母鸡" :colspan="2">
+	         <el-table-column prop="weight1" label="体重" width="80"></el-table-column>
+	         <el-table-column prop="uniformity1" label="均匀度(%)" width="100"></el-table-column>
+	       </el-table-column>
+	       <el-table-column label="实际公鸡" :colspan="2">
+	         <el-table-column prop="weight0" label="体重" width="80"></el-table-column>
+	         <el-table-column prop="uniformity0" label="均匀度(%)" width="100"></el-table-column>
+	       </el-table-column>
+	       <el-table-column label="实际未知" :colspan="2">
+	         <el-table-column prop="weight2" label="体重" width="80"></el-table-column>
+	         <el-table-column prop="uniformity2" label="均匀度(%)" width="100"></el-table-column>
+	       </el-table-column>
+	       <el-table-column label="母系标准体重" :colspan="3">
+	         <el-table-column prop="standardWeight1" label="母鸡" width="80"></el-table-column>
+	         <el-table-column prop="standardWeight0" label="公鸡" width="80"></el-table-column>
+	         <el-table-column prop="standardWeight2" label="未知" width="80"></el-table-column>
+	       </el-table-column>
+	     </el-table-column>
+	     
+	     <!-- 产蛋情况分组 -->
+	     <el-table-column label="产蛋情况" :colspan="9">
+	       <el-table-column prop="totalEggs" label="总产蛋数" width="100"></el-table-column>
+	       <el-table-column prop="eggCount0" label="上缴种蛋" width="100"></el-table-column>
+	       <el-table-column label="商品蛋" :colspan="6">
+	         <el-table-column prop="eggCount1" label="纯系种蛋" width="100"></el-table-column>
+	         <el-table-column prop="eggCount2" label="祖代蛋" width="100"></el-table-column>
+	         <el-table-column prop="eggCount3" label="父母代蛋" width="100"></el-table-column>
+	         <el-table-column prop="eggCount4" label="菜蛋" width="100"></el-table-column>
+	         <el-table-column prop="eggCount5" label="畸形蛋" width="100"></el-table-column>
+	         <el-table-column prop="eggCount6" label="破蛋" width="100"></el-table-column>
+	       </el-table-column>
+	       <el-table-column prop="eggWeight" label="实际蛋重(g)" width="100"></el-table-column>
+	     </el-table-column>
+	   </el-table>
+	 </div>
+	</div>
+      <BatchModal ref="batchModalRef" :multiple="false" @confirm="onBatchConfirm" />
+</template>
+<style scoped>
+	.table-container {
+	  overflow-x: auto;
+	  scrollbar-width: thin;
+	  scrollbar-color: #a0cfff #f1f1f1;
+	  border-radius: 8px;
+	  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
+	  margin: 20px 0;
+	}
+	
+	
+	.table {
+	  min-width: 100%;
+	  border-collapse: separate;
+	  border-spacing: 0;
+	  width: 100%;
+	  border-radius: 8px;
+	  overflow: hidden;
+	  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
+	}
+	
+	.table th,
+	.table td {
+	  padding: 12px 15px;
+	  text-align: center;
+	  white-space: nowrap;
+	  border-right: 1px solid #d0d7e0;
+	  border-bottom: 1px solid #d0d7e0;
+	}
+	
+	.table th {
+	  background-color: #e6f0ff;
+	  color: #2c5aa0;
+	  font-weight: 600;
+	  text-transform: uppercase;
+	  letter-spacing: 0.5px;
+	  font-size: 13px;
+	  /* 垂直居中对齐 */
+	  vertical-align: middle;
+	}
+	
+	.table td {
+	  /* 垂直居中对齐 */
+	  vertical-align: middle;
+	}
+	
+	.table th:last-child,
+	.table td:last-child {
+	  border-right: none;
+	}
+	
+	/* 斑马纹样式 */
+	.table tbody tr:nth-child(even) {
+	  background-color: #fafcff;
+	}
+	
+	/* 悬停效果 */
+	.table tbody tr:hover {
+	  background-color: #f0f7ff;
+	  transition: background-color 0.2s ease;
+	}
+	
+	/* 表头第一行特殊样式 */
+	.table thead tr:first-child th {
+	  background-color: #d1e4ff;
+	}
+	
+	/* 数字列右对齐 */
+	.table td:nth-child(n+10) {
+	  text-align: right;
+	}
+	/* 育种场信息表格样式 */
+	.farm-info-container {
+	  margin: 10px auto;
+	  border-radius: 8px;
+	  overflow: hidden;
+	  max-width: 1200px;
+	  width: 100%;
+     
+	}
+	
+	.farm-info-table {
+	  width: 100%;
+	  border-collapse: separate;
+	  border-spacing: 0;
+	  background-color: #ffffff;
+	  font-size: 13px;
+      border:1px solid #d0d7e0;
+	}
+	
+	.farm-info-table td {
+	  padding: 6px 10px;
+	  text-align: center;
+	  border-right: 1px solid #d0d7e0;
+	  border-bottom: 1px solid #d0d7e0;
+	  vertical-align: middle;
+	}
+	
+	.farm-info-table td:last-child {
+	  border-right: none;
+	}
+	
+	.farm-info-table tr:last-child td {
+	  border-bottom: none;
+	}
+	
+	/* 合并单元格的背景色 */
+	.farm-info-table td[rowspan],
+	.farm-info-table td[colspan] {
+	  background-color: #fafdff;
+	  font-weight: 500;
+	}
+	
+	/* 数据单元格的样式 */
+	.farm-info-table td:not([rowspan]):not([colspan]) {
+	  background-color: #ffffff;
+	  text-align: center;
+	}
+	
+	/* 需要从后端获取数据的列样式(实际第3、5、7、9列) */
+	 
+	/* 第1行 */
+	.important-cell {
+	  background-color: #fffefe !important;
+	  font-weight: 600;
+	  color: #3d4144 !important;
+	  border-radius: 4px;
+	  padding: 4px 8px;
+	}
+</style>
+ 
+ 

+ 0 - 588
UI/VB.VUE/src/views/report/batchDay/index copy.vue

@@ -1,588 +0,0 @@
-<script setup lang="ts">
-import BatchModal from "@/views/common/modal/batchModal.vue"
-import dayjs from "dayjs"
-import apis from "@/api/breeding"  
-
-// 初始化默认日期范围为最近一个月
-const getDefaultDateRange = () => {
-    const endDate = dayjs()
-    const startDate = endDate.subtract(1, 'month')
-    return [startDate.format('YYYY-MM-DD'), endDate.format('YYYY-MM-DD')]
-}
-
- 
-const formData = ref({
-    batchNum: "",
-    dateRange: getDefaultDateRange(),
-    params: {}
-})
-
-// 批次选择模态框相关
-const batchModalRef = ref()
-const selectedBatch = ref("")
-
-// 打开批次选择模态框
-function openBatchModal() {
-    batchModalRef.value?.open()
-}
-
-// 批次选择确认回调
-function onBatchConfirm(batches: any[]) {
-    if (batches && batches.length > 0) {
-        selectedBatch.value = batches[0].batchNum
-        formData.value.batchNum = selectedBatch.value
-    }
-}
-
-// 育种场信息数据
-const batchInfo = ref({
-    batchNum: "",
-    chickenCount0: "",
-    chickenCount1: "",
-    chickenCount2: "",
-    factoryName: "",
-    coopNames: "",
-    lineage: "",
-    generation: "",
-    hatchDate: "",
-    source: "",
-})
-const reportDataItems=ref([])
-// 查询处理函数
-function handleSearch() {
-    console.log('执行查询操作,批次号:', formData.value.batchNum)
-    console.log('日期范围:', formData.value.dateRange)
-    formData.value.params = {
-        beginRecordDate: formData.value.dateRange[0],
-        endRecordDate: formData.value.dateRange[1]
-    }
-    if(!formData.value.batchNum) {
-        message.msgError("请选择批次")
-        return
-    }
-    apis.batchDayStatisticsApi.getBatchDetail(formData.value.batchNum).then((res: any) => {
-        console.log(res)
-        batchInfo.value = res.data
-    })  
-    apis.batchDayStatisticsApi.listQuery(formData.value).then((res: any) => {
-        console.log(res)
-        reportDataItems.value = res.data
-    })
-    // 这里可以添加实际的查询逻辑
-    // 例如调用API获取数据等
-}
-
-// 生成日报表处理函数
-function handleGenerateReport() {
-    console.log('生成日报表,批次号:', formData.value.batchNum)
-    console.log('日期范围:', formData.value.dateRange)
-    // 这里可以添加生成日报表的逻辑
-    // 例如调用API生成报表数据等
-}
-
-// 导出处理函数
-function handleExport() {
-    console.log('导出报表,批次号:', formData.value.batchNum)
-    // 这里可以添加导出报表的逻辑
-    // 例如调用API导出数据等
-}
-
-</script>
-<template>
-   <div class="app-container py-5">
-      <div
-			class="w-100 d-flex flex-column align-items-center mx-auto"
-			:style="{ maxWidth: 1500 + 'px' }">
-        <div class="header d-flex justify-content-center align-items-center mb-10">
-            <el-form :model="formData" label-width="auto" :inline="true" style="margin-left: 20px">
-               <el-form-item label="批次" prop="batchNum">
-                                    <el-input v-model="formData.batchNum" placeholder="请选择批次" readonly>
-                                        <template #append>
-                                            <el-button @click="openBatchModal">选择</el-button>
-                                        </template>
-                                    </el-input>
-               </el-form-item>
-               <el-form-item label="日期范围" prop="dateRange">
-                   <el-date-picker
-                       v-model="formData.dateRange"
-                       type="daterange"
-                       range-separator="至"
-                       start-placeholder="开始日期"
-                       end-placeholder="结束日期"
-                       value-format="YYYY-MM-DD"
-                       format="YYYY-MM-DD"
-                       style="width: 220px;">
-                   </el-date-picker>
-               </el-form-item>
-               <el-form-item>
-                   <el-button type="primary" @click="handleSearch">查询</el-button>
-                   <!-- <el-button type="success" @click="handleGenerateReport">生成日报表</el-button> -->
-                   <el-button type="warning" @click="handleExport">导出</el-button>
-               </el-form-item>           
-           </el-form>
-        </div>  
-        
-      </div>
-      
-      <!-- 批次选择模态框 -->
-    
-	 
-	 <!-- 育种场信息表格 -->
-	 <div class="farm-info-container">
-	    <table class="table table-bordered farm-info-table">
-	      <tbody>
-	        <tr>
-                <th rowspan="3">{{ batchInfo.factoryName }}<br>日报表</th>
-                <th>鸡场</th>
-                <th class="important-cell">弥勒{{ batchInfo.factoryName }}</th>
-                <th>批号</th>
-                <th  class="important-cell">{{ batchInfo.batchNum }}</th>
-                <th>5%产蛋周龄</th>
-                <th  class="important-cell"></th>
-                <th>育雏舍</th>
-                <th class="important-cell"></th>
-            </tr>
-             <tr>
-                <th>品种</th>
-                <th class="important-cell">{{ batchInfo.lineage }}系</th>
-                <th>栋号</th>
-                <th class="important-cell">{{ batchInfo.coopNames }}</th>
-                <th>母鸡进苗数</th>
-                <th class="important-cell">{{ batchInfo.chickenCount1 }}</th>
-                <th>育成舍</th>
-                <th class="important-cell"></th>
-            </tr>
-             <tr>
-                <th>来源</th>
-                <th class="important-cell">{{ batchInfo.source }}</th>
-                <th>进鸡日期</th>
-                <th class="important-cell">{{ dayjs(batchInfo.hatchDate).format("YYYY年MM月DD日") }}</th>
-                <th>公鸡进苗数</th>
-                <th class="important-cell">{{ batchInfo.chickenCount0 }}</th>
-                <th>产蛋舍</th>
-                <th class="important-cell"></th>
-            </tr>
-	      </tbody>
-	    </table>
-	 </div>
-	 
-	 <div class="table-container">
-		    <table class="table table-bordered">
-		      <thead>
-		        <tr>
-		          <th rowspan="3">日期</th>
-		          <th colspan="3">周龄</th>
-		          <th colspan="4">存栏鸡数</th>
-		          <th rowspan="3">公母比例(%)</th>
-		          <th colspan="7">母鸡死淘</th>
-		          <th colspan="7">公鸡死淘</th>
-		          <th colspan="7">未知鸡死淘</th>
-                  <th colspan="17">耗料</th>
-                  <th colspan="9">日体重数据</th>
-                  <th colspan="9">产蛋情况</th>
-		        </tr>
-		        <tr>
-		          <th rowspan="2">天</th>
-		          <th rowspan="2">生长周龄</th>
-		          <th rowspan="2">产蛋周龄</th>
-		          <th rowspan="2">母鸡</th>
-		          <th rowspan="2">公鸡</th>
-		          <th rowspan="2">未知</th>
-		          <th rowspan="2">合计</th>
-		          <th colspan="5">母鸡死淘数量</th>
-		          <th colspan="2">累计</th>
-		          <th colspan="5">公鸡死淘数量</th>
-		          <th colspan="2">累计</th>
-		          <th colspan="5">未知死淘数量</th>
-		          <th colspan="2">累计</th>
-                  <th colspan="4">耗料量(g)</th>
-                  <th colspan="3">耗料量/只/日(g)</th>
-                  <th colspan="3">耗料量/只/日(g)</th>
-                  <th colspan="4">累计耗料量(g)</th>
-                  <th rowspan="2">母鸡喂料种类</th>
-                  <th rowspan="2">公鸡喂料种类</th>
-                  <th rowspan="2">未知喂料种类</th>
-                  <th colspan="2">实际母鸡</th>
-                  <th colspan="2">实际公鸡</th>
-                  <th colspan="2">实际未知</th>
-                  <th colspan="3">母系标准体重</th>
-                   <th rowspan="2">总产蛋数</th>
-                    <th rowspan="2">上缴种蛋</th>
-                     <th colspan="6">商品蛋</th>
-                      <th rowspan="2">实际蛋重(g)</th>
-		        </tr>
-		        <tr>
-		          <th>死亡</th>
-		          <th>淘汰</th>
-		          <th>打包淘汰</th>
-		          <th>合计</th>
-		          <th>死淘率(%)</th>
-		          <th>死淘</th>
-		          <th>死淘率(%)</th>
-		          <th>死亡</th>
-		          <th>淘汰</th>
-		          <th>打包淘汰</th>
-		          <th>合计</th>
-		          <th>死淘率(%)</th>
-		          <th>死淘</th>
-		          <th>死淘率(%)</th>
-		          <th>死亡</th>
-		          <th>淘汰</th>
-		          <th>打包淘汰</th>
-		          <th>合计</th>
-		          <th>死淘率(%)</th>
-		          <th>死淘</th>
-		          <th>死淘率(%)</th>
-                  <th>母鸡</th>
-                  <th>公鸡</th>
-                  <th>未知</th>
-                  <th>合计</th>
-                  <th>实际母鸡</th>
-                  <th>实际公鸡</th>
-                  <th>实际未知</th>
-                  <th>标准母鸡</th>
-                  <th>标准公鸡</th>
-                  <th>标准未知</th>
-                   <th>母鸡</th>
-                  <th>公鸡</th>
-                  <th>未知</th>
-                  <th>合计</th>
-                   <th>母鸡体重</th>
-                    <th>均匀度(%)</th>
-                    <th>公鸡体重</th>
-                    <th>均匀度(%)</th>
-                    <th>未知体重</th>
-                    <th>均匀度(%)</th>
-                    <th>标准母鸡</th>
-                    <th>标准公鸡</th>
-                    <th>标准未知</th>
-                      <th>纯系种蛋</th>
-                    <th>祖代蛋</th>
-                    <th>父母代蛋</th>
-                    <th>菜蛋</th>
-                    <th>畸形蛋</th>
-                    <th>破蛋</th>
-		        </tr>
-		      </thead>
-		      <tbody>
-                <tr v-for="item in reportDataItems" :key="item.id">
-                    <td>{{ dayjs(item.recordDate).format("YYYY年MM月DD日") }}</td>
-                    <td>{{ item.dayCount }}</td>
-                    <td>{{ item.weekAge }}</td>
-                    <td>{{ item.layingWeekAge }}</td>
-                    <td>{{ item.chicken0Count }}</td>
-                    <td>{{ item.chicken1Count }}</td>
-                    <td>{{ item.chicken2Count }}</td>
-                    <td>{{ item.chickenCountTotal }}</td>
-                    <td>{{ item.maleFemaleRatio }}</td>
-                    <td>{{ item.death0 }}</td>
-                    <td>{{ item.cull0 }}</td>
-                    <td>{{ item.packageCull0 }}</td>
-                    <td>{{ item.deathCullTotal0 }}</td>
-                    <td>{{ item.deathCullRate0 }}</td>
-                    <td>{{ item.accumCullTotal0 }}</td>
-                    <td>{{ item.accumCullRate0 }}</td>
-                    <td>{{ item.death1 }}</td>
-                    <td>{{ item.cull1 }}</td>
-                    <td>{{ item.packageCull1 }}</td>
-                    <td>{{ item.deathCullTotal1 }}</td>
-                    <td>{{ item.deathCullRate1 }}</td>
-                    <td>{{ item.accumCullTotal1 }}</td>
-                    <td>{{ item.accumCullRate1 }}</td>
-                    <td>{{ item.death2 }}</td>
-                    <td>{{ item.cull2 }}</td>
-                    <td>{{ item.packageCull2 }}</td>
-                    <td>{{ item.deathCullTotal2 }}</td>
-                    <td>{{ item.deathCullRate2 }}</td>
-                    <td>{{ item.accumCullTotal2 }}</td>
-                    <td>{{ item.accumCullRate2 }}</td>
-                    <td>{{ item.poultDailyFeed0 }}</td>
-                    <td>{{ item.poultDailyFeed1 }}</td>
-                    <td>{{ item.poultDailyFeed2 }}</td>
-                    <td>{{ item.poultDailyFeed0 + item.poultDailyFeed1 + item.poultDailyFeed2 }}</td>
-                    <td>{{ item.poultDailyFeedAvg0 }}</td>
-                    <td>{{ item.poultDailyFeedAvg1 }}</td>
-                    <td>{{ item.poultDailyFeedAvg2 }}</td>
-                    <td>{{ item.poultDailyFeedStandard0 }}</td>
-                    <td>{{ item.poultDailyFeedStandard1 }}</td>
-                    <td>{{ item.poultDailyFeedStandard2 }}</td>
-                    <td>{{ item.accumFeedAmount0 }}</td>
-                    <td>{{ item.accumFeedAmount1 }}</td>
-                    <td>{{ item.accumFeedAmount2 }}</td>
-                    <td>{{ item.accumFeedAmount0+item.accumFeedAmount1+item.accumFeedAmount2 }}</td>
-                    <td>{{ item.feed0 }}</td>
-                    <td>{{ item.feed1 }}</td>
-                    <td>{{ item.feed2 }}</td>
-                    <td>{{ item.weight0 }}</td>
-                    <td>{{ item.uniformity0 }}</td>
-                    <td>{{ item.weight1 }}</td>
-                    <td>{{ item.uniformity1 }}</td>
-                    <td>{{ item.weight2 }}</td>
-                    <td>{{ item.uniformity2 }}</td>
-                    <td>{{ item.standardWeight0 }}</td>
-                    <td>{{ item.standardWeight1 }}</td>
-                    <td>{{ item.standardWeight2 }}</td>
-                    <td>{{ item.totalEggs }}</td>
-                    <td>{{ item.eggCount0 }}</td>
-                    <td>{{ item.eggCount1 }}</td>
-                    <td>{{ item.eggCount2 }}</td>
-                    <td>{{ item.eggCount3 }}</td>
-                    <td>{{ item.eggCount4 }}</td>
-                    <td>{{ item.eggCount5 }}</td>
-                    <td>{{ item.eggCount6 }}</td>
-                    <td>{{ item.eggWeight }}</td>
-                </tr>
-		        <!-- 数据行将在这里渲染 -->
-		        <!-- <tr>
-		          <td>2023-01-01</td>
-		          <td>1</td>
-		          <td>1</td>
-		          <td>1</td>
-		          <td>1000</td>
-		          <td>100</td>
-		          <td>0</td>
-		          <td>1100</td>
-		          <td>10.0</td>
-		          <td>0</td>
-		          <td>0</td>
-		          <td>0</td>
-		          <td>0</td>
-		          <td>0.0</td>
-		          <td>0</td>
-		          <td>0.0</td>
-		          <td>0</td>
-		          <td>0</td>
-		          <td>0</td>
-		          <td>0</td>
-		          <td>0.0</td>
-		          <td>0</td>
-		          <td>0.0</td>
-		          <td>0</td>
-		          <td>0</td>
-		          <td>0</td>
-		          <td>0</td>
-		          <td>0.0</td>
-		          <td>0</td>
-		          <td>0.0</td>
-                  <td>0.0</td>
-                  <td>0.0</td>
-                  <td>0.0</td>
-                   <td>0.0</td>
-                  <td>0.0</td>
-                  <td>0.0</td>
-                   <td>0.0</td>
-                  <td>0.0</td>
-                  <td>0.0</td>
-                   <td>0.0</td>
-                  <td>0.0</td>
-                  <td>0.0</td>
-                  <td>0.0</td>
-                  <td>0.0</td>
-                   <td>0.0</td>
-                  <td>0.0</td>
-                  <td>0.0</td>
-		        </tr> -->
-		        <!-- 添加更多数据行的示例 -->
-		        <!-- <tr>
-		          <td>2023-01-02</td>
-		          <td>2</td>
-		          <td>1</td>
-		          <td>1</td>
-		          <td>990</td>
-		          <td>95</td>
-		          <td>0</td>
-		          <td>1085</td>
-		          <td>9.6</td>
-		          <td>1</td>
-		          <td>0</td>
-		          <td>0</td>
-		          <td>1</td>
-		          <td>0.1</td>
-		          <td>1</td>
-		          <td>0.1</td>
-		          <td>0</td>
-		          <td>0</td>
-		          <td>0</td>
-		          <td>0</td>
-		          <td>0.0</td>
-		          <td>0</td>
-		          <td>0.0</td>
-		          <td>0</td>
-		          <td>0</td>
-		          <td>0</td>
-		          <td>0</td>
-		          <td>0.0</td>
-		          <td>0</td>
-		          <td>0.0</td>
-                   <td>0.0</td>
-                  <td>0.0</td>
-                   <td>0.0</td>
-                  <td>0.0</td>
-                  <td>0.0</td>
-                  <td>0.0</td>
-                  <td>0.0</td>
-                   <td>0.0</td>
-                  <td>0.0</td>
-                  <td>0.0</td>
-                   <td>0.0</td>
-                  <td>0.0</td>
-                  <td>0.0</td>
-                  <td>0.0</td>
-                   <td>0.0</td>
-                  <td>0.0</td>
-                  <td>0.0</td>
-		        </tr> -->
-		      </tbody>
-		    </table>
-		 </div>
-	</div>
-      <BatchModal ref="batchModalRef" :multiple="false" @confirm="onBatchConfirm" />
-</template>
-<style scoped>
-	.table-container {
-	  overflow-x: auto;
-	  scrollbar-width: thin;
-	  scrollbar-color: #a0cfff #f1f1f1;
-	  border-radius: 8px;
-	  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
-	  margin: 20px 0;
-	}
-	
-	.table-container::-webkit-scrollbar {
-	  height: 8px;
-	}
-	
-	.table-container::-webkit-scrollbar-track {
-	  background: #f1f1f1;
-	  border-radius: 4px;
-	}
-	
-	.table-container::-webkit-scrollbar-thumb {
-	  background: #a0cfff;
-	  border-radius: 4px;
-	}
-	
-	.table-container::-webkit-scrollbar-thumb:hover {
-	  background: #7fbaff;
-	}
-	
-	.table {
-	  min-width: 100%;
-	  border-collapse: separate;
-	  border-spacing: 0;
-	  width: 100%;
-	  border-radius: 8px;
-	  overflow: hidden;
-	  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
-	}
-	
-	.table th,
-	.table td {
-	  padding: 12px 15px;
-	  text-align: center;
-	  white-space: nowrap;
-	  border-right: 1px solid #d0d7e0;
-	  border-bottom: 1px solid #d0d7e0;
-	}
-	
-	.table th {
-	  background-color: #e6f0ff;
-	  color: #2c5aa0;
-	  font-weight: 600;
-	  text-transform: uppercase;
-	  letter-spacing: 0.5px;
-	  font-size: 13px;
-	  /* 垂直居中对齐 */
-	  vertical-align: middle;
-	}
-	
-	.table td {
-	  /* 垂直居中对齐 */
-	  vertical-align: middle;
-	}
-	
-	.table th:last-child,
-	.table td:last-child {
-	  border-right: none;
-	}
-	
-	/* 斑马纹样式 */
-	.table tbody tr:nth-child(even) {
-	  background-color: #fafcff;
-	}
-	
-	/* 悬停效果 */
-	.table tbody tr:hover {
-	  background-color: #f0f7ff;
-	  transition: background-color 0.2s ease;
-	}
-	
-	/* 表头第一行特殊样式 */
-	.table thead tr:first-child th {
-	  background-color: #d1e4ff;
-	}
-	
-	/* 数字列右对齐 */
-	.table td:nth-child(n+10) {
-	  text-align: right;
-	}
-	/* 育种场信息表格样式 */
-	.farm-info-container {
-	  margin: 10px auto;
-	  border-radius: 8px;
-	  overflow: hidden;
-	  max-width: 1200px;
-	  width: 100%;
-     
-	}
-	
-	.farm-info-table {
-	  width: 100%;
-	  border-collapse: separate;
-	  border-spacing: 0;
-	  background-color: #ffffff;
-	  font-size: 13px;
-      border:1px solid #d0d7e0;
-	}
-	
-	.farm-info-table td {
-	  padding: 6px 10px;
-	  text-align: center;
-	  border-right: 1px solid #d0d7e0;
-	  border-bottom: 1px solid #d0d7e0;
-	  vertical-align: middle;
-	}
-	
-	.farm-info-table td:last-child {
-	  border-right: none;
-	}
-	
-	.farm-info-table tr:last-child td {
-	  border-bottom: none;
-	}
-	
-	/* 合并单元格的背景色 */
-	.farm-info-table td[rowspan],
-	.farm-info-table td[colspan] {
-	  background-color: #fafdff;
-	  font-weight: 500;
-	}
-	
-	/* 数据单元格的样式 */
-	.farm-info-table td:not([rowspan]):not([colspan]) {
-	  background-color: #ffffff;
-	}
-	
-	/* 需要从后端获取数据的列样式(实际第3、5、7、9列) */
-	 
-	/* 第1行 */
-	.important-cell {
-	  background-color: #fffefe !important;
-	  font-weight: 600;
-	  color: #3d4144 !important;
-	  border-radius: 4px;
-	  padding: 4px 8px;
-	}
-</style>
- 
- 

+ 650 - 177
UI/VB.VUE/src/views/report/batchDay/index.vue

@@ -2,7 +2,591 @@
 import BatchModal from "@/views/common/modal/batchModal.vue"
 import dayjs from "dayjs"
 import apis from "@/api/breeding"  
-
+import type{Header} from "@/components/table/models"
+const headers = ref<Header[]>([
+	{
+		field: "recordDate",
+		name: "记录日期",
+		visible: true,
+		isSort: false,
+		tooltip: true,
+		width: "100px",
+	},
+	{
+		field: "周龄",
+		name: "周龄",
+		visible: true,
+		isSort: false,
+		tooltip: true,
+		width: "230px",
+		children: [
+			{
+				field: "dayCount",
+				name: "天",
+				visible: true,
+				isSort: false,
+				width: "50px",
+				tooltip: true,
+			},
+			{
+				field: "weekAge",
+				name: "生长周龄",
+				visible: true,
+				isSort: false,
+				width: "80px",
+				tooltip: true
+			},
+			{
+				field: "layingWeekAge",
+				name: "产蛋周龄",
+				visible: true,
+				isSort: false,
+				width: "80px",
+				tooltip: true
+			}
+		]
+	},
+	{
+		field: "存栏鸡数", name: "存栏鸡数", visible: true, isSort: false, width:"300px",
+		children: [
+			{
+				field: "chicken1Count",
+				name: "母鸡",
+				visible: true,
+				isSort: false,
+				width: "100px",
+				tooltip: true
+			},
+			{
+				field: "chicken0Count",
+				name: "公鸡",
+				visible: true,
+				isSort: false,
+				width: "100px",
+				tooltip: true
+			},
+			{
+				field: "chicken2Count",
+				name: "未知",
+				visible: true,
+				isSort: false,
+				width: "100px",
+				tooltip: true
+			},
+			{
+				field: "chickenCountTotal",
+				name: "合计",
+				visible: true,
+				isSort: false,
+				width: "100px",
+				tooltip: true
+			}
+		]
+	},
+	{ field: "maleFemaleRatio", name: "公母比例(%)", visible: true, isSort: false, tooltip: true, width: "80px" },
+	{
+		field: "母鸡死淘",
+		name: `母鸡死淘`,
+		width: "600px",
+		children: [
+			{
+				field: "母鸡死淘数量",
+				name: "母鸡死淘数量",
+				visible: true,
+				isSort: false,
+				width: "500px",
+				tooltip: true,
+				children: [
+					{
+						field: "death1",
+						name: "死亡",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "cull1",
+						name: "淘汰",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}, {
+						field: "packageCull1",
+						name: "打包淘汰",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}, {
+						field: "deathCullTotal1",
+						name: "合计",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}, {
+						field: "deathCullRate1",
+						name: "死淘率(%)",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}
+				]
+			},
+			{
+				field: '累计',
+				name: '累计',
+				visible: true,
+				isSort: false,
+				width: "100px",
+				children: [
+					{
+						field: "accumCullTotal1",
+						name: "死淘",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}, {
+						field: "accumCullRate1",
+						name: "死淘率(%)",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}
+				]
+			}
+		]
+	},
+	{
+		field: "公鸡死淘",
+		name: `公鸡死淘`,
+		width: "600px",
+		children: [
+			{
+				field: "公鸡死淘数量",
+				name: "公鸡死淘数量",
+				visible: true,
+				isSort: false,
+				width: "500px",
+				tooltip: true,
+				children: [
+					{
+						field: "death0",
+						name: "死亡",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "cull0",
+						name: "淘汰",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}, {
+						field: "packageCull0",
+						name: "打包淘汰",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}, {
+						field: "deathCullTotal0",
+						name: "合计",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}, {
+						field: "deathCullRate0",
+						name: "死淘率(%)",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}
+				]
+			},
+			{
+				field: '累计',
+				name: '累计',
+				visible: true,
+				isSort: false,
+				width: "100px",
+				children: [
+					{
+						field: "accumCullTotal0",
+						name: "死淘",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}, {
+						field: "accumCullRate0",
+						name: "死淘率(%)",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}
+				]
+			}
+		]
+	},
+	{
+		field: "未知死淘",
+		name: `未知死淘`,
+		width: "600px",
+		children: [
+			{
+				field: "未知死淘数量",
+				name: "未知死淘数量",
+				visible: true,
+				isSort: false,
+				width: "500px",
+				tooltip: true,
+				children: [
+					{
+						field: "death2",
+						name: "死亡",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "cull2",
+						name: "淘汰",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}, {
+						field: "packageCull2",
+						name: "打包淘汰",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}, {
+						field: "deathCullTotal2",
+						name: "合计",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}, {
+						field: "deathCullRate2",
+						name: "死淘率(%)",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}
+				]
+			},
+			{
+				field: '累计',
+				name: '累计',
+				visible: true,
+				isSort: false,
+				width: "100px",
+				children: [
+					{
+						field: "accumCullTotal2",
+						name: "死淘",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}, {
+						field: "accumCullRate2",
+						name: "死淘率(%)",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}
+				]
+			}
+		]
+	},
+	{
+		field: "耗料",
+		name: "耗料",
+		visible: true,
+		isSort: false,
+		width: "900px",
+		children: [
+			{
+				field: "耗料量(g)",
+				name: "耗料量(g)",
+				visible: true,
+				isSort: false,
+				width: "250px",
+				children: [
+					{
+						field: "poultDailyFeed1",
+						name: "母鸡",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "poultDailyFeed0",
+						name: "公鸡",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "poultDailyFeed2",
+						name: "未知",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "poultDailyFeedTotal	",
+						name: "合计",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}
+				]
+			},
+			{
+				field: "耗料量/只/日(g)",
+				name: "耗料量/只/日(g)",
+				visible: true,
+				isSort: false,
+				width: "250px",
+				children: [
+					{
+						field: "poultDailyFeedAvg1",
+						name: "母鸡",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "poultDailyFeedAvg0",
+						name: "公鸡",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "poultDailyFeedAvg2",
+						name: "未知",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}
+				]
+			},
+			{
+				field: "feed1",
+				name: "母鸡喂料",
+				visible: true,
+				isSort: false,
+				width: "200px",
+				tooltip: true,
+			},
+			{
+				field: "feed0",
+				name: "公鸡喂料",
+				visible: true,
+				isSort: false,
+				width: "200px",
+				tooltip: true,
+			},
+			{
+				field: "feed2",
+				name: "未知喂料",
+				visible: true,
+				isSort: false,
+				width: "200px",
+				tooltip: true,
+			}
+		]
+	},
+	{
+		field: "日体重数据",
+		name: "日体重数据",
+		visible: true,
+		isSort: false,
+		width: "900px",
+		children: [
+			{
+				field: "实际母鸡",
+				name: "实际母鸡",
+				visible: true,
+				isSort: false,
+				width: "100px",
+				children: [
+					{
+						field: "weight1",
+						name: "体重",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "uniformity1",
+						name: "均匀度(%)",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}
+				]
+			},
+			{
+				field: "实际公鸡",
+				name: "实际公鸡",
+				visible: true,
+				isSort: false,
+				width: "100px",
+				children: [
+					{
+						field: "weight0",
+						name: "体重",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "uniformity0",
+						name: "均匀度(%)",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}
+				]
+			},
+			{
+				field: "实际未知",
+				name: "实际未知",
+				visible: true,
+				isSort: false,
+				width: "100px",
+				children: [
+					{
+						field: "weight2",
+						name: "体重",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "uniformity2",
+						name: "均匀度(%)",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}
+				]
+			},
+			{
+				field: "母系标准体重",
+				name: "母系标准体重",
+				visible: true,
+				isSort: false,
+				width: "100px",
+				children: [
+					{
+						field: "standardWeight1",
+						name: "母鸡",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "standardWeight0",
+						name: "公鸡",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "standardWeight2",
+						name: "未知",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}
+				]
+			}
+		]
+	},
+	{
+		field: "产蛋情况",
+		name: "产蛋情况",
+		visible: true,
+		isSort: false,
+		width: "auto",
+		children: [
+			{
+				field: "totalEggs",
+				name: "总产蛋数",
+				visible: true,
+				isSort: false,
+				width: "100px",
+			},
+			{
+				field: "eggCount0",
+				name: "上缴种蛋",
+				visible: true,
+				isSort: false,
+				width: "100px",
+			},
+			{
+				field: "商品蛋",
+				name: "商品蛋",
+				visible: true,
+				isSort: false,
+				width: "100px",
+				children: [
+					{
+						field: "eggCount1",
+						name: "纯系种蛋",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "eggCount2",
+						name: "祖代蛋",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "eggCount3",
+						name: "父母代蛋",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "eggCount4",
+						name: "菜蛋",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "eggCount5",
+						name: "畸形蛋",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "eggCount6",
+						name: "破蛋",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}
+				]
+			},
+			{
+				field: "eggWeight",
+				name: "实际蛋重(g)",
+				visible: true,
+				isSort: false,
+				width: "100px",
+			}
+		]
+	}
+]);
 // 初始化默认日期范围为最近一个月
 const getDefaultDateRange = () => {
     const endDate = dayjs()
@@ -13,10 +597,10 @@ const getDefaultDateRange = () => {
  
 const formData = ref({
 	batchNum: "",
-	//recordDate: "",
+	recordDate: "",
     dateRange: getDefaultDateRange(),
 	params: {},
-	//type: 0
+	type: 0
 })
 
 // 批次选择模态框相关
@@ -166,8 +750,10 @@ defineExpose({
                <el-form-item>
                    <el-button type="primary" @click="handleSearch">查询</el-button>
                    <el-button type="warning" @click="handleExport">导出</el-button>
-				     <el-button type="success" @click="handleGenerateReport(0)">生成日报表0</el-button>
-					   <el-button type="success" @click="handleGenerateReport(1)">生成日报表1</el-button>
+                   <div class="hidden-buttons-container">
+                       <el-button type="success" @click="handleGenerateReport(0)">生成日报表0</el-button>
+                       <el-button type="success" @click="handleGenerateReport(1)">生成日报表1</el-button>
+                   </div>
                </el-form-item>           
            </el-form>
         </div>  
@@ -206,7 +792,7 @@ defineExpose({
                 <th>来源</th>
                 <th class="important-cell">{{ batchInfo.source }}</th>
                 <th>进鸡日期</th>
-                <th class="important-cell">{{ dayjs(batchInfo.hatchDate).format("YYYY年MM月DD日") }}</th>
+                <th class="important-cell">{{dayjs(batchInfo.hatchDate).isValid() ? dayjs(batchInfo.hatchDate).format("YYYY年MM月DD日") : "-" }}</th>
                 <th>公鸡进苗数</th>
                 <th class="important-cell">{{ batchInfo.chickenCount0 }}</th>
                 <th>产蛋舍</th>
@@ -218,154 +804,23 @@ defineExpose({
 	 
 	 <!-- 使用 Element Plus 的 el-table 替换原生表格 -->
 	 <div class="table-container">
-	   <el-table 
-	     :data="reportDataItems" 
-	     border 
-	     :style="{ width: '100%' }" 
-	     :height="600"
-	     :header-cell-style="{ backgroundColor: '#e6f0ff', color: '#2c5aa0', fontWeight: 600, textAlign: 'center', border: '1px solid #d0d7e0' } "
-	     :cell-style="{ border: '1px solid #d0d7e0', textAlign: 'center' }"
-	     highlight-current-row>
-	     <!-- 固定列:日期 -->
-	     <el-table-column prop="recordDate" label="日期" fixed width="100" :formatter="formatDate">
-	     </el-table-column>
-	     
-	     <!-- 周龄分组 -->
-	     <el-table-column label="周龄"  fixed  :colspan="3">
-	       <el-table-column prop="dayCount" label="天" width="60" ></el-table-column>
-	       <el-table-column prop="weekAge" label="生长周龄" width="80" ></el-table-column>
-	       <el-table-column prop="layingWeekAge" label="产蛋周龄" width="80" ></el-table-column>
-	     </el-table-column>
-	     
-	     <!-- 存栏鸡数分组 -->
-	     <el-table-column label="存栏鸡数" fixed :colspan="4">
-	       <el-table-column prop="chicken1Count" label="母鸡" width="80" ></el-table-column>
-	       <el-table-column prop="chicken0Count" label="公鸡" width="80" ></el-table-column>
-	       <el-table-column prop="chicken2Count" label="未知" width="80" ></el-table-column>
-	       <el-table-column prop="chickenCountTotal" label="合计" width="80" ></el-table-column>
-	     </el-table-column>
-	     
-	     <!-- 公母比例(%) - 固定列 -->
-	     <el-table-column prop="maleFemaleRatio" label="公母比例(%)" fixed width="80" ></el-table-column>
-	     
-	     <!-- 母鸡死淘分组 -->
-	     <el-table-column label="母鸡死淘" :colspan="7">
-	       <el-table-column label="母鸡死淘数量" :colspan="5">
-	         <el-table-column prop="death1" label="死亡" width="80"></el-table-column>
-	         <el-table-column prop="cull1" label="淘汰" width="80"></el-table-column>
-	         <el-table-column prop="packageCull1" label="打包淘汰" width="100"></el-table-column>
-	         <el-table-column prop="deathCullTotal1" label="合计" width="80"></el-table-column>
-	         <el-table-column prop="deathCullRate1" label="死淘率(%)" width="100"></el-table-column>
-	       </el-table-column>
-	       <el-table-column label="累计" :colspan="2">
-	         <el-table-column prop="accumCullTotal1" label="死淘" width="80"></el-table-column>
-	         <el-table-column prop="accumCullRate1" label="死淘率(%)" width="100"></el-table-column>
-	       </el-table-column>
-	     </el-table-column>
-	     
-	     <!-- 公鸡死淘分组 -->
-	     <el-table-column label="公鸡死淘" :colspan="7">
-	       <el-table-column label="公鸡死淘数量" :colspan="5">
-	         <el-table-column prop="death0" label="死亡" width="80"></el-table-column>
-	         <el-table-column prop="cull0" label="淘汰" width="80"></el-table-column>
-	         <el-table-column prop="packageCull0" label="打包淘汰" width="100"></el-table-column>
-	         <el-table-column prop="deathCullTotal0" label="合计" width="80"></el-table-column>
-	         <el-table-column prop="deathCullRate0" label="死淘率(%)" width="100"></el-table-column>
-	       </el-table-column>
-	       <el-table-column label="累计" :colspan="2">
-	         <el-table-column prop="accumCullTotal0" label="死淘" width="80"></el-table-column>
-	         <el-table-column prop="accumCullRate0" label="死淘率(%)" width="100"></el-table-column>
-	       </el-table-column>
-	     </el-table-column>
-	     
-	     <!-- 未知鸡死淘分组 -->
-	     <el-table-column label="未知鸡死淘" :colspan="7">
-	       <el-table-column label="未知死淘数量" :colspan="5">
-	         <el-table-column prop="death2" label="死亡" width="80"></el-table-column>
-	         <el-table-column prop="cull2" label="淘汰" width="80"></el-table-column>
-	         <el-table-column prop="packageCull2" label="打包淘汰" width="100"></el-table-column>
-	         <el-table-column prop="deathCullTotal2" label="合计" width="80"></el-table-column>
-	         <el-table-column prop="deathCullRate2" label="死淘率(%)" width="100"></el-table-column>
-	       </el-table-column>
-	       <el-table-column label="累计" :colspan="2">
-	         <el-table-column prop="accumCullTotal2" label="死淘" width="80"></el-table-column>
-	         <el-table-column prop="accumCullRate2" label="死淘率(%)" width="100"></el-table-column>
-	       </el-table-column>
-	     </el-table-column>
-	     
-	     <!-- 耗料分组 -->
-	     <el-table-column label="耗料" :colspan="17">
-	       <el-table-column label="耗料量(g)" :colspan="4">
-	         <el-table-column prop="poultDailyFeed1" label="母鸡" width="80"></el-table-column>
-	         <el-table-column prop="poultDailyFeed0" label="公鸡" width="80"></el-table-column>
-	         <el-table-column prop="poultDailyFeed2" label="未知" width="80"></el-table-column>
-	         <el-table-column label="合计" width="80">
-	           <template #default="scope">
-	             {{ (scope.row.poultDailyFeed0 || 0) + (scope.row.poultDailyFeed1 || 0) + (scope.row.poultDailyFeed2 || 0) }}
-	           </template>
-	         </el-table-column>
-	       </el-table-column>
-	       <el-table-column label="耗料量/只/日(g)" :colspan="3">
-	         <el-table-column prop="poultDailyFeedAvg1" label="母鸡" width="80"></el-table-column>
-	         <el-table-column prop="poultDailyFeedAvg0" label="公鸡" width="80"></el-table-column>
-	         <el-table-column prop="poultDailyFeedAvg2" label="未知" width="80"></el-table-column>
-	       </el-table-column>
-	       <el-table-column label="耗料量/只/日(g)" :colspan="3">
-	         <el-table-column prop="poultDailyFeedStandard1" label="母鸡" width="80"></el-table-column>
-	         <el-table-column prop="poultDailyFeedStandard0" label="公鸡" width="80"></el-table-column>
-	         <el-table-column prop="poultDailyFeedStandard2" label="未知" width="80"></el-table-column>
-	       </el-table-column>
-	       <el-table-column label="累计耗料量(g)" :colspan="4">
-	         <el-table-column prop="accumFeedAmount1" label="母鸡" width="80"></el-table-column>
-	         <el-table-column prop="accumFeedAmount0" label="公鸡" width="80"></el-table-column>
-	         <el-table-column prop="accumFeedAmount2" label="未知" width="80"></el-table-column>
-	         <el-table-column label="合计" width="80">
-	           <template #default="scope">
-	             {{ (scope.row.accumFeedAmount0 || 0) + (scope.row.accumFeedAmount1 || 0) + (scope.row.accumFeedAmount2 || 0) }}
-	           </template>
-	         </el-table-column>
-	       </el-table-column>
-	       <el-table-column prop="feed1" label="母鸡喂料种类" width="120"></el-table-column>
-	       <el-table-column prop="feed0" label="公鸡喂料种类" width="120"></el-table-column>
-	       <el-table-column prop="feed2" label="未知喂料种类" width="120"></el-table-column>
-	     </el-table-column>
-	     
-	     <!-- 日体重数据分组 -->
-	     <el-table-column label="日体重数据" :colspan="9">
-	       <el-table-column label="实际母鸡" :colspan="2">
-	         <el-table-column prop="weight1" label="体重" width="80"></el-table-column>
-	         <el-table-column prop="uniformity1" label="均匀度(%)" width="100"></el-table-column>
-	       </el-table-column>
-	       <el-table-column label="实际公鸡" :colspan="2">
-	         <el-table-column prop="weight0" label="体重" width="80"></el-table-column>
-	         <el-table-column prop="uniformity0" label="均匀度(%)" width="100"></el-table-column>
-	       </el-table-column>
-	       <el-table-column label="实际未知" :colspan="2">
-	         <el-table-column prop="weight2" label="体重" width="80"></el-table-column>
-	         <el-table-column prop="uniformity2" label="均匀度(%)" width="100"></el-table-column>
-	       </el-table-column>
-	       <el-table-column label="母系标准体重" :colspan="3">
-	         <el-table-column prop="standardWeight1" label="母鸡" width="80"></el-table-column>
-	         <el-table-column prop="standardWeight0" label="公鸡" width="80"></el-table-column>
-	         <el-table-column prop="standardWeight2" label="未知" width="80"></el-table-column>
-	       </el-table-column>
-	     </el-table-column>
-	     
-	     <!-- 产蛋情况分组 -->
-	     <el-table-column label="产蛋情况" :colspan="9">
-	       <el-table-column prop="totalEggs" label="总产蛋数" width="100"></el-table-column>
-	       <el-table-column prop="eggCount0" label="上缴种蛋" width="100"></el-table-column>
-	       <el-table-column label="商品蛋" :colspan="6">
-	         <el-table-column prop="eggCount1" label="纯系种蛋" width="100"></el-table-column>
-	         <el-table-column prop="eggCount2" label="祖代蛋" width="100"></el-table-column>
-	         <el-table-column prop="eggCount3" label="父母代蛋" width="100"></el-table-column>
-	         <el-table-column prop="eggCount4" label="菜蛋" width="100"></el-table-column>
-	         <el-table-column prop="eggCount5" label="畸形蛋" width="100"></el-table-column>
-	         <el-table-column prop="eggCount6" label="破蛋" width="100"></el-table-column>
-	       </el-table-column>
-	       <el-table-column prop="eggWeight" label="实际蛋重(g)" width="100"></el-table-column>
-	     </el-table-column>
-	   </el-table>
+		<vb-data-table
+				:columns="headers"
+				:data="reportDataItems"
+				ref="tableRef"
+				keyField="id"
+				:no-page="true"
+				:fixed-number="9"
+				:scroll="{ x: 5100 }"
+				:check-multiple="false"
+				:show-toolbar="false">
+				<template #recordDate="{ row }">
+					{{ dayjs(row.recordDate).format("YYYY-MM-DD") }}
+				</template>
+			<template #poultDailyFeedTotal="{ row }">
+				{{ (row.poultDailyFeed0 || 0) + (row.poultDailyFeed1 || 0) + (row.poultDailyFeed2 || 0) }}
+			</template>
+        </vb-data-table>
 	 </div>
 	</div>
       <BatchModal ref="batchModalRef" :multiple="false" @confirm="onBatchConfirm" />
@@ -380,23 +835,6 @@ defineExpose({
 	  margin: 20px 0;
 	}
 	
-	.table-container::-webkit-scrollbar {
-	  height: 8px;
-	}
-	
-	.table-container::-webkit-scrollbar-track {
-	  background: #f1f1f1;
-	  border-radius: 4px;
-	}
-	
-	.table-container::-webkit-scrollbar-thumb {
-	  background: #a0cfff;
-	  border-radius: 4px;
-	}
-	
-	.table-container::-webkit-scrollbar-thumb:hover {
-	  background: #7fbaff;
-	}
 	
 	.table {
 	  min-width: 100%;
@@ -461,11 +899,46 @@ defineExpose({
 	/* 育种场信息表格样式 */
 	.farm-info-container {
 	  margin: 10px auto;
-	  border-radius: 8px;
-	  overflow: hidden;
-	  max-width: 1200px;
-	  width: 100%;
-     
+	}
+	
+	/* 隐藏按钮容器样式 */
+	.hidden-buttons-container {
+	  position: fixed;
+	  right: 0;
+	  top: 50%;
+	  transform: translateY(-50%);
+	  z-index: 1000;
+	  padding: 10px 0;
+	  background: rgba(255, 255, 255, 0.95);
+	  border-radius: 8px 0 0 8px;
+	  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
+	  opacity: 0;
+	  transition: opacity 0.3s ease;
+	}
+
+	.hidden-buttons-container:hover {
+	  opacity: 1;
+	}
+
+	.hidden-buttons-container .el-button {
+	  display: block;
+	  width: 50px;
+	  height: 50px;
+	  margin: 5px 10px;
+	  padding: 0;
+	  border-radius: 50%;
+	  opacity: 0;
+	  transition: all 0.3s ease;
+	  transform: translateX(100%);
+	}
+
+	.hidden-buttons-container:hover .el-button {
+	  transform: translateX(0);
+	  opacity: 1;
+	}
+
+	.hidden-buttons-container .el-button:first-child {
+	  margin-bottom: 10px;
 	}
 	
 	.farm-info-table {
@@ -518,4 +991,4 @@ defineExpose({
 	}
 </style>
  
- 
+ 

+ 535 - 0
UI/VB.VUE/src/views/report/coopBatchDay/index copy 2.vue

@@ -0,0 +1,535 @@
+<script setup lang="ts"> 
+import dayjs from "dayjs"
+import apis from "@/api/breeding"  
+import { message } from "@/core/utils/message"
+import type{Header} from "@/components/table/models"
+const tableRef = ref()
+ 
+const formData = ref({
+    type: "0",
+    recordDate: dayjs().format('YYYY-MM-DD'),
+    params: {}
+})
+ 
+ 
+const reportDataItems = ref([])
+const reportDataTotal = ref<any>({}) 
+// 查询处理函数
+function handleSearch() {
+    // 校验日期和类型是否已填写
+    if (!formData.value.recordDate) {
+        message.msgWarning("请选择日期")
+        return
+    }
+    
+    if (!formData.value.type) {
+        message.msgWarning("请选择类型")
+        return
+    }
+     
+    formData.value.params = {
+        beginRecordDate: formData.value.recordDate + ' 00:00:00',
+        endRecordDate: formData.value.recordDate + ' 23:59:59'
+    }
+    
+    
+    apis.coopBatchDayStatisticsApi.listQuery(formData.value).then((res: any) => {
+        console.log(res)
+        const { items, total } = res.data
+        reportDataItems.value = items
+        reportDataTotal.value = total
+    })
+    // 这里可以添加实际的查询逻辑
+    // 例如调用API获取数据等
+}
+
+ 
+
+// 导出处理函数
+function handleExport() {
+    // 校验日期和类型是否已填写
+    if (!formData.value.recordDate) {
+        message.msgWarning("请选择日期")
+        return
+    }
+    
+    if (!formData.value.type) {
+        message.msgWarning("请选择类型")
+        return
+    }
+    
+    formData.value.params = {
+        beginRecordDate: formData.value.recordDate + ' 00:00:00',
+        endRecordDate: formData.value.recordDate + ' 23:59:59'
+    }
+    
+    apis.coopBatchDayStatisticsApi.export(formData.value, '广明生物弥勒公司'+ 1+ "日报表.xlsx").then((res: any) => {
+        console.log(res)
+        message.msgSuccess("导出成功")
+    }).catch((error: any) => {
+        console.error("导出失败:", error)
+        message.msgError("导出失败")
+    })
+}
+
+// 日期格式化函数
+const formatDate = (row, column, cellValue) => {
+  return dayjs(cellValue).format('YYYY/MM/DD')
+}
+
+ 
+
+// 单元格样式
+const cellStyle = ({ row, column, rowIndex, columnIndex }) => {
+  // 日期列居中对齐
+  if (columnIndex === 0) {  // 日期列
+    return { textAlign: 'center' }
+  }
+  // 数字列右对齐
+  if (columnIndex >= 3) {  // 从第4列开始右对齐
+    return { textAlign: 'right' }
+  }
+  return { textAlign: 'center' }
+}
+
+function getSummaries({ columns, data }) {
+  const sums = []
+  columns.forEach((column, index) => {
+    if (index === 0) {
+      sums[index] = '合并'
+      return
+    }
+    // 对于前5列(1-4),由于被第0列跨列覆盖,不需要设置值
+    if (index >= 1 && index < 5) {
+      sums[index] = ''
+      return
+    }
+    // 根据列索引设置对应的合计值
+    switch(index) {
+      case 5: sums[index] = reportDataTotal.value.chicken1Count || 0; break;  // 母鸡列
+      case 6: sums[index] = reportDataTotal.value.chicken0Count || 0; break;  // 公鸡列
+      case 7: sums[index] = reportDataTotal.value.chicken2Count || 0; break;  // 未知列
+      case 8: sums[index] = reportDataTotal.value.totalChickenCount || 0; break;  // 合计列
+      case 9: sums[index] = reportDataTotal.value.maleFemaleRatio || '-'; break;  // 公母比例列
+      case 10: sums[index] = reportDataTotal.value.death1 || 0; break;  // 母鸡死亡
+      case 11: sums[index] = reportDataTotal.value.cull1 || 0; break;   // 母鸡淘汰
+      case 12: sums[index] = reportDataTotal.value.death0 || 0; break;  // 公鸡死亡
+      case 13: sums[index] = reportDataTotal.value.cull0 || 0; break;   // 公鸡淘汰
+      case 14: sums[index] = reportDataTotal.value.death2 || 0; break;  // 未知死亡
+      case 15: sums[index] = reportDataTotal.value.cull2 || 0; break;   // 未知淘汰
+      case 16: sums[index] = reportDataTotal.value.poultDailyFeedAvg1 || 0; break;  // 母鸡耗料
+      case 17: sums[index] = reportDataTotal.value.poultDailyFeedAvg0 || 0; break;  // 公鸡耗料
+      case 18: sums[index] = reportDataTotal.value.poultDailyFeedAvg2 || 0; break;  // 未知耗料
+      case 19: sums[index] = reportDataTotal.value.totalEggs || 0; break;  // 总产蛋数
+      case 20: sums[index] = reportDataTotal.value.eggCount0 || 0; break;  // 上缴种蛋
+      case 21: sums[index] = reportDataTotal.value.eggCount1 || 0; break;  // 纯系种蛋
+      case 22: sums[index] = reportDataTotal.value.eggCount2 || 0; break;  // 祖代蛋
+      case 23: sums[index] = reportDataTotal.value.eggCount3 || 0; break;  // 父母代蛋
+      case 24: sums[index] = reportDataTotal.value.eggCount4 || 0; break;  // 菜蛋
+      case 25: sums[index] = reportDataTotal.value.eggCount5 || 0; break;  // 畸形蛋
+      case 26: sums[index] = reportDataTotal.value.eggCount6 || 0; break;  // 破蛋
+      case 27: sums[index] = reportDataTotal.value.eggWeight || 0; break;  // 蛋重
+      case 28: sums[index] = reportDataTotal.value.accumEggCount || 0; break;  // 累计产蛋数
+      case 29: sums[index] = reportDataTotal.value.accumEggQualifiedCount || 0; break;  // 累计合格蛋数
+      case 30: sums[index] = reportDataTotal.value.eggProductionRate || '-'; break;  // 产蛋率
+      case 31: sums[index] = reportDataTotal.value.eggQualifiedRate || '-'; break;  // 合格蛋率
+      case 32: sums[index] = reportDataTotal.value.eggDeformedRate || '-'; break;  // 畸形蛋率
+      case 33: sums[index] = reportDataTotal.value.eggBreakRate || '-'; break;  // 破蛋率
+      default: sums[index] = ''; break;
+    }
+  })
+  return sums
+}
+
+// 合并单元格方法
+// 修复后的合并单元格方法
+function spanMethod({ row, rowIndex, columnIndex }: any) {
+  // 精准判断:合计行的 row 为 undefined 且 rowIndex === -1(Element Plus 标准标识)
+  const isSummaryRow = row === undefined && rowIndex === -1;
+
+  if (isSummaryRow) {
+    // 合计行:前5列合并为1列
+    if (columnIndex === 0) {
+      return { rowspan: 1, colspan: 5 }; // 合并前5列
+    }
+    // 被合并的列(1-4)隐藏
+    if (columnIndex >= 1 && columnIndex <= 4) {
+      return { rowspan: 0, colspan: 0 };
+    }
+  }
+
+  // 普通行:必须返回对象格式
+  return { rowspan: 1, colspan: 1 };
+}
+
+function handleGenerateReport() {
+    if (!formData.value.recordDate) {
+        message.msgWarning("请选择日期")
+        return
+    }
+    
+    if (!formData.value.type) {
+        message.msgWarning("请选择类型")
+        return
+    }
+  // 生成报表
+  apis.coopBatchDayStatisticsApi.genReportFun(formData.value).then(() => {
+    
+    message.msgSuccess("生成成功")
+  })
+}
+
+// 将函数暴露给模板使用
+defineExpose({
+  formatDate,
+  //headerCellStyle,
+  cellStyle,
+  spanMethod
+})
+</script>
+<template>
+   <div class="app-container py-5">
+      <div
+			class="w-100 d-flex flex-column align-items-center mx-auto"
+			:style="{ maxWidth: 1500 + 'px' }">
+        <div class="header d-flex justify-content-center align-items-center mb-10">
+            <el-form :model="formData" label-width="auto" :inline="true" style="margin-left: 20px">
+               <el-form-item label="育种/祖代场" prop="type">
+                   <el-radio-group v-model="formData.type">
+                       <el-radio label="0">育种场</el-radio>
+                       <el-radio label="1">祖代场</el-radio>
+                   </el-radio-group>
+               </el-form-item>
+               <el-form-item label="日期" prop="recordDate">
+                   <el-date-picker
+                       v-model="formData.recordDate"
+                       type="date"
+                       placeholder="请选择日期"
+                       value-format="YYYY-MM-DD"
+                       format="YYYY-MM-DD"
+                       style="width: 220px;">
+                   </el-date-picker>
+               </el-form-item>
+               <el-form-item>
+                   <el-button type="primary" @click="handleSearch">查询</el-button>
+                   <el-button type="success" @click="handleGenerateReport">生成日报表</el-button>
+                   <el-button type="warning" @click="handleExport">导出</el-button>
+               </el-form-item>           
+           </el-form>
+        </div>  
+        
+      </div>
+      
+      <!-- 批次选择模态框 -->
+    <div class="report-header">
+      <div class="header-content">
+        <h2 class="title">广明生物弥勒公司{{formData.type == "0" ? "育种场" : "祖代场"}}日报表</h2>
+        <div class="date-info">
+          <span class="date-label">日期:</span>
+          <span class="date-value">{{ formData.recordDate }}</span>
+        </div>
+      </div>
+    </div>
+	 
+	 <!-- 使用 Element Plus 的 el-table 替换原生表格 -->
+	 <div class="table-container">
+	   <el-table 
+         :ref="tableRef"
+	     :data="reportDataItems" 
+	     border 
+         :summary-method="getSummaries"
+         show-summary
+         :span-method="spanMethod"
+	     :style="{ width: '100%' }" 
+	     :height="600"
+	     :header-cell-style="{ backgroundColor: '#e6f0ff', color: '#2c5aa0', fontWeight: 600, textAlign: 'center', border: '1px solid #d0d7e0' } "
+	     :cell-style="{ border: '1px solid #d0d7e0', textAlign: 'center' }"
+	     highlight-current-row>
+         <el-table-column prop="coopName" label="鸡舍"  width="100" >
+	     </el-table-column>
+          <el-table-column prop="lineage" label="品种"  width="80" >
+	     </el-table-column>
+          <el-table-column prop="batchNum" label="批次"  width="80" >
+	     </el-table-column>
+	   
+	     
+	     <!-- 周龄分组 -->
+	     <el-table-column label="周龄"    :colspan="2">
+	       <el-table-column prop="dayCount" label="天" width="60" ></el-table-column>
+	       <el-table-column prop="weekAge" label="生长周龄" width="80" ></el-table-column> 
+	     </el-table-column>
+	     
+	     <!-- 存栏鸡数分组 -->
+	     <el-table-column label="存栏鸡数"  :colspan="4">
+	       <el-table-column prop="chicken1Count" label="母鸡" width="80" ></el-table-column>
+	       <el-table-column prop="chicken0Count" label="公鸡" width="80" ></el-table-column>
+	       <el-table-column prop="chicken2Count" label="未知" width="80" ></el-table-column>
+	       <el-table-column prop="chickenCountTotal" label="合计" width="80" ></el-table-column>
+	     </el-table-column>
+	     
+	     <!-- 公母比例(%) - 固定列 -->
+	     <el-table-column prop="maleFemaleRatio" label="公母比例(%)"  width="80" ></el-table-column>
+	     
+	     <!-- 母鸡死淘分组 -->
+	     <el-table-column label="母鸡死淘" :colspan="2">
+	       <el-table-column label="母鸡死淘数量" :colspan="2">
+	         <el-table-column prop="death1" label="死亡" width="80"></el-table-column>
+	         <el-table-column prop="cull1" label="淘汰" width="80"></el-table-column>
+	       </el-table-column>
+	     </el-table-column>
+	     
+	     <!-- 公鸡死淘分组 -->
+	     <el-table-column label="公鸡死淘" :colspan="2">
+	       <el-table-column label="公鸡死淘数量" :colspan="2">
+	         <el-table-column prop="death0" label="死亡" width="80"></el-table-column>
+	         <el-table-column prop="cull0" label="淘汰" width="80"></el-table-column>
+	       </el-table-column>
+	     </el-table-column>
+	     
+	     <!-- 未知鸡死淘分组 -->
+	     <el-table-column label="未知鸡死淘" :colspan="2">
+	       <el-table-column label="未知死淘数量" :colspan="2">
+	         <el-table-column prop="death2" label="死亡" width="80"></el-table-column>
+	         <el-table-column prop="cull2" label="淘汰" width="80"></el-table-column>
+	       </el-table-column>
+	     </el-table-column>
+	     
+	     <!-- 耗料分组 -->
+	     <el-table-column label="耗料" :colspan="3">
+	      
+	       <el-table-column label="耗料量/只/日(g)" :colspan="3">
+	         <el-table-column prop="poultDailyFeedAvg1" label="母鸡" width="80"></el-table-column>
+	         <el-table-column prop="poultDailyFeedAvg0" label="公鸡" width="80"></el-table-column>
+	         <el-table-column prop="poultDailyFeedAvg2" label="未知" width="80"></el-table-column>
+	       </el-table-column>
+	     </el-table-column>
+	      
+	     <!-- 产蛋情况分组 -->
+	     <el-table-column label="产蛋情况" :colspan="15">
+	       <el-table-column prop="totalEggs" label="总产蛋数" width="100"></el-table-column>
+	       <el-table-column prop="eggCount0" label="上缴种蛋" width="100"></el-table-column>
+	       <el-table-column label="商品蛋" :colspan="6">
+	         <el-table-column prop="eggCount1" label="纯系种蛋" width="100"></el-table-column>
+	         <el-table-column prop="eggCount2" label="祖代蛋" width="100"></el-table-column>
+	         <el-table-column prop="eggCount3" label="父母代蛋" width="100"></el-table-column>
+	         <el-table-column prop="eggCount4" label="菜蛋" width="100"></el-table-column>
+	         <el-table-column prop="eggCount5" label="畸形蛋" width="100"></el-table-column>
+	         <el-table-column prop="eggCount6" label="破蛋" width="100"></el-table-column>
+	       </el-table-column>
+	       <el-table-column prop="eggWeight" label="蛋重(g)" width="100"></el-table-column>
+           <el-table-column prop="accumEggCount" label="只累计产蛋数" width="100"></el-table-column>
+           <el-table-column prop="accumEggQualifiedCount" label="只累计产合格蛋蛋数" width="100"></el-table-column>
+           <el-table-column prop="eggProductionRate" label="产蛋率(%)" width="100"></el-table-column>
+           <el-table-column prop="eggQualifiedRate" label="合格蛋率(%)" width="100"></el-table-column>
+           <el-table-column prop="eggDeformedRate" label="畸形蛋率(%)" width="100"></el-table-column>
+           <el-table-column prop="eggBreakRate" label="破蛋率(%)" width="100"></el-table-column>
+	     </el-table-column>
+	   </el-table>
+	 </div>
+	</div>
+     
+</template>
+<style scoped>
+	.table-container {
+	  overflow-x: auto;
+	  scrollbar-width: thin;
+	  scrollbar-color: #a0cfff #f1f1f1;
+	  border-radius: 8px;
+	  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
+	  margin: 20px 0;
+	  -webkit-overflow-scrolling: touch; /* iOS平台平滑滚动 */
+	  scroll-behavior: smooth; /* 平滑滚动效果 */
+	}
+	
+	.table-container::-webkit-scrollbar {
+	  height: 8px;
+	  -webkit-appearance: none; /* Safari兼容性 */
+	}
+	
+	.table-container::-webkit-scrollbar-track {
+	  background: #f1f1f1;
+	  border-radius: 4px;
+	  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1); /* 添加内阴影增强视觉效果 */
+	}
+	
+	.table-container::-webkit-scrollbar-thumb {
+	  background: #a0cfff;
+	  border-radius: 4px;
+	  border: 2px solid #f1f1f1; /* 添加边框使滚动条更清晰 */
+	  transition: background 0.3s ease; /* 添加过渡效果 */
+	}
+	
+	.table-container::-webkit-scrollbar-thumb:hover {
+	  background: #7fbaff;
+	  cursor: pointer;
+	}
+	
+	.table {
+	  min-width: 100%;
+	  border-collapse: separate;
+	  border-spacing: 0;
+	  width: 100%;
+	  border-radius: 8px;
+	  overflow: hidden;
+	  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
+	}
+	
+	.table th,
+	.table td {
+	  padding: 12px 15px;
+	  text-align: center;
+	  white-space: nowrap;
+	  border-right: 1px solid #d0d7e0;
+	  border-bottom: 1px solid #d0d7e0;
+	}
+	
+	.table th {
+	  background-color: #e6f0ff;
+	  color: #2c5aa0;
+	  font-weight: 600;
+	  text-transform: uppercase;
+	  letter-spacing: 0.5px;
+	  font-size: 13px;
+	  /* 垂直居中对齐 */
+	  vertical-align: middle;
+	}
+	
+	.table td {
+	  /* 垂直居中对齐 */
+	  vertical-align: middle;
+	}
+	
+	.table th:last-child,
+	.table td:last-child {
+	  border-right: none;
+	}
+	
+	/* 斑马纹样式 */
+	.table tbody tr:nth-child(even) {
+	  background-color: #fafcff;
+	}
+	
+	/* 悬停效果 */
+	.table tbody tr:hover {
+	  background-color: #f0f7ff;
+	  transition: background-color 0.2s ease;
+	}
+	
+	/* 表头第一行特殊样式 */
+	.table thead tr:first-child th {
+	  background-color: #d1e4ff;
+	}
+	
+	/* 数字列右对齐 */
+	.table td:nth-child(n+10) {
+	  text-align: right;
+	}
+	/* 育种场信息表格样式 */
+	.farm-info-container {
+	  margin: 10px auto;
+	  border-radius: 8px;
+	  overflow: hidden;
+	  max-width: 1200px;
+	  width: 100%;
+     
+	}
+	
+	.farm-info-table {
+	  width: 100%;
+	  border-collapse: separate;
+	  border-spacing: 0;
+	  background-color: #ffffff;
+	  font-size: 13px;
+      border:1px solid #d0d7e0;
+	}
+	
+	.farm-info-table td {
+	  padding: 6px 10px;
+	  text-align: center;
+	  border-right: 1px solid #d0d7e0;
+	  border-bottom: 1px solid #d0d7e0;
+	  vertical-align: middle;
+	}
+	
+	.farm-info-table td:last-child {
+	  border-right: none;
+	}
+	
+	.farm-info-table tr:last-child td {
+	  border-bottom: none;
+	}
+	
+	/* 合并单元格的背景色 */
+	.farm-info-table td[rowspan],
+	.farm-info-table td[colspan] {
+	  background-color: #fafdff;
+	  font-weight: 500;
+	}
+	
+	/* 数据单元格的样式 */
+	.farm-info-table td:not([rowspan]):not([colspan]) {
+	  background-color: #ffffff;
+	  text-align: center;
+	}
+	
+	/* 需要从后端获取数据的列样式(实际第3、5、7、9列) */
+	 
+	/* 第1行 */
+	.important-cell {
+	  background-color: #fffefe !important;
+	  font-weight: 600;
+	  color: #3d4144 !important;
+	  border-radius: 4px;
+	  padding: 4px 8px;
+	}
+	
+	/* 报表头部样式 */
+	.report-header {
+	  text-align: center;
+	  padding: 20px 0;
+	  background: linear-gradient(135deg, #e6f0ff 0%, #ffffff 100%);
+	  border-radius: 8px;
+	  margin-bottom: 20px;
+	  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
+	  border: 1px solid #d0d7e0;
+	}
+	
+	.header-content {
+	  display: flex;
+	  flex-direction: column;
+	  align-items: center;
+	  justify-content: center;
+	}
+	
+	.title {
+	  font-size: 24px;
+	  font-weight: 600;
+	  color: #2c5aa0;
+	  margin: 0 0 10px 0;
+	  text-align: center;
+	  font-family: 'Microsoft YaHei', Arial, sans-serif;
+	}
+	
+	.date-info {
+	  display: flex;
+	  align-items: center;
+	  justify-content: center;
+	  font-size: 16px;
+	  color: #555;
+	  margin-top: 5px;
+	}
+	
+	.date-label {
+	  font-weight: 500;
+	  margin-right: 5px;
+	  color: #333;
+	}
+	
+	.date-value {
+	  font-weight: 400;
+	  color: #2c5aa0;
+	  font-family: 'Consolas', 'Courier New', monospace;
+	}
+</style>
+ 
+ 

+ 385 - 192
UI/VB.VUE/src/views/report/coopBatchDay/index.vue

@@ -2,18 +2,375 @@
 import dayjs from "dayjs"
 import apis from "@/api/breeding"  
 import { message } from "@/core/utils/message"
- 
-const tableRef = ref()
- 
+import type{Header} from "@/components/table/models"
+
+const headers = ref<Header[]>([
+	{
+		field: "coopName",
+		name: "鸡舍",
+		visible: true,
+		isSort: false,
+		tooltip: true,
+		width: "auto",
+	},
+	{
+		field: "lineage",
+		name: "品种",
+		visible: true,
+		isSort: false,
+		tooltip: true,
+		width: "60px",
+		 
+	},
+	{
+		field: "batchNum",
+		name: "批次",
+		visible: true,
+		isSort: false,
+		tooltip: true,
+		width: "100px", 
+	},
+	{
+		field: "周龄",
+		name: "周龄",
+		visible: true,
+		isSort: false,
+		width: "150px",
+		children: [
+			{
+				field: "dayCount",
+				name: "天",
+				visible: true,
+				isSort: false,
+				width: "30px",
+				tooltip: true
+			},
+			{
+				field: "weekAge",
+				name: "生长周龄",
+				visible: true,
+				isSort: false,
+				width: "110px",
+				tooltip: true
+			}
+		]
+	},
+	{
+		 field: "存栏鸡数",
+		 name: "存栏鸡数",
+		 visible: true,
+		 isSort: false,
+		 tooltip: true,
+		 width: "250px",
+		 children: [
+			 {
+				 field: "chicken1Count",
+				 name: "母鸡",
+				 visible: true,
+				 isSort: false,
+				 width: "60px",
+				 tooltip: true
+			 },
+			 {
+				 field: "chicken0Count",
+				 name: "公鸡",
+				 visible: true,
+				 isSort: false,
+				 width: "100px",
+				 tooltip: true
+			},
+			 {
+				 field: "chicken2Count",
+				 name: "未知",
+				 visible: true,
+				 isSort: false,
+				 width: "100px",
+				 tooltip: true
+			},
+			 {
+				 field: "chickenCountTotal",
+				 name: "合计",
+				 visible: true,
+				 isSort: false,
+				 width: "100px",
+				 tooltip: true
+			}
+		 ]
+	},
+	{
+		 field: "maleFemaleRatio",
+		 name: "公母比例(%)",
+		 visible: true,
+		 isSort: false,
+		 width: "80px",
+		 tooltip: true
+	},
+	{
+		field: "母鸡死淘",
+		name: `母鸡死淘`,
+		width: "150px",
+		children: [
+			{
+				field: "母鸡死淘数量",
+				name: "母鸡死淘数量",
+				visible: true,
+				isSort: false,
+				width: "150px",
+				tooltip: true,
+				children: [
+					{
+						field: "death1",
+						name: "死亡",
+						visible: true,
+						isSort: false,
+						width: "80px",
+					},
+					{
+						field: "cull1",
+						name: "淘汰",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					} 
+				]
+			}
+		]
+	},
+	{
+		field: "公鸡死淘",
+		name: `公鸡死淘`,
+		width: "150px",
+		children: [
+			{
+				field: "公鸡死淘数量",
+				name: "公鸡死淘数量",	
+				visible: true,
+				isSort: false,
+				width: "500px",
+				tooltip: true,
+				children: [
+					{
+						field: "death0",
+						name: "死亡",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "cull0",
+						name: "淘汰",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					} 
+				]
+			}
+		]
+	},
+	{
+		field: "未知死淘",
+		name: `未知死淘`,
+		width: "150px",
+		children: [
+			{
+				field: "未知死淘数量",
+				name: "未知死淘数量",
+				visible: true,
+				isSort: false,
+				width: "500px",
+				tooltip: true,
+				children: [
+					{
+						field: "death2",
+						name: "死亡",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "cull2",
+						name: "淘汰",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					} 
+				]
+			}
+		]
+	},
+	{
+		field: "耗料",
+		name: "耗料",
+		visible: true,
+		isSort: false,
+		width: "200px",
+		children: [
+			{
+				field: "耗料量/只/日(g)",
+				name: "耗料量/只/日(g)",
+				visible: true,
+				isSort: false,
+				width: "250px",
+				children: [
+					{
+						field: "poultDailyFeed1",
+						name: "母鸡",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "poultDailyFeed0",
+						name: "公鸡",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "poultDailyFeed2",
+						name: "未知",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					} 
+				]
+			},
+		]
+	},
+	{
+		field: "产蛋情况",
+		name: "产蛋情况",
+		visible: true,
+		isSort: false,
+		width: "1200px",
+		children: [
+			{
+				field: "totalEggs",
+				name: "总产蛋数",
+				visible: true,
+				isSort: false,
+				width: "100px",
+			},
+			{
+				field: "eggCount0",
+				name: "上缴种蛋",
+				visible: true,
+				isSort: false,
+				width: "100px",
+			},
+			{
+				field: "商品蛋",
+				name: "商品蛋",
+				visible: true,
+				isSort: false,
+				width: "100px",
+				children: [
+					{
+						field: "eggCount1",
+						name: "纯系种蛋",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "eggCount2",
+						name: "祖代蛋",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "eggCount3",
+						name: "父母代蛋",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "eggCount4",
+						name: "菜蛋",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "eggCount5",
+						name: "畸形蛋",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					},
+					{
+						field: "eggCount6",
+						name: "破蛋",
+						visible: true,
+						isSort: false,
+						width: "100px",
+					}
+				]
+			},
+			{
+				field: "eggWeight",
+				name: "蛋重(g)",
+				visible: true,
+				isSort: false,
+				width: "100px",
+			},
+			{
+				field: "accumEggCount",
+				name: "只累计产蛋",
+				visible: true,
+				isSort: false,
+				width: "100px",
+			},
+			{
+				field: "accumEggQualifiedCount",
+				name: "只累计合格蛋",
+				visible: true,
+				isSort: false,
+				width: "100px",
+			},
+			{
+				field: "eggProductionRate",
+				name: "产蛋率(%)",
+				visible: true,
+				isSort: false,
+				width: "100px",
+			},
+			{
+				field: "eggQualifiedRate",
+				name: "蛋合格率(%)",
+				visible: true,
+				isSort: false,
+				width: "100px",
+			},
+			{
+				field: "eggDeformedRate",
+				name: "蛋畸形率(%)",
+				visible: true,
+				isSort: false,
+				width: "100px",
+			},
+			{
+				field: "eggBreakRate",
+				name: "蛋破率(%)",
+				visible: true,
+				isSort: false,
+				width: "100px",
+			}
+		]
+	}
+]);
 const formData = ref({
     type: "0",
-    recordDate: dayjs().format('YYYY-MM-DD'),
+    recordDate: dayjs('2025-12-12').format('YYYY-MM-DD'),
     params: {}
 })
  
- 
+ onMounted(() => {
+    handleSearch()
+ })
 const reportDataItems = ref([])
-const reportDataTotal = ref<any>({}) 
 // 查询处理函数
 function handleSearch() {
     // 校验日期和类型是否已填写
@@ -32,15 +389,12 @@ function handleSearch() {
         endRecordDate: formData.value.recordDate + ' 23:59:59'
     }
     
-    
     apis.coopBatchDayStatisticsApi.listQuery(formData.value).then((res: any) => {
-        console.log(res)
         const { items, total } = res.data
-        reportDataItems.value = items
-        reportDataTotal.value = total
+		reportDataItems.value = items as any[]
+		reportDataItems.value.push({ ...total,coopName: "合计"})
+        //reportDataTotal.value = total
     })
-    // 这里可以添加实际的查询逻辑
-    // 例如调用API获取数据等
 }
 
  
@@ -79,88 +433,7 @@ const formatDate = (row, column, cellValue) => {
 
  
 
-// 单元格样式
-const cellStyle = ({ row, column, rowIndex, columnIndex }) => {
-  // 日期列居中对齐
-  if (columnIndex === 0) {  // 日期列
-    return { textAlign: 'center' }
-  }
-  // 数字列右对齐
-  if (columnIndex >= 3) {  // 从第4列开始右对齐
-    return { textAlign: 'right' }
-  }
-  return { textAlign: 'center' }
-}
 
-function getSummaries({ columns, data }) {
-  const sums = []
-  columns.forEach((column, index) => {
-    if (index === 0) {
-      sums[index] = '合并'
-      return
-    }
-    // 对于前5列(1-4),由于被第0列跨列覆盖,不需要设置值
-    if (index >= 1 && index < 5) {
-      sums[index] = ''
-      return
-    }
-    // 根据列索引设置对应的合计值
-    switch(index) {
-      case 5: sums[index] = reportDataTotal.value.chicken1Count || 0; break;  // 母鸡列
-      case 6: sums[index] = reportDataTotal.value.chicken0Count || 0; break;  // 公鸡列
-      case 7: sums[index] = reportDataTotal.value.chicken2Count || 0; break;  // 未知列
-      case 8: sums[index] = reportDataTotal.value.totalChickenCount || 0; break;  // 合计列
-      case 9: sums[index] = reportDataTotal.value.maleFemaleRatio || '-'; break;  // 公母比例列
-      case 10: sums[index] = reportDataTotal.value.death1 || 0; break;  // 母鸡死亡
-      case 11: sums[index] = reportDataTotal.value.cull1 || 0; break;   // 母鸡淘汰
-      case 12: sums[index] = reportDataTotal.value.death0 || 0; break;  // 公鸡死亡
-      case 13: sums[index] = reportDataTotal.value.cull0 || 0; break;   // 公鸡淘汰
-      case 14: sums[index] = reportDataTotal.value.death2 || 0; break;  // 未知死亡
-      case 15: sums[index] = reportDataTotal.value.cull2 || 0; break;   // 未知淘汰
-      case 16: sums[index] = reportDataTotal.value.poultDailyFeedAvg1 || 0; break;  // 母鸡耗料
-      case 17: sums[index] = reportDataTotal.value.poultDailyFeedAvg0 || 0; break;  // 公鸡耗料
-      case 18: sums[index] = reportDataTotal.value.poultDailyFeedAvg2 || 0; break;  // 未知耗料
-      case 19: sums[index] = reportDataTotal.value.totalEggs || 0; break;  // 总产蛋数
-      case 20: sums[index] = reportDataTotal.value.eggCount0 || 0; break;  // 上缴种蛋
-      case 21: sums[index] = reportDataTotal.value.eggCount1 || 0; break;  // 纯系种蛋
-      case 22: sums[index] = reportDataTotal.value.eggCount2 || 0; break;  // 祖代蛋
-      case 23: sums[index] = reportDataTotal.value.eggCount3 || 0; break;  // 父母代蛋
-      case 24: sums[index] = reportDataTotal.value.eggCount4 || 0; break;  // 菜蛋
-      case 25: sums[index] = reportDataTotal.value.eggCount5 || 0; break;  // 畸形蛋
-      case 26: sums[index] = reportDataTotal.value.eggCount6 || 0; break;  // 破蛋
-      case 27: sums[index] = reportDataTotal.value.eggWeight || 0; break;  // 蛋重
-      case 28: sums[index] = reportDataTotal.value.accumEggCount || 0; break;  // 累计产蛋数
-      case 29: sums[index] = reportDataTotal.value.accumEggQualifiedCount || 0; break;  // 累计合格蛋数
-      case 30: sums[index] = reportDataTotal.value.eggProductionRate || '-'; break;  // 产蛋率
-      case 31: sums[index] = reportDataTotal.value.eggQualifiedRate || '-'; break;  // 合格蛋率
-      case 32: sums[index] = reportDataTotal.value.eggDeformedRate || '-'; break;  // 畸形蛋率
-      case 33: sums[index] = reportDataTotal.value.eggBreakRate || '-'; break;  // 破蛋率
-      default: sums[index] = ''; break;
-    }
-  })
-  return sums
-}
-
-// 合并单元格方法
-// 修复后的合并单元格方法
-function spanMethod({ row, rowIndex, columnIndex }: any) {
-  // 精准判断:合计行的 row 为 undefined 且 rowIndex === -1(Element Plus 标准标识)
-  const isSummaryRow = row === undefined && rowIndex === -1;
-
-  if (isSummaryRow) {
-    // 合计行:前5列合并为1列
-    if (columnIndex === 0) {
-      return { rowspan: 1, colspan: 5 }; // 合并前5列
-    }
-    // 被合并的列(1-4)隐藏
-    if (columnIndex >= 1 && columnIndex <= 4) {
-      return { rowspan: 0, colspan: 0 };
-    }
-  }
-
-  // 普通行:必须返回对象格式
-  return { rowspan: 1, colspan: 1 };
-}
 
 function handleGenerateReport() {
     if (!formData.value.recordDate) {
@@ -179,13 +452,7 @@ function handleGenerateReport() {
   })
 }
 
-// 将函数暴露给模板使用
-defineExpose({
-  formatDate,
-  //headerCellStyle,
-  cellStyle,
-  spanMethod
-})
+
 </script>
 <template>
    <div class="app-container py-5">
@@ -233,98 +500,24 @@ defineExpose({
 	 
 	 <!-- 使用 Element Plus 的 el-table 替换原生表格 -->
 	 <div class="table-container">
-	   <el-table 
-         :ref="tableRef"
-	     :data="reportDataItems" 
-	     border 
-         :summary-method="getSummaries"
-         show-summary
-         :span-method="spanMethod"
-	     :style="{ width: '100%' }" 
-	     :height="600"
-	     :header-cell-style="{ backgroundColor: '#e6f0ff', color: '#2c5aa0', fontWeight: 600, textAlign: 'center', border: '1px solid #d0d7e0' } "
-	     :cell-style="{ border: '1px solid #d0d7e0', textAlign: 'center' }"
-	     highlight-current-row>
-         <el-table-column prop="coopName" label="鸡舍"  width="100" >
-	     </el-table-column>
-          <el-table-column prop="lineage" label="品种"  width="80" >
-	     </el-table-column>
-          <el-table-column prop="batchNum" label="批次"  width="80" >
-	     </el-table-column>
-	   
-	     
-	     <!-- 周龄分组 -->
-	     <el-table-column label="周龄"    :colspan="2">
-	       <el-table-column prop="dayCount" label="天" width="60" ></el-table-column>
-	       <el-table-column prop="weekAge" label="生长周龄" width="80" ></el-table-column> 
-	     </el-table-column>
-	     
-	     <!-- 存栏鸡数分组 -->
-	     <el-table-column label="存栏鸡数"  :colspan="4">
-	       <el-table-column prop="chicken1Count" label="母鸡" width="80" ></el-table-column>
-	       <el-table-column prop="chicken0Count" label="公鸡" width="80" ></el-table-column>
-	       <el-table-column prop="chicken2Count" label="未知" width="80" ></el-table-column>
-	       <el-table-column prop="chickenCountTotal" label="合计" width="80" ></el-table-column>
-	     </el-table-column>
-	     
-	     <!-- 公母比例(%) - 固定列 -->
-	     <el-table-column prop="maleFemaleRatio" label="公母比例(%)"  width="80" ></el-table-column>
-	     
-	     <!-- 母鸡死淘分组 -->
-	     <el-table-column label="母鸡死淘" :colspan="2">
-	       <el-table-column label="母鸡死淘数量" :colspan="2">
-	         <el-table-column prop="death1" label="死亡" width="80"></el-table-column>
-	         <el-table-column prop="cull1" label="淘汰" width="80"></el-table-column>
-	       </el-table-column>
-	     </el-table-column>
-	     
-	     <!-- 公鸡死淘分组 -->
-	     <el-table-column label="公鸡死淘" :colspan="2">
-	       <el-table-column label="公鸡死淘数量" :colspan="2">
-	         <el-table-column prop="death0" label="死亡" width="80"></el-table-column>
-	         <el-table-column prop="cull0" label="淘汰" width="80"></el-table-column>
-	       </el-table-column>
-	     </el-table-column>
-	     
-	     <!-- 未知鸡死淘分组 -->
-	     <el-table-column label="未知鸡死淘" :colspan="2">
-	       <el-table-column label="未知死淘数量" :colspan="2">
-	         <el-table-column prop="death2" label="死亡" width="80"></el-table-column>
-	         <el-table-column prop="cull2" label="淘汰" width="80"></el-table-column>
-	       </el-table-column>
-	     </el-table-column>
-	     
-	     <!-- 耗料分组 -->
-	     <el-table-column label="耗料" :colspan="3">
-	      
-	       <el-table-column label="耗料量/只/日(g)" :colspan="3">
-	         <el-table-column prop="poultDailyFeedAvg1" label="母鸡" width="80"></el-table-column>
-	         <el-table-column prop="poultDailyFeedAvg0" label="公鸡" width="80"></el-table-column>
-	         <el-table-column prop="poultDailyFeedAvg2" label="未知" width="80"></el-table-column>
-	       </el-table-column>
-	     </el-table-column>
-	      
-	     <!-- 产蛋情况分组 -->
-	     <el-table-column label="产蛋情况" :colspan="15">
-	       <el-table-column prop="totalEggs" label="总产蛋数" width="100"></el-table-column>
-	       <el-table-column prop="eggCount0" label="上缴种蛋" width="100"></el-table-column>
-	       <el-table-column label="商品蛋" :colspan="6">
-	         <el-table-column prop="eggCount1" label="纯系种蛋" width="100"></el-table-column>
-	         <el-table-column prop="eggCount2" label="祖代蛋" width="100"></el-table-column>
-	         <el-table-column prop="eggCount3" label="父母代蛋" width="100"></el-table-column>
-	         <el-table-column prop="eggCount4" label="菜蛋" width="100"></el-table-column>
-	         <el-table-column prop="eggCount5" label="畸形蛋" width="100"></el-table-column>
-	         <el-table-column prop="eggCount6" label="破蛋" width="100"></el-table-column>
-	       </el-table-column>
-	       <el-table-column prop="eggWeight" label="蛋重(g)" width="100"></el-table-column>
-           <el-table-column prop="accumEggCount" label="只累计产蛋数" width="100"></el-table-column>
-           <el-table-column prop="accumEggQualifiedCount" label="只累计产合格蛋蛋数" width="100"></el-table-column>
-           <el-table-column prop="eggProductionRate" label="产蛋率(%)" width="100"></el-table-column>
-           <el-table-column prop="eggQualifiedRate" label="合格蛋率(%)" width="100"></el-table-column>
-           <el-table-column prop="eggDeformedRate" label="畸形蛋率(%)" width="100"></el-table-column>
-           <el-table-column prop="eggBreakRate" label="破蛋率(%)" width="100"></el-table-column>
-	     </el-table-column>
-	   </el-table>
+		<vb-data-table
+				:columns="headers"
+				:data="reportDataItems"
+				ref="tableRef"
+				keyField="id"
+				:no-page="true"
+				:fixed-number="9"
+				:scroll="{ x: 2600 }"
+				:check-multiple="false"
+				:show-toolbar="false">
+				<template #recordDate="{ row }">
+					{{ dayjs(row.recordDate).format("YYYY-MM-DD") }}
+				</template>
+			<template #poultDailyFeedTotal="{ row }">
+				{{ (row.poultDailyFeed0 || 0) + (row.poultDailyFeed1 || 0) + (row.poultDailyFeed2 || 0) }}
+			</template>
+        </vb-data-table>
+	  
 	 </div>
 	</div>