فهرست منبع

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper

wutt 5 سال پیش
والد
کامیت
ac04b6f751
14فایلهای تغییر یافته به همراه585 افزوده شده و 488 حذف شده
  1. 8 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserController.java
  2. 2 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Report.java
  3. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ReportMapper.java
  4. 2 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/UserService.java
  5. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  6. 7 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ScreenshotServiceImpl.java
  7. 10 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java
  8. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ScreenshotMapper.xml
  9. 12 107
      fhKeeper/formulahousekeeper/timesheet/src/port.js
  10. 36 6
      fhKeeper/formulahousekeeper/timesheet/src/views/desktop/index.vue
  11. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/system/index.vue
  12. 117 86
      fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue
  13. 386 282
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue
  14. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/statistics.vue

+ 8 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserController.java

@@ -41,5 +41,13 @@ public class UserController {
     public HttpRespMsg loginEmployee(@RequestParam String username, @RequestParam String password) {
         return userService.loginEmployee(username, password);
     }
+
+    /**
+     * 获取员工的列表
+     */
+    @RequestMapping("/getEmployeeList")
+    public HttpRespMsg getEmployeeList() {
+        return userService.getEmployeeList();
+    }
 }
 

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Report.java

@@ -1,5 +1,6 @@
 package com.management.platform.entity;
 
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import java.time.LocalDate;
@@ -59,7 +60,7 @@ public class Report extends Model<Report> {
     /**
      * 报告内容
      */
-    @TableField("content")
+    @TableField(value = "content", updateStrategy = FieldStrategy.IGNORED)
     private String content;
 
     /**

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ReportMapper.java

@@ -17,6 +17,6 @@ import java.util.Map;
  * @since 2019-12-31
  */
 public interface ReportMapper extends BaseMapper<Report> {
-    List<Map<String, Object>> getReportByDate(@Param("date")String date, @Param("id")Integer id);
+    List<Map<String, Object>> getReportByDate(@Param("date")String date, @Param("id")String id);
     List<Map<String, Object>> getReportNameByDate(@Param("date")String date);
 }

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

@@ -16,4 +16,6 @@ public interface UserService extends IService<User> {
     HttpRespMsg loginAdmin(String username, String password);
 
     HttpRespMsg loginEmployee(String username, String password);
+
+    HttpRespMsg getEmployeeList();
 }

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -39,7 +39,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         List<Map<String, Object>> nameList = reportMapper.getReportNameByDate(date);
         for (Map<String, Object> map : nameList) {
-            map.put("data", reportMapper.getReportByDate(date, (Integer) map.get("id")));
+            map.put("data", reportMapper.getReportByDate(date, (String) map.get("id")));
         }
         httpRespMsg.data = nameList;
         return httpRespMsg;

+ 7 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ScreenshotServiceImpl.java

@@ -22,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
 import javax.annotation.Resources;
+import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.HashSet;
@@ -59,7 +60,12 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
     @Override
     public HttpRespMsg getLatestScreenshotList() {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
-        httpRespMsg.data = screenshotMapper.getLatestScreenshotList();
+        List<Map<String, Object>> resultMap = screenshotMapper.getLatestScreenshotList();
+        for(Map<String, Object> map : resultMap){
+            map.put("time", new SimpleDateFormat("HH:mm:ss").format(map.get("indate")));
+            map.remove("indate");
+        }
+        httpRespMsg.data = resultMap;
         return httpRespMsg;
     }
 

+ 10 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -78,4 +78,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         }
         return httpRespMsg;
     }
+
+    /**
+     * 获取员工的列表
+     */
+    @Override
+    public HttpRespMsg getEmployeeList() {
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        httpRespMsg.data = userMapper.selectList(new QueryWrapper<User>().eq("role", 0));
+        return httpRespMsg;
+    }
 }

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ScreenshotMapper.xml

@@ -22,7 +22,7 @@
 
     <!--获取每个人最新的桌面截图-->
     <select id="getLatestScreenshotList" resultType="java.util.Map">
