Kaynağa Gözat

Merge branch 'master' of http://47.100.37.243:10191/quyueting/manHourHousekeeper

QuYueTing 2 hafta önce
ebeveyn
işleme
18bbdf551b

+ 7 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/FactoryController.java

@@ -33,6 +33,13 @@ public class FactoryController {
        msg.setCode("ok");
        return msg;
     }
+    @RequestMapping("/getFactoriesList")
+    public HttpRespMsg getFactoriesList(){
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.setData(factoryService.list());
+        msg.setCode("ok");
+        return msg;
+    }
 
     @RequestMapping("/updateFactory")
     public HttpRespMsg updateMeal(Factory factory){

+ 9 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/MealApplicationsController.java

@@ -63,6 +63,10 @@ public class MealApplicationsController {
         if (first.isPresent()){
             return msg.fail("已申报过");
         }
+        Optional<MealApplications> second = list.stream().filter(mealApplications -> mealApplications.getStatus()==1).findFirst();
+        if (second.isPresent()){
+            return msg.fail("已核销过");
+        }
         MealTypes mealCategory = mealTypeService.getById(mealType);
 
         try {
@@ -136,10 +140,13 @@ public class MealApplicationsController {
         QueryWrapper<MealApplications> eq = new QueryWrapper<MealApplications>().eq("user_id", request.getHeader("token")).eq("meal_type_id", mealType).eq("factory_id", factory)
                 .eq("application_date", now.toLocalDate()).orderByDesc("applied_at").last("limit 1");
         MealApplications mealApplications = mealApplicationsService.getOne(eq);
-        mealApplications.setDeadlineTime(mealTypes.getDeadlineTime());
         if(mealApplications==null){
-            return msg.fail("二维码不存在");
+            msg.setData(mealTypes.getDeadlineTime());
+            msg.setCode("ok");
+            return msg;
         }
+        mealApplications.setDeadlineTime(mealTypes.getDeadlineTime());
+
         msg.setData(mealApplications);
         return msg;
     }

+ 16 - 3
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/MealTypesController.java

@@ -2,6 +2,7 @@ package com.management.platform.controller;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.management.platform.entity.MealApplications;
 import com.management.platform.entity.MealTypes;
 import com.management.platform.mapper.MealApplicationsMapper;
 import com.management.platform.mapper.MealTypesMapper;
@@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 import java.time.LocalDateTime;
+import java.util.List;
 
 /**
  * <p>
@@ -32,8 +34,8 @@ public class MealTypesController {
     @Resource
     private MealTypesMapper mealTypesMapper;
 
-    @Resource
-    private MealApplicationsMapper mealApplicationsMapper;
+   @Resource
+   private MealApplicationsService mealApplicationsService;
 
     @RequestMapping("/getMeals")
     public HttpRespMsg getMeals(){
@@ -42,6 +44,13 @@ public class MealTypesController {
         msg.setCode("ok");
         return msg;
     }
+    @RequestMapping("/getMealsList")
+    public HttpRespMsg getMealsList(){
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.setData(mealTypesService.list());
+        msg.setCode("ok");
+        return msg;
+    }
     @RequestMapping("/updateMeal")
     public HttpRespMsg updateMeal(MealTypes mealTypes){
         HttpRespMsg msg = new HttpRespMsg();
@@ -58,6 +67,10 @@ public class MealTypesController {
     @RequestMapping("/deleteMealType")
     public HttpRespMsg deleteMealType(Integer id){
         HttpRespMsg msg = new HttpRespMsg();
+        List<MealApplications> list = mealApplicationsService.list(new QueryWrapper<MealApplications>().eq("meal_type_id", id).eq("status", 0));
+        if(!list.isEmpty()){
+            return msg.fail("该餐别已有报餐数据,不可删除");
+        }
         boolean delete = mealTypesService.removeById(id);
         if(delete){
             msg.setCode("ok");
@@ -85,7 +98,7 @@ public class MealTypesController {
     }
 
     @RequestMapping("/getMealTypeList")
-    private HttpRespMsg getMealTypeList() {
+    public HttpRespMsg getMealTypeList() {
         return mealTypesService.getMealTypeList();
     }
 

+ 5 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ReportController.java

@@ -1662,5 +1662,10 @@ public class ReportController {
     public HttpRespMsg deleteDuplicateData(Integer companyId, String createDate){
         return reportService.deleteDuplicateData(companyId, createDate);
     }
+
+    @RequestMapping("/exportMealStatistic")
+    public HttpRespMsg exportMealStatistic(String deptIds,String userId,String startDate,String endDate){
+        return reportService.exportMealStatistic(deptIds,userId,startDate,endDate);
+    }
 }
 

+ 2 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/ReportService.java

@@ -168,4 +168,6 @@ public interface ReportService extends IService<Report> {
     HttpRespMsg updateHasDeleteTeamData();
 
     HttpRespMsg deleteDuplicateData(Integer companyId, String createDate);
+
+    HttpRespMsg exportMealStatistic(String deptIds,String userId,String startDate,String endDate);
 }

+ 87 - 16
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/MealApplicationsServiceImpl.java

@@ -1,5 +1,6 @@
 package com.management.platform.service.impl;
 
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -221,6 +222,9 @@ public class MealApplicationsServiceImpl extends ServiceImpl<MealApplicationsMap
         queryWrapper.orderByAsc("department_id");
         IPage<User> userIPage = userMapper.selectPage(new Page<>(pageIndex, pageSize), queryWrapper);
         List<User> userList = userIPage.getRecords();
+        if(userList.isEmpty()){
+            userList = new ArrayList<>();
+        }
 
         //先将数据全部取出来,再根据人员和部门进行筛选
         List<Map<String,Object>>  mealList = mealApplicationsMapper.getMealList(companyId,startDate,endDate,deptIdList,userId,mealTypeIdString);
@@ -233,6 +237,26 @@ public class MealApplicationsServiceImpl extends ServiceImpl<MealApplicationsMap
                 mealMap.put("date",sdf.format(date));
             }
 
+
+
+            Integer status = (Integer)  mealMap.get("status");
+            if (status != null) {
+                switch (status) {
+                    case 0 :
+                        mealMap.put("statusString","已报餐");
+                    case  3:
+                        mealMap.put("statusString","缺餐");
+                        break;
+                    case 1:
+                        mealMap.put("statusString","已就餐");
+                        break;
+                    case 2:
+                    default:
+                        mealMap.put("statusString","未报餐");
+                        break;
+                }
+            }
+
         }
 
         //
@@ -250,6 +274,7 @@ public class MealApplicationsServiceImpl extends ServiceImpl<MealApplicationsMap
                     switch (status) {
                         case 0 :
                             ApplyAmount += 1;
+                            overLine += 1;
                             break;
                         case 1:
                             ApplyAmount += 1;
@@ -259,7 +284,7 @@ public class MealApplicationsServiceImpl extends ServiceImpl<MealApplicationsMap
                             cancel += 1;
                         case  3:
                             ApplyAmount += 1;
-                            cancel += 1;
+                            overLine += 1;
                             break;
                         default:
                             break;
@@ -278,32 +303,23 @@ public class MealApplicationsServiceImpl extends ServiceImpl<MealApplicationsMap
 
         mealList.addAll(totalList);
 
-
-        List<Map<String,Object>> records= new ArrayList<>();
-        if(!StringUtils.isEmpty(deptIds)){
-            String[] split = deptIds.split(",");
-            for (String deptId : split) {
-                List<Integer> branchDepartment = getBranchDepartment(Integer.valueOf(deptId), departmentList);
-                deptIdList.addAll(branchDepartment);
-            }
-        }
         User count = new User();//小计一栏
         count.setId("0");
         userList.add(count);
-
+        List<Map<String,Object>> records = new ArrayList<>();
         for(User itemUser:userList){
             Map<String,Object> map=new HashMap<>();
             String personId = itemUser.getId();
             map.put("userId",itemUser.getId());
             map.put("name",itemUser.getName());
             if (map.get("userId").equals("0")) {
-                map.put("name","小计");
+                map.put("departmentName","小计");
             }
             map.put("departmentId",itemUser.getDepartmentId());
-            String departmentName="未设置部门";
-
-            Integer departmentId = Integer.valueOf(String.valueOf(map.get("departmentId")));
-            map.put("departmentName", getBranchDepartment(departmentId, departmentList));
+            if(map.get("departmentId")!=null){
+                Integer departmentId = Integer.valueOf(String.valueOf(map.get("departmentId")));
+                map.put("departmentName", convertDepartmentIdToCascade(departmentId, departmentList));
+            }
 
             List<Map<String,Object>> personList = new ArrayList<>();
             if (personId!= null){
@@ -311,6 +327,37 @@ public class MealApplicationsServiceImpl extends ServiceImpl<MealApplicationsMap
             }
             map.put("personList",personList);
 
+            if(map.get("userId")!= null && !map.get("userId").equals("0")){
+                //非小计合计
+                //已申请
+                map.put("totalApplication",personList.stream().filter(p ->
+                        new Integer(0).equals(p.get("status"))).count());
+                //已用餐
+                map.put("totalGetMeal",personList.stream().filter(p ->
+                        new Integer(1).equals(p.get("status"))).count());
+                //已过期
+                map.put("totalOverLine",personList.stream().filter(p ->
+                        new Integer(3).equals(p.get("status"))).count());
+            }
+            else if (map.get("userId")!= null && map.get("userId").equals("0")){
+                //小计合计
+                //已报餐人数
+                map.put("totalApplication",personList.stream()
+                        .filter(p -> p.get("applyAmount")!=null)
+                        .map(person -> person.get("applyAmount"))
+                        .reduce(0,(a,b) -> (Integer)a + (Integer) b));
+                //已取餐
+                map.put("totalGetMeal",personList.stream()
+                        .filter(p -> p.get("getMeal")!=null)
+                        .map(person -> person.get("getMeal"))
+                        .reduce(0,(a,b) -> (Integer)a + (Integer) b));
+                //已过期
+                map.put("totalOverLine",personList.stream()
+                        .filter(p -> p.get("overLine")!=null)
+                        .map(person -> person.get("overLine"))
+                        .reduce(0,(a,b) -> (Integer)a + (Integer) b));
+            }
+
             records.add(map);
         }
         resultMap.put("total",userIPage.getTotal());
@@ -343,4 +390,28 @@ public class MealApplicationsServiceImpl extends ServiceImpl<MealApplicationsMap
         }
         return list;
     }
+
+    //将部门id转换为部门层级
+    private String convertDepartmentIdToCascade(Integer id, List<Department> allDeptList) {
+        StringBuilder cascade = new StringBuilder();
+        Integer finalId = id;
+        Optional<Department> first = allDeptList.stream().filter(al -> finalId != null && finalId.equals(al.getDepartmentId())).findFirst();
+        if (!first.isPresent()) {
+            cascade.append("未设置部门");
+        } else {
+            cascade.append(first.get().getDepartmentName());
+            id = findById(id, allDeptList).getSuperiorId();
+            while (id != null) {
+                Integer finalId1 = id;
+                Optional<Department> first1 = allDeptList.stream().filter(al -> finalId1 != null && finalId1.equals(al.getDepartmentId())).findFirst();
+                cascade.append("/").append(first1.get().getDepartmentName());
+                id = findById(id, allDeptList).getSuperiorId();
+            }
+        }
+        return cascade.toString();
+    }
+
+    private Department findById(int id, List<Department> allList) {
+        return allList.stream().filter(all->all.getDepartmentId().intValue() == id).findFirst().get();
+    }
 }

+ 144 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -146,6 +146,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 
     //同一个人的重复提交时间,不得超过1秒
     public static volatile HashMap<String, Long>  userSubmitTime = new HashMap();
+    @Autowired
+    private MealApplicationsService mealApplicationsService;
 
     @Synchronized
     @Override
@@ -6419,4 +6421,146 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         }
         return msg;
     }
+
+    @Override
+    public HttpRespMsg exportMealStatistic(String deptIds, String userId, String startDate, String endDate) {
+        HttpRespMsg msg=new HttpRespMsg();
+        DateTimeFormatter dtf=DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
+
+        String token = request.getHeader("TOKEN");
+        User user = userMapper.selectById(token);
+        Integer companyId = user.getCompanyId();
+
+
+        if(!StringUtils.isEmpty(userId)){
+            queryWrapper.eq("id",userId);
+        }
+
+        List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", user.getCompanyId()));
+        List<Integer> deptIdList=new ArrayList<>();
+        if(deptIds!=null&&!StringUtils.isEmpty(deptIds)){
+            String[] split = deptIds.split(",");
+            for (String deptId : split) {
+                List<Integer> branchDepartment = getBranchDepartment(Integer.valueOf(deptId), departmentList);
+                deptIdList.addAll(branchDepartment);
+            }
+            queryWrapper.in("department_id",deptIdList);
+        }
+        List<User> userList= userMapper.selectList(queryWrapper);
+        List<String> userIdList = new ArrayList<>();
+        for(User u:userList){
+            if(u.getId()!= null){
+                userIdList.add(u.getId());
+            }
+        }
+        System.out.println("-----------------------------" + userIdList.toString());
+
+        //防止为空
+        userIdList.add("0");
+
+        List<MealApplications> resultList = mealApplicationsService.getBaseMapper().selectList(new QueryWrapper<MealApplications>()
+                .ge("application_date",LocalDate.parse(startDate,dtf))
+                .le("application_date",LocalDate.parse(endDate,dtf))
+                .ne("status",2)
+                .in("user_id",userIdList));
+        /*
+        * 测试用
+        * */
+        for (MealApplications mealApplications:resultList) {
+            mealApplications.setQrCode(userMapper.selectById(mealApplications.getUserId()).getName());
+            System.out.println(mealApplications.toString());
+        }
+
+        List<List<String>> dataList=new ArrayList<>();
+        List<String> titleList=new ArrayList<>();
+        titleList.add("");
+        titleList.add("工位名称");
+        titleList.add("报餐人");
+        titleList.add("是否报餐");
+        titleList.add("已取餐");
+        titleList.add("未取餐");
+        titleList.add("日期");
+        dataList.add(titleList);
+
+        for (MealApplications map : resultList) {
+            if(dataList.stream().noneMatch(item-> item.get(0).equals(map.getUserId()) && item.get(6).equals(map.getApplicationDate().toString())))
+            {
+                List<String> itemMap=new ArrayList<>();
+                String itemUserId = map.getUserId();
+                if(itemUserId!=null){
+                    itemMap.add(map.getUserId());
+                }
+                else {
+                    itemUserId = "0";
+                    itemMap.add("");
+                }
+                User itemUser = userMapper.selectById(itemUserId);
+
+                itemMap.add(convertDepartmentIdToCascade(itemUser.getDepartmentId(), departmentList));
+                itemMap.add(itemUser.getName());
+                itemMap.add("0");//是否报餐
+                itemMap.add("0");//已取餐
+                itemMap.add("0");//未取餐
+                itemMap.add(map.getApplicationDate().toString());
+                switch (map.getStatus()){
+                    case 0:
+                        itemMap.set(3,"1");
+                        break;
+                    case 1:
+                        itemMap.set(4,"1");
+                        itemMap.set(3,"1");
+                        break;
+                    case 3:
+                        itemMap.set(5,"1");
+                        itemMap.set(3,"1");
+                        break;
+                    case 2:
+                    default:
+                        break;
+                }
+                System.out.println(itemMap);
+                dataList.add(itemMap);
+            }
+            else {
+                for(List<String> i :dataList ){
+                    if (i.get(0)!= null && i.get(0).equals(map.getUserId()) && i.get(6)!=null && i.get(6).equals(map.getApplicationDate().toString()) ) {
+
+                        Integer aInt = 0;
+                        switch (map.getStatus()){
+                            case 0:
+                                aInt = Integer.parseInt(i.get(3)) + 1;
+                                i.set(3,aInt.toString());
+                                break;
+                            case 1:
+                                aInt = Integer.parseInt(i.get(4)) + 1;
+                                i.set(4,aInt.toString());
+                                aInt = Integer.parseInt(i.get(3)) + 1;
+                                i.set(3,aInt.toString());
+                                break;
+                            case 3:
+                                aInt = Integer.parseInt(i.get(5)) + 1;
+                                i.set(5,aInt.toString());
+                                aInt = Integer.parseInt(i.get(3)) + 1;
+                                i.set(3,aInt.toString());
+                                break;
+                            case 2:
+                            default:
+                                break;
+                        }
+
+                        System.out.println(i);
+                    }
+                }
+            }
+        }
+        for(List<String> item:dataList){
+            item.remove(0);
+        }
+        Company company = companyMapper.selectById(companyId);
+        String fileName=("报餐数据表_")+company.getCompanyName()+System.currentTimeMillis();
+        String resp = ExcelUtil.exportGeneralExcelByTitleAndList(fileName, dataList, path);
+        msg.setData(resp);
+        return msg;
+    }
 }

+ 1 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/MealApplicationsMapper.xml

@@ -37,7 +37,7 @@
 
             <if test="list!=null and list.size()>0">
                 and u.department_id in
-                <foreach collection="list" close=")" open="(" separator=",">
+                <foreach item="item" collection="list" close=")" open="(" separator=",">
                     #{item}
                 </foreach>
             </if>

+ 18 - 5
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/meal/mealApplication.vue

@@ -111,9 +111,9 @@
   },
   mounted() {
     // 初始化加载二维码
-    this.loadQrCode();
     this.listFactory();
     this.listMeal();
+    this.loadQrCode();
   },
   methods: {
     // 餐别切换
@@ -151,8 +151,10 @@
           if (this.factories.length > 0) {
             this.factory = this.factories[0].id;
           }
+          this.loadQrCode();
         } else {
           this.factory = 1;
+          this.loadQrCode();
         }
       }).catch(err => {
         console.error('获取厂区列表失败:', err);
@@ -173,9 +175,11 @@
           if (this.meals.length > 0) {
             this.mealType = this.meals[0].id;
           }
+          this.loadQrCode();
         } else {
           this.mealType = 1;
         }
+        this.loadQrCode();
       }).catch(err => {
         console.error('获取餐别列表失败:', err);
         this.$toast.fail('获取餐别列表失败');
@@ -189,15 +193,24 @@
         factory: this.factory
       }).then(res => {
         if (res.code === 'ok' && res.data) {
-          this.qrcodeUrl = res.data.qrCode || '';
-          this.qrStatus = res.data.status;
-          this.deadlineTime = res.data.deadlineTime;
+
+          if (typeof res.data === 'string') {
+            //当mealApplications为 null时,直接返回deadlineTime字符串
+            this.deadlineTime = res.data;
+            this.qrcodeUrl = '';
+          } else {
+            this.qrcodeUrl = res.data.qrCode || '';
+            this.qrStatus = res.data.status;
+            this.deadlineTime = res.data.deadlineTime || '';
+          }
         } else {
           this.qrcodeUrl = '';
+          this.deadlineTime = '';
         }
       }).catch(err => {
         console.error('获取二维码失败:', err);
         this.qrcodeUrl = '';
+        this.deadlineTime = '';
         this.$toast.fail('获取二维码失败');
       });
     },