-        SELECT c.name, a.pic_url, a.indate
+        SELECT c.name, a.pic_url, a.indate, a.pic_type
         FROM screenshot AS a
         JOIN(
         SELECT uid, MAX(indate) AS max_indate

+ 12 - 107
fhKeeper/formulahousekeeper/timesheet/src/port.js

@@ -1,118 +1,23 @@
 export default {
     manage: {
         login: '/user/loginAdmin', // 登录
+        list: '/user/getEmployeeList', //获取员工列表
     },
-    //消息提示相关
-    notice: {
-        list: '/vnoticeuser/list',  // 消息列表
-        read: '/vnoticeuser/read'  // 消息读取
-    },
-    pwd: {
-        resetPwd: '/user/updatePassword' // 重置密码
-    },
-    map: { 
-        mapList: '/company/getCoutomCompanyAndMouldsByUser', // 生产方公司和公司下所属的模具
-        newMap: '/mould/listMap' // 获取地图
-    },
-    project: {
-        addUser: '/user/add',  // 添加或修改用户
-        userList: '/user/list',  // 用户列表
-        delUser: '/user/delete',  // 删除用户
-
-        addProject: '/project/add', // 添加或修改项目
-        projectList: '/project/list', // 项目列表
-        projectDetail: '/project/detail', // 项目详情
-        projects: '/project/projectList', // 筛选模具列表时作为筛选条件所加载的项目列表
-        projectByUser: '/project/getProjectListByUserAndCompany',// 获取创建人员分配项目时根据当前人和公司获取项目列表
-
-        uploadFile: '/projectfile/uploadFile', //项目文档的上传
-        dowloadFile: '/projectfile/dowloadFile', //项目文档的下载
-        fileList: '/projectfile/list', //项目文档列表
-        delFile: '/projectfile/delFile', //项目文档的删除
-        operList: '/projectoperationdynamics/list', //项目操作记录列表
 
-        getUserList: '/user/getUserList', //获取用户列表
-        getUserById: '/user/getUserListByCompanyIds', // 给项目分配参与人的时候根据公司id获取公司下的人员
-
-        inviteUser: '/invitationrecord/inviteUser', //添加邀请记录并产生链接
-
-        powerList: '/power/list', // 权限列表
-        powerUpdate: '/power/update', //修改权限
+    //桌面
+    desktop: {
+        list: '/screenshot/getLatestScreenshotList', //获取当前每个人最新的桌面截图
     },
-    //模具
-    mold: {
-        addMold: '/mould/addOrUpdate', //添加/修改模具设备
-        molds: '/mould/list', //模具列表
-        modelList: '/mould/modelList', //给项目分配模具获取该公司下的模具列表
-        delMold: '/mould/delMould', //删除模具
-
-        moldDetail: '/mould/detail', //模具详情
-        moldFileList: '/mouldfile/list', //获取模具文档
-        moldFileListAll: '/mouldfile/allList', //获取全部模具文档
-        moldFileUpload: '/mouldfile/uploadFile', //上传模具文档
-        moldFileDowload: '/mouldfile/dowloadFile', //模具文档的下载
-        moldFileDowloadList: '/mouldfile/fileList', //获取模具文档下载列表
-
-        moldFileDowloadFile: '/mouldfile/downloadfileList', //批量下载
-        moldFileCheck: '/mouldfile/check', //审批模具文档 
-        exportOperationExcel: '/mouldfile/downloadFileListExcel', //下载操作记录
-
-        chooseModelList: '/mould/chooseModelList', //编辑项目时显示的模具列表
-
-        moldFileDelete: '/mouldfile/delFile', //项目文档的删除
-        moldOperationList: '/mouldoperationdynamics/list', //项目操作记录列表
 
-        partList: '/part/list', //零件列表
-        addPart: '/part/addOrUpdate', //单个零件添加
-        importPart: '/part/importAppLogin',//零件的excel导入
-        partUpload: '/mouldfile/uploadPartFileList', //零件文档的批量上传
-
-        download: '/mouldfile/download',
-
-        moldMaintain: '/mouldmaintain/maintain', //维护
-        moldMaintainList: '/mouldmaintain/list', //获取列表
-        moldMaintainListGet: '/mould/maintainMouldList', //主页获取保养模具列表
-        moldDiscardListGet: '/mould/scrapMouldList', //主页获取报废模具列表
-        moldChange: '/mould/changeMouldEquipment', //处理告警
-        moldChangeRequirement: '/mouldequipment/getEquipmentListByOldMouldAndUser' //处理告警所需的设备
+    //项目
+    project: {
+        list: '/project/getProjectList', //获取项目列表
+        delete: '/project/deleteProject', //删除项目
+        add: '/project/editProject', //新增项目
     },
-    //基础管理
-    base: {
-        addCompany: '/company/add', // 添加资产方
-        companyList: '/company/list', // 资产方列表
-        delCompany: '/company/delete', // 删除资产方
-
-        getCompanyList: '/company/getCompanyList', // 管理员创建人员时显示公司
-        
-        getCompanys: '/company/getCompanys', // 云模盒所属公司
-
-        addCompanyListToProject: '/company/addCompanyListToProject', // 编辑项目时获取生产方公司
-
-        relationList: '/company/relationList', // 获取关联公司列表
 
-        //ownerComps: '/company/ownerRelateCompany', // 返回当前公司的关联公司列表
-
-        getProduceCompany: '/company/getProduceCompany', // 根据项目id获取生产方列表
-        
-        getInfo: '/company/getProduceCompanyByCurrentUser', // 根据当前人登录人所能看到的公司进行筛选
-
-        addFactory: '/factory/add',  // 添加生产方
-        factoryList: '/factory/list',   // 生产方列表
-        delFactory: '/factory/delete',  // 删除生产方
-
-        editMould: '/mouldequipment/addOrUpdate', // 添加 / 修改云模盒
-        mouldeList: '/mouldequipment/getEquipmentList', // 云模盒列表
-        enableMould: '/mouldequipment/use', // 启用云模盒
-
-        moulds: '/mouldequipment/getMouldEquipmentList', // 创建模具时获取资产方的云模盒列表
-        importMouldEquipmentExcel: '/mouldequipment/importMouldEquipmentExcel', //批量导入云模盒
-        
-        setPacket: '/mouldequipment/use',// 云平台下行配置数据包接口
-        openingAndClosingTimesChart: '/mouldhistory/openingAndClosingTimesChart', //获取云模盒的每日开合次数图表 (时间/次数)
-        openingAndClosingTimesChartCycle: '/mouldhistory/openingAndClosingTimesChartCycle', //获取云模盒的每日开合次数周期 (时间/次数)
-
-    },
-    file: {
-        view: '/pdffile/getPdfFile' // 文件预览
+    //日报
+    report: {
+        list: '/report/getReportList',  //获取报告列表
     }
 }

+ 36 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/desktop/index.vue

@@ -10,19 +10,26 @@
 
         <!-- 卡片列表 -->
         <div>
-            <el-col :span="6" v-for="(item, index) in 12" :key="item" class="one_div">
+            <el-col :span="6" v-for="(item, index) in desktopList" :key="index" class="one_div">
                 <el-card :body-style="{ padding: '0px' }" shadow="hover" class="one_card">
                     <div class="one_card_img">
-                        <el-image :src="index==0?require('../../assets/image/047_S.jpg'):require('../../assets/image/noPic.png')" class="image" lazy></el-image>
+                        <el-image :src="this.pic_url" class="image" lazy>
+                            <div slot="error" class="image-slot">
+                                <el-image :src="require('../../assets/image/noPic.png')" class="image" lazy></el-image>
+                            </div>
+                        </el-image>
                         <div :id="'over'+index" class="over">
                             <el-button type="primary" plain @click.native="jumpTo(item)"><i class="fa fa-link"></i> 所有截图</el-button>
                         </div>
                     </div>
                     <div class="one_card_txt">
-                        <span>在玩游戏呢!!!!!</span>
+                        <!-- pic_type 这里需要一个巨长的三目运算符 -->
+                        <!-- 0-编程,1-查资料,2-看文档,3-做设计,4-美工,5-运营,6-看小说,7-打游戏,8-听音乐 -->
+                        <!-- 现在基本都是null -->
+                        <span>{{item.pic_type}}</span>
                         <div class="bottom clearfix">
-                            <el-link><i class="fa fa-circle"></i> 吴涛涛</el-link>
-                            <time class="time">9点59分59秒</time>
+                            <el-link><i class="fa fa-circle"></i> {{item.name}}</el-link>
+                            <time class="time">{{item.time}}</time>
                         </div>
                     </div>
                 </el-card>
@@ -42,6 +49,7 @@
                 user: JSON.parse(sessionStorage.getItem('user')),
                 timer: "",
                 currentTime: util.formatDate.format(new Date(new Date()), 'yyyy-MM-dd hh:mm:ss'),
+                desktopList: [],
 			}
 		},
 		methods: {
@@ -51,6 +59,27 @@
                     _this.currentTime = util.formatDate.format(new Date(new Date()), 'yyyy-MM-dd hh:mm:ss');
                 }, 1000);
             },
+            //获取项目列表
+			      getDesktopList() {
+				        this.listLoading = true;
+				        this.http.post(this.port.desktop.list, {}, res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        this.desktopList = res.data;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
             jumpTo(id) {
                 this.$router.push('/desktop/' + id);
             }
@@ -58,7 +87,8 @@
         created() {
             this.getTime();
         },
-		mounted() {
+		    mounted() {
+            this.getDesktopList();
         },
         beforeDestroy() {
             if (this.timer) {

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/system/index.vue

@@ -181,7 +181,7 @@
             };
         },
 		mounted() {
-            this.getList();
+            // this.getList();
 		}
 	}
 

+ 117 - 86
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -1,100 +1,131 @@
 <template>
-	<section>
-        <!--工具条-->
-		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
-			<el-form :inline="true">
-				<el-form-item style="float:right;">
-                    <el-link type="primary" :underline="false">添加人员</el-link>
-				</el-form-item>
-                <el-form-item style="float:right;">
-                    <el-link type="primary" :underline="false">批量导入</el-link>
-				</el-form-item>
-			</el-form>
-		</el-col>
+  <section>
+    <!--工具条-->
+    <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
+      <el-form :inline="true">
+        <el-form-item style="float:right;">
+          <el-link type="primary" :underline="false">添加人员</el-link>
+        </el-form-item>
+        <el-form-item style="float:right;">
+          <el-link type="primary" :underline="false">批量导入</el-link>
+        </el-form-item>
+      </el-form>
+    </el-col>
 
-        <!--列表-->
-		<el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
-			<el-table-column type="index" width="60"></el-table-column>
-            <el-table-column prop="name" label="姓名" sortable></el-table-column>
-            <el-table-column prop="behavior" label="手机"></el-table-column>
-			<el-table-column label="操作">
-                <template slot-scope="scope">
-                    <el-button size="small" type="danger" @click="handleDel(scope.row)">删除</el-button>
-                </template>
-            </el-table-column>
-		</el-table>
+    <!--列表-->
+    <el-table
+      :data="list"
+      highlight-current-row
+      v-loading="listLoading"
+      :height="tableHeight"
+      style="width: 100%;"
+    >
+      <el-table-column type="index" width="60"></el-table-column>
+      <el-table-column prop="name" label="姓名" sortable></el-table-column>
+      <el-table-column prop="phone" label="手机"></el-table-column>
+      <el-table-column label="操作">
+        <template slot-scope="scope">
+          <el-button size="small" type="danger" @click="deleteUser(scope.$index)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
 
-		<!--工具条-->
-		<el-col :span="24" class="toolbar">
-			<el-pagination
-                @size-change="handleSizeChange"
-                @current-change="handleCurrentChange"
-                :page-sizes="[20 , 50 , 80 , 100]"
-                :page-size="20"
-                layout="total, sizes, prev, pager, next"
-                :total="total"
-                style="float:right;">
-            </el-pagination>
-		</el-col>
-    </section> 
+    <!--工具条-->
+    <el-col :span="24" class="toolbar">
+      <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :page-sizes="[20 , 50 , 80 , 100]"
+        :page-size="20"
+        layout="total, sizes, prev, pager, next"
+        :total="total"
+        style="float:right;"
+      ></el-pagination>
+    </el-col>
+  </section>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-                user: JSON.parse(sessionStorage.getItem('user')),
+export default {
+  data() {
+    return {
+      user: JSON.parse(sessionStorage.getItem("user")),
 
-                tableHeight: 0,
-                listLoading: false,
-                total: 0,
-                page: 1,
-                size: 20,
-                list:[
-                    {name:'张三',behavior:'上班打游戏',indate:'2019-12-14'},
-                    {name:'张三',behavior:'上班打游戏',indate:'2019-12-14'},
-                    {name:'张三',behavior:'上班打游戏',indate:'2019-12-14'},
-                    {name:'张三',behavior:'上班打游戏',indate:'2019-12-14'},
-                    {name:'张三',behavior:'上班打游戏',indate:'2019-12-14'},
-                    {name:'张三',behavior:'上班打游戏',indate:'2019-12-14'},
-                    {name:'张三',behavior:'上班打游戏',indate:'2019-12-14'},
-                ]
-			}
-		},
-		methods: {
-            //分页
-			handleCurrentChange(val) {
-				this.page = val;
-				// this.getProject();
-            },
+      tableHeight: 0,
+      listLoading: false,
+      total: 0,
+      page: 1,
+      size: 20,
+      list: []
+    };
+  },
+  methods: {
+    //分页
+    handleCurrentChange(val) {
+      this.page = val;
+      // this.getUser();
+    },
 
-            handleSizeChange(val) {
-                this.size = val;
-				// this.getProject();
-            },
-        },
-        created() {
-            let height = window.innerHeight;
-            this.tableHeight = height - 195;
-            const that = this;
-            window.onresize = function temp() {
-                that.tableHeight = window.innerHeight - 195;    
-            };
+    handleSizeChange(val) {
+      this.size = val;
+      // this.getUser();
+    },
+
+    //获取所有员工的列表
+    getUser() {
+      this.listLoading = true;
+      this.http.post(
+        this.port.manage.list,
+        {},
+        res => {
+          this.listLoading = false;
+          if (res.code == "ok") {
+            this.list = res.data;
+          } else {
+            this.$message({
+              message: res.msg,
+              type: "error"
+            });
+          }
         },
-        mounted() {
+        error => {
+          this.listLoading = false;
+          this.$message({
+            message: error,
+            type: "error"
+          });
         }
-	}
+      );
+    },
+
+    //删除员工
+    deleteUser(index) {
+      alert("这个功能还没做呢");
+    }
+  },
+  created() {
+    let height = window.innerHeight;
+    this.tableHeight = height - 195;
+    const that = this;
+    window.onresize = function temp() {
+      that.tableHeight = window.innerHeight - 195;
+    };
+  },
+  mounted() {
+    this.getUser();
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-    .nowTime {
-        height: 35px;
-        line-height: 28px;
-        font-size: 18px;
-        color: #333;
-        margin-left: 10px;
-        i {
-            margin-right: 10px;
-        }
-    }
+.nowTime {
+  height: 35px;
+  line-height: 28px;
+  font-size: 18px;
+  color: #333;
+  margin-left: 10px;
+  i {
+    margin-right: 10px;
+  }
+}
 </style>

+ 386 - 282
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -1,311 +1,415 @@
 <template>
-	<section>
-		<!--工具条-->
-		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
-			<el-form :inline="true">
-				<el-form-item>
-					<el-date-picker v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM" @change='changeMonth()' :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
-				</el-form-item>
-                <el-form-item style="float:right;">
-                    <el-link type="primary" :underline="false" @click="handleAdd">导出日报</el-link>
-				</el-form-item>
-                <el-form-item style="float:right;">
-                    <el-link type="primary" :underline="false" @click="handleAdd">项目管理</el-link>
-				</el-form-item>
-			</el-form>
-		</el-col>
+  <section>
+    <!--工具条-->
+    <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
+      <el-form :inline="true">
+        <el-form-item>
+          <el-date-picker
+            v-model="date"
+            :editable="false"
+            format="yyyy-MM"
+            value-format="yyyy-MM"
+            @change="changeMonth()"
+            :clearable="false"
+            type="month"
+            placeholder="选择月份"
+          ></el-date-picker>
+        </el-form-item>
+        <el-form-item style="float:right;">
+          <el-link type="primary" :underline="false">导出日报</el-link>
+        </el-form-item>
+        <el-form-item style="float:right;">
+          <el-link type="primary" :underline="false" @click="projectDialogVisible=true">项目管理</el-link>
+        </el-form-item>
+      </el-form>
+    </el-col>
 
-		<!--列表-->
-		<div>
-            <el-card class="box-card daily" shadow="never" :style="'height:'+tableHeight +'px'">
-                <div slot="header" class="clearfix">
-                    <span>日期:</span>
-                    <span v-for="(item,index) in allDate" :id="'day'+index" :class="index==choseDay?'chooseDate date_item':'date_item'" @click="choseDate(index)">{{item}}</span>
-                </div>
-                <div class="allDaily">
-                    <div class="one_daily">
-                        <el-link><i class="fa fa-circle"></i> 吴涛涛</el-link>
-                        <div class="one_daily_body">
-                            <el-timeline>
-                                <el-timeline-item>
-                                    <el-card shadow="never">
-                                        <p>项目:<b>工时管家开发项目</b></p>
-                                        <p>时长:1.5h</p>
-                                        <p>事项:1.重新设计工作日报模块<br>
-
-                                            2.绘制原型图<br>
-
-                                            3.敲代码<br>
-                                        </p>
-                                    </el-card>
-                                </el-timeline-item>
-                            </el-timeline>
-                        </div>
-                    </div>
-                    <div class="one_daily">
-                        <el-link><i class="fa fa-circle"></i> 吴涛涛</el-link>
-                        <div class="one_daily_body">
-                            <el-timeline>
-                                <el-timeline-item>
-                                    <el-card shadow="never">
-                                        <p>项目:<b>工时管家开发项目</b></p>
-                                        <p>时长:1.5h</p>
-                                        <p>事项:1.重新设计工作日报模块<br>
-
-                                            2.绘制原型图<br>
-
-                                            3.敲代码<br>
-                                        </p>
-                                    </el-card>
-                                </el-timeline-item>
-                            </el-timeline>
-                        </div>
-                    </div>
-                    <div class="one_daily">
-                        <el-link><i class="fa fa-circle"></i> 吴涛涛</el-link>
-                        <div class="one_daily_body">
-                            <el-timeline>
-                                <el-timeline-item>
-                                    <el-card shadow="never">
-                                        <p>项目:<b>工时管家开发项目</b></p>
-                                        <p>时长:1.5h</p>
-                                        <p>事项:1.重新设计工作日报模块<br>
-
-                                            2.绘制原型图<br>
-
-                                            3.敲代码<br>
-                                        </p>
-                                    </el-card>
-                                </el-timeline-item>
-                                <el-timeline-item>
-                                    <el-card shadow="never">
-                                        <p>项目:<b>工时管家开发项目</b></p>
-                                        <p>时长:1.5h</p>
-                                        <p>事项:1.重新设计工作日报模块<br>
-
-                                            2.绘制原型图<br>
-
-                                            3.敲代码<br>
-                                        </p>
-                                    </el-card>
-                                </el-timeline-item>
-                            </el-timeline>
-                        </div>
-                    </div>
-                </div>
-            </el-card>
+    <!--列表-->
+    <div>
+      <el-card class="box-card daily" shadow="never" :style="'height:'+tableHeight +'px'">
+        <div slot="header" class="clearfix">
+          <span>日期:</span>
+          <span
+            v-for="(item,index) in allDate"
+            :id="'day'+index"
+            :class="index==choseDay?'chooseDate date_item':'date_item'"
+            @click="choseDate(index)"
+            :key="index"
+          >{{item}}</span>
         </div>
-	</section>
+        <div class="allDaily">
+          <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
+            <el-link>
+              <i class="fa fa-circle"></i>
+              {{item1.name}}
+            </el-link>
+            <div class="one_daily_body">
+              <el-timeline>
+                <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
+                  <el-card shadow="never">
+                    <p>
+                      项目:
+                      <b>{{item2.project}}</b>
+                    </p>
+                    <p>时长:{{item2.time}}h</p>
+                    <p>事项:{{item2.content}}</p>
+                  </el-card>
+                </el-timeline-item>
+              </el-timeline>
+            </div>
+          </div>
+          <!-- 简陋的无报告提示 -->
+          <span v-if="reportList.length==0">本日暂无报告</span>
+        </div>
+      </el-card>
+    </div>
+
+    <!-- 项目管理的dialog -->
+    <el-dialog title="项目管理" :visible.sync="projectDialogVisible" width="50%">
+      <!-- 现在原生的CSS 有按钮跳动和下边距的问题 -->
+      <div>
+        <el-tag
+          :key="index"
+          v-for="(item,index) in projectList"
+          closable
+          :disable-transitions="false"
+          @close="handleClose(item)"
+        >{{item.projectName}}</el-tag>
+        <el-input
+          class="input-new-tag"
+          v-if="inputVisible"
+          v-model="inputValue"
+          ref="saveTagInput"
+          size="small"
+          @keyup.enter.native="handleInputConfirm"
+          @blur="handleInputConfirm"
+        ></el-input>
+        <el-button v-else class="button-new-tag" size="small" @click="showInput">新增项目</el-button>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">关闭</el-button>
+      </span>
+    </el-dialog>
+  </section>
 </template>
 
 <script>
-	import util from '../../common/js/util'
+import util from "../../common/js/util";
 
-	export default {
-		data() {
-			return {
-                user: JSON.parse(sessionStorage.getItem('user')),
+export default {
+  data() {
+    return {
+      user: JSON.parse(sessionStorage.getItem("user")),
 
-                allDate: [],
-                date:  util.formatDate.format(new Date(new Date()), 'yyyy-MM'),
-                choseDay: 0,
+      allDate: [],
+      date: util.formatDate.format(new Date(new Date()), "yyyy-MM"),
+      choseDay: 0,
 
-                tableHeight: 0,
-                listLoading: false,
-				total: 0,
-                page: 1,
-                size: 20,
-                list: [],
-                
-                addFormVisible: false,
-				addLoading: false,
-			}
-		},
-		methods: {
-            changeMonth() {
-                this.getAllDate();
-                this.getList();
-            },
+      tableHeight: 0,
+      listLoading: false,
 
-            choseDate(i) {
-                this.choseDay = i;
-            },
+      projectList: [], //项目列表
+      reportList: [], //日报列表
+      projectDialogVisible: false, //项目弹窗
+      inputVisible: false, //项目新增输入
+      inputValue: "" //项目新增值
+    };
+  },
+  methods: {
+    changeMonth() {
+      this.getAllDate();
+      this.getReportList();
+    },
 
-            getAllDate() {
-                var dayArry = [];
-                var day = this.getCountDays();
-                for (var k = 1; k <= day; k++) {
-                    var str = new Date(this.date.replace(/-/g,'/')).getMonth() + 1 + "月" + k + "日";
-                    if(new Date(this.date.replace(/-/g,'/')).getFullYear() == new Date(new Date()).getFullYear() &&
-                        new Date(this.date.replace(/-/g,'/')).getMonth() == new Date(new Date()).getMonth()) {
-                            if(new Date().getDate() == k) {
-                                this.choseDay = k-1;
-                            }
-                    } else {
-                        this.choseDay = 0;
-                    }
-                    dayArry.push(str);
-                }
-                this.allDate = dayArry;
-            },
+    choseDate(i) {
+      this.choseDay = i;
+      this.getReportList();
+    },
 
-            getCountDays() {
-                var newstr = this.date.replace(/-/g,'/'); 
-                var curDate = new Date(newstr);
-                var curMonth = curDate.getMonth();
-                curDate.setMonth(curMonth + 1);
-                curDate.setDate(0);
-                return curDate.getDate();
-            },
+    getAllDate() {
+      var dayArry = [];
+      var day = this.getCountDays();
+      for (var k = 1; k <= day; k++) {
+        var str =
+          new Date(this.date.replace(/-/g, "/")).getMonth() +
+          1 +
+          "月" +
+          k +
+          "日";
+        if (
+          new Date(this.date.replace(/-/g, "/")).getFullYear() ==
+            new Date(new Date()).getFullYear() &&
+          new Date(this.date.replace(/-/g, "/")).getMonth() ==
+            new Date(new Date()).getMonth()
+        ) {
+          if (new Date().getDate() == k) {
+            this.choseDay = k - 1;
+          }
+        } else {
+          this.choseDay = 0;
+        }
+        dayArry.push(str);
+      }
+      this.allDate = dayArry;
+    },
 
-			//分页
-			handleCurrentChange(val) {
-				this.page = val;
-				this.getList();
-            },
+    getCountDays() {
+      var newstr = this.date.replace(/-/g, "/");
+      var curDate = new Date(newstr);
+      var curMonth = curDate.getMonth();
+      curDate.setMonth(curMonth + 1);
+      curDate.setDate(0);
+      return curDate.getDate();
+    },
 
-            handleSizeChange(val) {
-                this.size = val;
-				this.getList();
-            },
-            
-			//获取项目列表
-			getList() {
-				this.listLoading = true;
-				this.http.post(this.port.project.projectList, {
-                    keyName: '',
-                    pageNum: this.page,
-                    pageSize: this.size,
-                }, res => {
-                    this.listLoading = false;
-                    if (res.code == "ok") {
-                        var list = res.data.list;
-                        for(var i in list){
-                            var customCompaniesStr = "";
-                            for(var j in list[i].customCompanies){
-                                if(j == list[i].customCompanies.length -1){
-                                    customCompaniesStr += list[i].customCompanies[j].companyName;
-                                } else {
-                                    customCompaniesStr += list[i].customCompanies[j].companyName + "、";
-                                }
-                            }
-                            list[i].customCompaniesStr = customCompaniesStr;
-                        }
-                        this.list = list;
-                        this.total = res.data.total;
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: 'error'
-                        });
-                    }
-                }, error => {
-                    this.listLoading = false;
-                    this.$message({
-                        message: error,
-                        type: 'error'
-                    });
-                })
-            },
+    //获取项目列表
+    getProjectList() {
+      this.listLoading = true;
+      this.http.post(
+        this.port.project.list,
+        {},
+        res => {
+          this.listLoading = false;
+          if (res.code == "ok") {
+            this.projectList = res.data;
+          } else {
+            this.$message({
+              message: res.msg,
+              type: "error"
+            });
+          }
+        },
+        error => {
+          this.listLoading = false;
+          this.$message({
+            message: error,
+            type: "error"
+          });
+        }
+      );
+    },
 
-            //显示新增界面
-			handleAdd() {
-                this.getUnusual();
-				this.addFormVisible = true;
+    //删除项目
+    handleClose(item) {
+      this.$confirm("确定要删除项目" + item.projectName + "吗?", "删除项目", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          this.listLoading = true;
+          this.http.post(
+            this.port.project.delete,
+            { id: item.id },
+            res => {
+              this.listLoading = false;
+              if (res.code == "ok") {
+                this.$message({
+                  type: "success",
+                  message: "项目删除成功"
+                });
+                this.getProjectList();
+              } else {
+                this.$message({
+                  message: res.msg,
+                  type: "error"
+                });
+              }
             },
+            error => {
+              this.listLoading = false;
+              this.$message({
+                message: error,
+                type: "error"
+              });
+            }
+          );
+        })
+        .catch(() => {});
+    },
 
-            // 获取异常列表
-            getUnusual() {
-                this.listLoading = true;
-				this.http.post(this.port.project.projectList, {
-                    keyName: '',
-                    pageNum: this.page,
-                    pageSize: this.size,
-                }, res => {
-                    this.listLoading = false;
-                    if (res.code == "ok") {
-                        var list = res.data.list;
-                        for(var i in list){
-                            var customCompaniesStr = "";
-                            for(var j in list[i].customCompanies){
-                                if(j == list[i].customCompanies.length -1){
-                                    customCompaniesStr += list[i].customCompanies[j].companyName;
-                                } else {
-                                    customCompaniesStr += list[i].customCompanies[j].companyName + "、";
-                                }
-                            }
-                            list[i].customCompaniesStr = customCompaniesStr;
-                        }
-                        this.list = list;
-                        this.total = res.data.total;
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: 'error'
-                        });
-                    }
-                }, error => {
-                    this.listLoading = false;
-                    this.$message({
-                        message: error,
-                        type: 'error'
-                    });
-                })
-            },
+    //显示输入
+    showInput() {
+      this.inputVisible = true;
+      this.$nextTick(_ => {
+        this.$refs.saveTagInput.$refs.input.focus();
+      });
+    },
+
+    //处理输入信息
+    handleInputConfirm() {
+      let inputValue = this.inputValue;
+      if (inputValue) {
+        this.$confirm("确定要新增项目" + inputValue + "吗?", "新增项目", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            this.listLoading = true;
+            this.http.post(
+              this.port.project.add,
+              { name: inputValue },
+              res => {
+                this.listLoading = false;
+                if (res.code == "ok") {
+                  this.$message({
+                    type: "success",
+                    message: "新增项目成功"
+                  });
+                  this.getProjectList();
+                } else {
+                  this.$message({
+                    message: res.msg,
+                    type: "error"
+                  });
+                }
+              },
+              error => {
+                this.listLoading = false;
+                this.$message({
+                  message: error,
+                  type: "error"
+                });
+              }
+            );
+          })
+          .catch(() => {});
+      }
+      this.inputVisible = false;
+      this.inputValue = "";
+    },
 
+    //获取日报列表
+    getReportList() {
+      this.listLoading = true;
+      //首先处理日期
+      let day =
+        this.choseDay > 9
+          ? "-" + (this.choseDay + 1)
+          : "-0" + (this.choseDay + 1);
+      this.http.post(
+        this.port.report.list,
+        {
+          date: this.date + day
         },
-        created() {
-            let height = window.innerHeight;
-            this.tableHeight = height - 170;
-            const that = this;
-            window.onresize = function temp() {
-                that.tableHeight = window.innerHeight - 170; 
-            };
+        res => {
+          this.listLoading = false;
+          if (res.code == "ok") {
+            this.reportList = res.data;
+          } else {
+            this.$message({
+              message: res.msg,
+              type: "error"
+            });
+          }
         },
-		mounted() {
-            this.getAllDate();
-            this.getList();
-		}
-	}
+        error => {
+          this.listLoading = false;
+          this.$message({
+            message: error,
+            type: "error"
+          });
+        }
+      );
+    },
 
+    // 获取异常列表
+    getUnusual() {
+      this.listLoading = true;
+      this.http.post(
+        this.port.project.projectList,
+        {},
+        res => {
+          this.listLoading = false;
+          if (res.code == "ok") {
+          } else {
+            this.$message({
+              message: res.msg,
+              type: "error"
+            });
+          }
+        },
+        error => {
+          this.listLoading = false;
+          this.$message({
+            message: error,
+            type: "error"
+          });
+        }
+      );
+    }
+  },
+  created() {
+    let height = window.innerHeight;
+    this.tableHeight = height - 170;
+    const that = this;
+    window.onresize = function temp() {
+      that.tableHeight = window.innerHeight - 170;
+    };
+  },
+  mounted() {
+    this.getAllDate();
+    this.getReportList();
+    this.getProjectList();
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-    .clearfix {
-        overflow-x: auto;
-        white-space: nowrap;
-        padding: 15px 0;
-        .date_item {
-            padding:0 15px;
-            cursor: pointer;
-        }
-        .chooseDate {
-            color: #20a0ff;
-        }
-    }
+.clearfix {
+  overflow-x: auto;
+  white-space: nowrap;
+  padding: 15px 0;
+  .date_item {
+    padding: 0 15px;
+    cursor: pointer;
+  }
+  .chooseDate {
+    color: #20a0ff;
+  }
+}
 
-    .one_daily {
-        i {
-            color: #9ED0FF;
-            margin-right: 5px;
-        }
-        .one_daily_body {
-            padding: 15px 0px;
-            p {
-                margin: 0;
-                line-height: 30px;
-            }
-        }
-        ul {
-            padding: 0;
-        }
+.one_daily {
+  i {
+    color: #9ed0ff;
+    margin-right: 5px;
+  }
+  .one_daily_body {
+    padding: 15px 0px;
+    p {
+      margin: 0;
+      line-height: 30px;
     }
+  }
+  ul {
+    padding: 0;
+  }
+}
 </style>
 <style lang="scss">
-    .daily {
-        .el-card__body {
-            height: 82%;
-            overflow-y: auto;
-        }
-    }
+.daily {
+  .el-card__body {
+    height: 82%;
+    overflow-y: auto;
+  }
+}
+</style>
+<style scoped>
+/* 项目标签的样式 */
+.el-tag + .el-tag {
+  margin-left: 10px;
+}
+.button-new-tag {
+  margin-left: 10px;
+  height: 32px;
+  line-height: 30px;
+  padding-top: 0;
+  padding-bottom: 0;
+}
+.input-new-tag {
+  width: 90px;
+  margin-left: 10px;
+  vertical-align: bottom;
+}
 </style>

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/statistics.vue

@@ -181,7 +181,7 @@
             };
         },
 		mounted() {
-            this.getList();
+            // this.getList();
 		}
 	}