@@ -241,7 +254,7 @@
           this.$toast.success('取消成功');
           this.showCancelDialog = false;
         } else {
-          this.$toast.fail(res.msg || '取消失败');
+          this.$toast.fail(res.msg || '二维码已取消不能重复取消');
         }
         this.loadQrCode();
       }).catch(err => {

+ 6 - 6
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/settings/factorySetting.vue

@@ -8,9 +8,9 @@
     </el-col>
 
     <div style="padding: 20px;">
-      <div style="margin-bottom: 20px;">
-        <el-button type="primary" @click="handleAdd">新增厂区</el-button>
-      </div>
+<!--      <div style="margin-bottom: 20px;">-->
+<!--        <el-button type="primary" @click="handleAdd">新增厂区</el-button>-->
+<!--      </div>-->
 
       <el-table :data="tableData" border style="width: 100%;">
         <el-table-column  type="index" label="序号" width="80" align="center"></el-table-column>
@@ -24,8 +24,8 @@
         </el-table-column>
         <el-table-column label="操作" width="250" align="center">
           <template slot-scope="scope">
-            <el-button size="mini" @click="handleEdit(scope.row)">修改</el-button>
-            <el-button size="mini" type="danger" @click="handleDelete(scope.row)">删除</el-button>
+<!--            <el-button size="mini" @click="handleEdit(scope.row)">修改</el-button>-->
+<!--            <el-button size="mini" type="danger" @click="handleDelete(scope.row)">删除</el-button>-->
             <el-button
                 size="mini"
                 :type="scope.row.isActive === 1 ? 'warning' : 'success'"
@@ -88,7 +88,7 @@
   methods: {
     // 获取数据
     fetchData() {
-      this.http.post('/factory/getFactories', {},
+      this.http.post('/factory/getFactoriesList', {},
           res => {
             if (res.code == "ok") {
               this.tableData = res.data;

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/settings/mealTypeSetting.vue

@@ -101,7 +101,7 @@
   methods: {
     // 获取数据
     fetchData() {
-      this.http.post('/meal-types/getMeals', {},
+      this.http.post('/meal-types/getMealsList', {},
         res => {
           if (res.code == "ok") {
             this.tableData = res.data;

+ 50 - 22
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/statistic/index.vue

@@ -64,7 +64,7 @@
             </span>
           </template>
           <!-- 选择餐别 -->
-          <el-select v-if="ins == 7" v-model="mealTypeId" :placeholder="'请选择餐别'" @change="selcts()" clearable size="small" style="width:100px;margin-left:10px">
+          <el-select v-if="ins == 7" v-model="mealTypeId" :clearable="false" :placeholder="'请选择餐别'" @change="selcts()" style="width:100px;margin-left:10px">
             <el-option 
               v-for="(meal, index) in mealTypeList" 
               :key="index" 
@@ -306,34 +306,39 @@
             <el-table v-if="ins == 7"  :key="8" border :data="mealApplicationList" highlight-current-row v-loading="listLoading" :height="+tableHeight - 1" style="width: 100%;">
                 <el-table-column align="center" prop="departmentCascade" label="部门名称" min-width="150" fixed="left">
                   <template slot-scope="scope">
-                    {{scope.row.departmentCascade}}
+                    {{scope.row.departmentName}}
                   </template>
                 </el-table-column>
                 <el-table-column align="center" prop="name" label="人员" min-width="100" fixed="left"></el-table-column>
-                <el-table-column v-for="(item, index) in personWorkHoursWagesHead" :key="index" :label="item" align="center" min-width="150">
+                <el-table-column v-for="(item, index) in personMealHead" :key="index" :label="item" align="center" min-width="150">
                     <template slot-scope="scope">
-                        <div v-for="(items, indexs) in scope.row.personWorkHoursWages" :key="indexs" :class="`${scope.row.departmentCascade== '小计' ? '' : 'colorText'}`">
-                            <div v-if="items.crateDate == item" @click.stop="showReportDetail(scope.row,item,0)">
-                              <div  style="color: black;" v-if="items.planWorkTime">平均 {{items.planWorkTime}}分钟  {{items.planCost}}元</div>
-                              <!-- <div @click.stop="showReportDetail(scope.row,item,0)" v-if="items.workTime>0">已填 {{items.workTime}}分钟  {{items.cost}}元 </div>{{items.leave}}
-                              <div style="color: green;" @click.stop="showTempReportDetail(scope.row,item,0)" v-if="items.tempWorkTime>0||items.tempCost>0">临时报工 {{items.tempWorkTime}}分钟  {{items.tempCost}}元</div> -->
-                              <div  v-if="items.workTime>0">已填 {{items.workTime}}分钟  {{items.cost}}元 </div>{{items.leave}}
-                              <div style="color: green;" v-if="items.tempWorkTime>0||items.tempCost>0">临时报工 {{items.tempWorkTime}}分钟  {{items.tempCost}}元</div>
-                              <div style="color: red;" v-if="items.surplusTime">剩余 {{items.surplusTime}}分钟  {{items.surplusCost}}元</div>
+                        <div v-for="(items, indexs) in scope.row.personList" :key="indexs" >
+                            <div v-if="items.date == item">
+                                <div v-if = "items.userId !== '0' " :style="textColorStyle(items.status)">
+                                  {{items.statusString || '暂无状态' }}
+                                </div>
+                                
+                                <div v-if = "items.userId === '0' && items.applyAmount > 0" >
+                                  <div style = "color:blue ; ">
+                                    报餐人数:{{items.applyAmount}}
+                                  </div>
+                                  <div style = "color:green ; ">
+                                    就餐人数:{{items.getMeal}}
+                                  </div>
+                                  <div style = "color:red ; ">
+                                    缺餐人数:{{items.overLine}}
+                                  </div>
+
+                                </div>
                             </div>
                         </div>
                     </template>
                 </el-table-column>
                 <el-table-column align="center" prop="totalResult" label="合计" min-width="180">
                    <template slot-scope="scope" >
-                    <div @click="showReportDetail(scope.row,item,1)">
-                      <div style="color: black;">{{scope.row.totalPlanResult | formatStr('平均') }}</div>
-                      <!-- <div style="color: #02a7f0;"  @click="showReportDetail(scope.row,item,1)"> {{scope.row.totalResult | formatStr('已填')}}</div> 
-                      <div style="color: green;"  @click="showTempReportDetail(scope.row,item,1)">{{scope.row.totalTempResult | formatStr('临时报工')}}</div>  -->
-                      <div style="color: #02a7f0;" > {{scope.row.totalResult | formatStr('已填')}}</div> 
-                      <div style="color: green;" >{{scope.row.totalTempResult | formatStr('临时报工')}}</div> 
-                      <div style="color: red;">{{scope.row.totalSurplusResult | formatStr('剩余') }}</div>
-                    </div>
+                      <div style="color: #0000ff;" > 报餐次数:{{scope.row.totalApplication}}</div> 
+                      <div style="color: green;"> 就餐次数:{{scope.row.totalGetMeal }}</div>
+                      <div style="color: red;" > 缺餐次数:{{scope.row.totalOverLine}}</div> 
                   </template>
                 </el-table-column>
             </el-table>
@@ -734,6 +739,7 @@ export default {
       { name: '饿哇噶', id: 1 },
       { name: '第三方', id: 2}
       ],
+      personMealHead:[],
 
       //筛选项
       productId:"",
@@ -751,7 +757,20 @@ export default {
       exportTargetUserId:null,
     };
   },
-  computed: {},
+  computed: {
+    textColorStyle() {
+        return (status) => {
+            const colorMap = {
+                0: { color: 'blue' },
+                1: { color: 'green' },
+                2: { color: '#ff0000' },
+                3: { color: 'red' },
+            };
+            return colorMap[status] || { color: '#333333' }; // 默认颜色
+        };
+    },
+
+  },
   watch: {},
   created() {
     let height = window.innerHeight;
@@ -1361,12 +1380,13 @@ export default {
           userId:this.userId,
           mealTypeId:this.mealTypeId,
       }
-      console.log(param)
       
       this.http.post( "/meal-applications/getMealApplicationList",param,
         res => {
           if (res.code == "ok") {
-            console.log(res.data)
+            this.mealApplicationList = res.data.records
+            this.personMealHead = res.data.header
+            this.total=res.data.total
             
           } else {
             this.$message({
@@ -1628,6 +1648,14 @@ export default {
           url += "/exportPlanDataWithUserId";
           sl.userId=this.exportTargetUserId
         }
+    }
+    else if (this.ins == 7) {
+        fName = '就餐数据表_' + '.xlsx';
+        sl.startDate=this.rangeDatas[0];
+        sl.endDate=this.rangeDatas[1];
+        url += "/exportMealStatistic";
+        sl.deptIds=deptArr.join(',');
+        sl.userId=this.userId;
     }
         this.http.post(url, sl,
         res => {