Browse Source

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

seyason 2 years ago
parent
commit
08961126fe
17 changed files with 880 additions and 76 deletions
  1. 22 8
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectRequirementController.java
  2. 2 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java
  3. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ProjectRequirementMapper.java
  4. 7 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectRequirementMapper.xml
  5. 1 1
      fhKeeper/formulahousekeeper/timesheet/config/index.js
  6. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/permissions.js
  7. 13 0
      fhKeeper/formulahousekeeper/timesheet/src/routes.js
  8. 2 2
      fhKeeper/formulahousekeeper/timesheet/src/views/customer/list.vue
  9. 7 6
      fhKeeper/formulahousekeeper/timesheet/src/views/project/custom_data.vue
  10. 1 0
      fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue
  11. 6 25
      fhKeeper/formulahousekeeper/timesheet/src/views/project/info.vue
  12. 90 4
      fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue
  13. 8 1
      fhKeeper/formulahousekeeper/timesheet/src/views/project/project_gantt.vue
  14. 21 6
      fhKeeper/formulahousekeeper/timesheet/src/views/project/summary.vue
  15. 587 0
      fhKeeper/formulahousekeeper/timesheet/src/views/provider/provider.vue
  16. 64 9
      fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue
  17. 47 9
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

+ 22 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectRequirementController.java

@@ -2,10 +2,7 @@ package com.management.platform.controller;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.management.platform.entity.Project;
-import com.management.platform.entity.ProjectRequirement;
-import com.management.platform.entity.Task;
-import com.management.platform.entity.TaskGroup;
+import com.management.platform.entity.*;
 import com.management.platform.mapper.*;
 import com.management.platform.service.ProjectRequirementService;
 import com.management.platform.util.ExcelUtil;
@@ -59,7 +56,8 @@ public class ProjectRequirementController {
     private TaskGroupMapper taskGroupMapper;
     @Resource
     private TaskMapper taskMapper;
-
+    @Resource
+    private GroupParticipatorMapper groupParticipatorMapper;
     @RequestMapping("/addOrMod")
     public HttpRespMsg addOrMod(ProjectRequirement record) {
         HttpRespMsg msg = new HttpRespMsg();
@@ -82,13 +80,18 @@ public class ProjectRequirementController {
         now = now.minusDays(7);
         String startDate = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(now);
         List<Integer> projectIds = new ArrayList<>();
+        List<String> taskGroupUserIds=new ArrayList<>();
         if (!StringUtils.isEmpty(groupName)) {
             List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", companyId));
             List<Integer> collect = projectList.stream().map(Project::getId).collect(Collectors.toList());
             List<TaskGroup> taskGroups = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().eq("name", groupName).in("project_id", collect));
             projectIds = taskGroups.stream().map(TaskGroup::getProjectId).collect(Collectors.toList());
+            //获取分组 负责人id集合
+            List<GroupParticipator> groupParticipatorList = groupParticipatorMapper.selectList(new QueryWrapper<GroupParticipator>().in("group_id", taskGroups.stream().map(TaskGroup::getId).collect(Collectors.toList())));
+            taskGroupUserIds=groupParticipatorList.stream().map(GroupParticipator::getUserId).collect(Collectors.toList());
+            taskGroupUserIds.add("-1");
         }
-        List<ProjectRequirement> projectRequirements = projectRequirementMapper.customSelect(companyId, startDate, projectId, projectIds.size()==0?null:projectIds, startIndex, pageSize,reStartDate,reEndDate);
+        List<ProjectRequirement> projectRequirements = projectRequirementMapper.customSelect(companyId, startDate, projectId, projectIds.size()==0?null:projectIds, startIndex, pageSize,reStartDate,reEndDate,taskGroupUserIds.size()==0?null:taskGroupUserIds);
         List<Integer> ids = projectRequirements.stream().map(pr -> pr.getProjectId()).collect(Collectors.toList());
         List<Task> milepostList=taskMapper.selectMilepost(ids.size()==0?null:ids);
         projectRequirements.forEach(pr->{
@@ -107,14 +110,25 @@ public class ProjectRequirementController {
         return msg;
     }
     @RequestMapping("/exportData")
-    public HttpRespMsg exportData(){
+    public HttpRespMsg exportData(Integer projectId,String groupName){
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
         HttpRespMsg httpRespMsg=new HttpRespMsg();
         Integer companyId = userMapper.selectById(request.getHeader("TOKEN")).getCompanyId();
         LocalDate now = LocalDate.now();
         now = now.minusDays(7);
         String startDate = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(now);
-        List<ProjectRequirement> projectRequirementList = projectRequirementMapper.customSelect(companyId,startDate, null, null, null, null,null,null);
+        List<Integer> projectIds = new ArrayList<>();
+        List<String> taskGroupUserIds=new ArrayList<>();
+        if (!StringUtils.isEmpty(groupName)) {
+            List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", companyId));
+            List<Integer> collect = projectList.stream().map(Project::getId).collect(Collectors.toList());
+            List<TaskGroup> taskGroups = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().eq("name", groupName).in("project_id", collect));
+            projectIds = taskGroups.stream().map(TaskGroup::getProjectId).collect(Collectors.toList());
+            List<GroupParticipator> groupParticipatorList = groupParticipatorMapper.selectList(new QueryWrapper<GroupParticipator>().in("group_id", taskGroups.stream().map(TaskGroup::getId).collect(Collectors.toList())));
+            taskGroupUserIds=groupParticipatorList.stream().map(GroupParticipator::getUserId).collect(Collectors.toList());
+            taskGroupUserIds.add("-1");
+        }
+        List<ProjectRequirement> projectRequirementList = projectRequirementMapper.customSelect(companyId,startDate, projectId,  projectIds.size()==0?null:projectIds, null, null,null,null,taskGroupUserIds.size()==0?null:taskGroupUserIds);
         List<Integer> collect = projectRequirementList.stream().map(pr -> pr.getProjectId()).collect(Collectors.toList());
         List<Task> milepostList=taskMapper.selectMilepost(collect);
         projectRequirementList.forEach(pr->{

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -16,7 +16,7 @@ import com.management.platform.service.UserService;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.WorkDayCalculateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
@@ -1182,7 +1182,7 @@ public class ReportController {
         return reportService.getlastWeekFillTime(userId);
     }
 
-    @GetMapping("/getReportListByToken")
+    @PostMapping("/getReportListByToken")
     public HttpRespMsg getReportListByToken(@RequestParam String token, @RequestParam String startDate, @RequestParam String endDate){
         return reportService.getReportListByToken(token,startDate,endDate);
     }

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

@@ -15,7 +15,7 @@ import java.util.List;
  */
 public interface ProjectRequirementMapper extends BaseMapper<ProjectRequirement> {
 
-    public List<ProjectRequirement> customSelect(Integer companyId, String startDate, Integer projectId, List<Integer> refProjectIdList, Integer startIndex, Integer pageSize,String reStartDate,String reEndDate);
+    public List<ProjectRequirement> customSelect(Integer companyId, String startDate, Integer projectId, List<Integer> refProjectIdList, Integer startIndex, Integer pageSize,String reStartDate,String reEndDate,List<String> refTaskGroupUserIdList);
 
     long selectCountByDate(Integer companyId, String startDate, Integer projectId, List<Integer> refProjectIdList, int startIndex, Integer pageSize, String reStartDate, String reEndDate);
 }

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

@@ -31,7 +31,13 @@
 
     <select id="customSelect" resultMap="RichMap">
         SELECT project_requirement.id, project.id AS project_id, project.`project_name`, project.`project_code`, project_requirement.`memb_req`, project_requirement.`task_req`,project_requirement.contract_req,project_requirement.department_speed,project_requirement.start_date,project_requirement.end_date,
-        (SELECT GROUP_CONCAT(DISTINCT user.`name`) FROM report LEFT JOIN `user` ON user.`id` = report.`creator_id` WHERE report.company_id=#{companyId} AND report.create_time >= #{startDate} AND report.`project_id` = project.id) AS active_users
+        (SELECT GROUP_CONCAT(DISTINCT user.`name`) FROM report LEFT JOIN `user` ON user.`id` = report.`creator_id` WHERE report.company_id=#{companyId} AND report.create_time >= #{startDate} AND report.`project_id` = project.id
+        <if test="refTaskGroupUserIdList!=null">
+        and user.`id` in
+        <foreach collection="refTaskGroupUserIdList" open="(" close=")" separator="," item="item">
+        #{item}
+        </foreach>
+         </if> ) AS active_users
         FROM project LEFT JOIN project_requirement ON project.id = project_requirement.`project_id`
         WHERE project.`company_id` = #{companyId}
          <if test="projectId != null">

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/config/index.js

@@ -1,7 +1,7 @@
 var path = require('path')
 
 //  var ip = '127.0.0.1'
-// var ip = '47.100.37.243'
+// var ip = '47.101.180.183'
 var ip = '192.168.2.7'
 
 // var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/permissions.js

@@ -88,7 +88,7 @@ const StringUtil = {
         importAudit: false, // 查看导审记录 //
         
     }
-    console.log(arr);
+    // console.log(arr);
     for(var i in arr) {
         arr[i] == '导入工时' ? obj.importReport = true : ''
         arr[i] == '查看导审记录' ? obj.importAudit = true : ''

+ 13 - 0
fhKeeper/formulahousekeeper/timesheet/src/routes.js

@@ -77,6 +77,9 @@ import quanx from './views/quanx/quanx'
 // 研究中心管理
 import centerManage from './views/centerManage/centerManage'
 
+// 供应商模块
+import provider from './views/provider/provider'
+
 Vue.use(Router)
 
 export const fixedRouter = [
@@ -324,6 +327,16 @@ export const allRouters = [//组织架构
             { path: '/centerManage', component: centerManage, name: '研究中心管理' },
         ]
     },
+    {
+        path: '/',
+        component: Home,
+        name: '供应商管理',
+        iconCls: 'iconfont firerock-iconzuzhijiagou1',
+        leaf: true,//只有一个节点
+        children: [
+            { path: '/provider', component: provider, name: '供应商管理' },
+        ]
+    },
     {
         path: '/',
         component: Home,

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/customer/list.vue

@@ -328,10 +328,10 @@
                     });
                 }
             },
-            number(){  
+            number(){
         //      this.addForm.budget = this.addForm.budget.replace(/[^\.\d]/g,'');
         //         this.addForm.budget = this.addForm.budget.replace('.','');
-          },
+            },
             deleteSubPro(subProject) {
                 this.$confirm("确定要删除子项目" + subProject.name + "吗?","删除子项目", {
                     confirmButtonText: "确定",

+ 7 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/project/custom_data.vue

@@ -20,6 +20,7 @@
                 <el-radio-button label="项目"></el-radio-button>
                 <!-- <el-radio-button label="部门"></el-radio-button> -->
                 <el-radio-button label="人员"></el-radio-button>
+                <el-radio-button label="部门"></el-radio-button>
                 <!-- <el-radio-button :label="namess" v-if="jichu.customDegreeActive == 1"></el-radio-button> -->
             </el-radio-group>
         </el-col>
@@ -234,7 +235,8 @@
             //获取人员成本统计列表
             getUserCostList() {
                 this.listLoading = true;
-                this.http.post('/department/getUserCustomDataStatistic', {
+                let url = this.radio == '人员' ? '/department/getUserCustomDataStatistic' : '/department/getDeptCustomDataStatistic'
+                this.http.post(url, {
                     startDate:this.user.timeType.fixMonthcost==0?this.dateRange[0]:this.dateRange, 
                     endDate: this.user.timeType.fixMonthcost==0?this.dateRange[1]:this.dateRange
                 },
@@ -244,7 +246,7 @@
                     this.hasReportUserList = [];
                     if (res.code == "ok") {
                         //工时总成本
-                        this.hasReportUserList = res.data.userList;
+                        this.hasReportUserList = this.radio == '人员' ? res.data.userList : res.data.department;
                         var xList = [] , yList = [] , list = res.data.list, array = [] , series = [];
                         
                         var totalHours = 0.0;
@@ -427,10 +429,9 @@
                 var url = '';
                 if (this.radio=='项目') {
                     url = '/project/getCustomDataSum';
-                } else if (this.radio=='部门') {
-                    url = this.port.project.depCost;
-                    param.parentDeptId = this.parentDeptId;
-                } else if (this.radio=='人员') {
+                // } else if (this.radio=='部门') {
+                //     url = '/department/getDeptCustomDataStatistic';
+                } else if (this.radio=='人员' || this.radio == '部门') {
                     this.getUserCostList();
                     return;
                 } else if (this.radio == this.namess) {

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue

@@ -1561,6 +1561,7 @@ import { error } from 'dingtalk-jsapi';
                     let formData = new FormData();
                     formData.append("file", item.file);
                     formData.append("companyId", this.user.companyId);
+                    formData.append('ymonth',this.date)
                     this.http.uploadFile('/project-percentage/importData', formData,
                     res => {
                         this.$refs.upload.clearFiles();

+ 6 - 25
fhKeeper/formulahousekeeper/timesheet/src/views/project/info.vue

@@ -183,7 +183,7 @@
 
         
         <!--编辑基本信息界面-->
-        <el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="600px">
+        <el-dialog title="项目基本信息" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="600px">
             <el-form ref="basicInfoForm" :model="addForm" :rules="rules" label-width="120px">
                 <el-form-item label="项目编号" >
                     <el-input v-model="addForm.code"  placeholder="请输入项目编号" clearable></el-input>
@@ -252,7 +252,7 @@
         </el-dialog>
 
         <!--编辑参与人界面-->
-        <el-dialog :title="title" v-if="pVisible" :visible.sync="pVisible" :close-on-click-modal="false" customClass="customWidth" width="600px">
+        <el-dialog title="编辑参与人员" v-if="pVisible" :visible.sync="pVisible" :close-on-click-modal="false" customClass="customWidth" width="600px">
             <el-form ref="participForm" :model="addForm" :rules="rules" label-width="120px">
                 <el-form-item label="全部参与者">
                     <el-select v-model="addForm.userId" multiple filterable placeholder="请选择参与者" style="width:100%;" @change="changeParticipator">
@@ -1005,13 +1005,6 @@
                     });
                 });
             },
-            editTask(task) {
-                // this.addForm = JSON.parse(JSON.stringify(task));
-                this.addFormVisible = true;
-                this.addLoading = false;
-                this.title = "编辑任务";
-                this.getTaskDetail(task.id);
-            },
             getProjectTaskSum() {
                 this.http.post('/project/taskSum', {
                     id: this.curProjectId
@@ -1195,30 +1188,18 @@
                 });
             },
             
-            showEditBase() {
-                this.addForm = JSON.parse(JSON.stringify(this.project));
-                var list = this.project.participationList , arr = [];
-                for(var j in list) {
-                    arr.push(list[j].id)
-                }
-                this.addForm.userId = arr;
-                this.addForm.code = this.addForm.projectCode;
-                this.addForm.name = this.addForm.projectName;
-                this.modBaseCostData = JSON.parse(JSON.stringify(this.projectBaseCostData));
-                this.addBaseFormVisible = true;
-            },
             showEdit() {
                 this.addForm = JSON.parse(JSON.stringify(this.project));
-                console.log('---'+this.addForm);
+                console.log('---'+this.project);
                 console.log(this.addForm.projectCode);
                 
                 var list = this.project.participationList , arr = [];
                 for(var j in list) {
                     arr.push(list[j].id)
                 }
-                this.addForm.userId = arr;
-                this.addForm.code = this.addForm.projectCode;
-                this.addForm.name = this.addForm.projectName;
+                this.$set(this.addForm,'code',this.addForm.projectCode)
+                this.$set(this.addForm,'name',this.addForm.projectName)
+                this.addForm.userId = arr
                 this.addFormVisible = true;
                 console.log(this.addForm, 123)
                 var arr = []

+ 90 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

@@ -184,6 +184,10 @@
                 </div>
             </template>
             </el-table-column>
+            <!-- 供应商 -->
+            <el-table-column prop="providerNames" label="供应商" min-width="190" v-if="user.company.packageProvider">
+            </el-table-column>
+
             <el-table-column prop="status" label="状态" min-width="100" >
                 <template slot-scope="scope">
                     {{scope.row.status == null?"-":statusTxt[scope.row.status]}}
@@ -262,7 +266,7 @@
                     <el-input v-model="addForm.name" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目名称" clearable></el-input>
                 </el-form-item>
                 <el-form-item label="项目描述" prop="projectDesc">
-                    <el-input v-model="addForm.projectDesc" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目描述" clearable maxlength="200" show-word-limit></el-input>
+                    <el-input v-model="addForm.projectDesc" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目描述" clearable maxlength="4000"></el-input>
                 </el-form-item>
                 <el-form-item label="项目类型" prop="isPublic">
                     <el-select v-model="addForm.isPublic" style="width:32%;" @change="selectPublic" :disabled="!permissions.projectManagement && addForm.creatorId != user.id">
@@ -279,6 +283,21 @@
                         </el-select>
                     </div>
                 </el-form-item>
+                <!-- 供应商 -->
+                <!-- <el-form-item label="供应商" v-if="user.company.packageProvider">
+                    <el-select v-model="addForm.supplierId" multiple collapse-tags style="width:32%;" placeholder="请选择供应商">
+                        <el-option v-for="item in supplierList" :key="item.id" :label="item.providerName" :value="item.id">
+                        </el-option>
+                    </el-select>
+                </el-form-item> -->
+                <el-form-item label="供应商" v-if="user.company.packageProvider">
+                    <el-select v-model="addForm.supplierId" multiple placeholder="请选择" filterable="true" style="width: 100%">
+                        <span v-for="(item, index) in supplierList" :key="index">
+                            <el-option :label="item.providerName" :value="item.id"></el-option>
+                        </span> 
+                    </el-select>
+                </el-form-item>
+
                 <el-form-item :label="yonghuUser.customDegreeName" v-if="yonghuUser.customDegreeActive == 1">
                     <el-select v-model="auseList" multiple placeholder="请选择" filterable="true" style="width: 100%">
                         <span v-for="(item, index) in ause" :key="index">
@@ -885,8 +904,8 @@ a {
                 showColumnWidth: '300',
                 deleteVif: null,
                 isAddGroupPerson: true,
-                projectMainId: ''
-                
+                projectMainId: '',
+                supplierList: ''
             };
         },
         // 过滤器
@@ -919,6 +938,30 @@ a {
             }
         },
         methods: {
+            //获取项目列表
+            getSupplierList() {
+                this.http.post('/provider-info/list', {
+                    pageIndex: 1,
+                    pageSize: 999,
+                    keyword: ''
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.supplierList = res.data.records;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
             addManPro(row) {
                 this.addFlgmainProjectDialog = true
                 if(!row) {
@@ -2377,6 +2420,26 @@ a {
                         projectMainId: item.projectMainId,
                         creatorId: item.creatorId
                     }
+
+                    // 判断是否有供应商
+                    if(this.user.company.packageProvider) {
+                        // this.addForm.supplierId = item.providerIds.split(',')
+                        if(item.providerIds) {
+                            let arr = [] 
+                            let zhhi = item.providerIds.split(',')
+                            for(let i in zhhi) {
+                                arr.push(+zhhi[i] + 0)
+                            }
+                            this.$set(this.addForm, 'supplierId', arr)
+                            console.log( this.addForm.supplierId)
+                        } else {
+                            this.$set(this.addForm, 'supplierId', [])
+                        }
+                       
+                    }
+                    // 判断是否有供应商结尾
+
+
                     this.deleteVif = item.creatorId
                     console.log("handleadd",this.deleteVif,this.addForm.id)
                     if(item.associateDegrees != null && item.associateDegrees != 'null' && item.associateDegrees != '') {
@@ -2603,6 +2666,22 @@ a {
                         if(this.user.timeType.mainProjectState == '1') {
                             formData.append("projectMainId", this.addForm.projectMainId);
                         }
+
+                        // 提交供应商
+                        // 线判断是否有供应商
+                        if(this.user.company.packageProvider) {
+                            let suppStrName = []
+                            for(let is in this.addForm.supplierId) {
+                                for(let js in this.supplierList) {
+                                    if(this.addForm.supplierId[is] == this.supplierList[js].id) {
+                                        suppStrName.push(this.supplierList[js].providerName)
+                                    }
+                                }
+                            }
+                            formData.append("providerNames", suppStrName.toString());
+                            formData.append("providerIds", this.addForm.supplierId.toString());
+                        }
+
                         // formData.append("associateDegreeNames", listName)
                         // console.log("addform",this.addForm);
                         // return
@@ -2740,7 +2819,14 @@ a {
             this.getProjectBaseConfigList();
             this.getClfConfigList()
             this.yanjiuzx()
-            if(this.user,timeType.mainProjectState == 1){
+
+            // 判断是否有供应商字段
+            if(this.user.company.packageProvider == 1){
+                this.getSupplierList()
+            }
+            // this.getSupplierList()
+
+            if(this.user.timeType.mainProjectState == 1){
                 this.getMainProject()
             }
             

+ 8 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/project_gantt.vue

@@ -202,7 +202,14 @@ export default {
       },
       // 资源需求导出
       exportProjectData() {
-                this.http.post('/project-requirement/exportData',{},
+        let parameter = {}
+        if(this.valuex){
+          parameter.projectId = this.valuex
+        }
+        if(this.valuex2){
+          parameter.groupName = this.valuex2
+        }
+                this.http.post('/project-requirement/exportData',parameter,
                 res => {
                     if (res.code == "ok") {
                         let filePath = res.data;

+ 21 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/project/summary.vue

@@ -50,7 +50,12 @@
             </el-col>
             <el-col :span="12">    
                 <div class="box">   
-                    <div class="lableTxt">执行人分配</div>
+                    <div class="lableTxt" style="display:flex;justify-content:space-between;align-items:center;">执行人分配
+                        <el-radio-group v-model="sumListRadio" size="mini" @change="sumRadioChange">
+                            <el-radio-button label="任务数量"></el-radio-button>
+                            <el-radio-button label="计划工时"></el-radio-button>
+                        </el-radio-group>
+                    </div>
                     <el-divider></el-divider>
                     <div id="executorPanel" style="height:300px;width:500px;"></div>
                 </div>
@@ -137,10 +142,14 @@
                 addLoading: false,
                 curProjectId:null,
                 title: "",
-                
+                sumListRadio: '任务数量'
             };
         },
         methods: {
+            sumRadioChange(){
+                this.getExecutorPanel()
+            },
+
             exportTaskCompare() {
                 let _this = this;
                 this.http.post('/task/exportTaskTimeCompare', {projectId: this.curProjectId},
@@ -400,14 +409,20 @@
             },
             getExecutorPanel(){
                 let _this = this;
-                this.http.post('/task/getExecutorPanel', {projectId: this.curProjectId},
+                let url
+                if(this.sumListRadio == '计划工时'){
+                    url = '/task/getExecutorPlanHour'
+                }else{
+                    url = '/task/getExecutorPanel'
+                }
+                this.http.post(url, {projectId: this.curProjectId},
                 res => {
                     if (res.code == "ok") {
                         var xList = [], yList = [], list = res.data;
                         for(var i in list) {
                             xList.push(list[i].executorName);
                             yList.push({
-                                "value": list[i].taskCount,
+                                "value": _this.sumListRadio == '计划工时' ? list[i].taskHours : list[i].taskCount,
                                 "id": list[i].executorId
                             });
                         }
@@ -444,7 +459,7 @@
                                 trigger:'axis',
                                 formatter: function (params,ticket,callback) {
                                     var res = params[0].name + ""+" : " + params[0].data.value 
-                                    + "个";
+                                    + (_this.sumListRadio == '计划工时' ? '小时' : "个");
                                     _this.params = params;
                                     return res;
                                 }
@@ -462,7 +477,7 @@
                                 }
                             }],
                             series: [{
-                                name: '任务数量(个)',
+                                name: _this.sumListRadio == '计划工时' ? '计划工时(小时)' : '任务数量(个)',
                                 type: 'bar',
                                 barMaxWidth: 30,
                                 data: yList,

+ 587 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/provider/provider.vue

@@ -0,0 +1,587 @@
+<template>
+    <section>
+        <!--工具条-->
+        <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
+            <el-form :inline="true">
+                <el-form-item label="供应商列表">
+                    
+                </el-form-item>
+                <el-form-item >
+                    <div>
+                    <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入供应商名称关键字" clearable="true" @clear="getList()">
+                        <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button>
+                    </el-input>
+                    </div>
+                </el-form-item>
+                <el-form-item style="float:right;">
+                    <el-link type="primary" :underline="false" @click="handleAdd(-1,null)">新增供应商</el-link>
+                    <el-link type="primary" :underline="false" @click="intocustomerRatio">批量导入供应商</el-link>
+                </el-form-item>
+            </el-form>
+        </el-col>
+
+        <!--列表-->
+        <el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" @selection-change="selectionChange">
+            <el-table-column type="selection" width="60">
+                <!-- <template slot-scope="scope" >
+                        {{scope.$index+1+(page-1)*size}}
+                    </template> -->
+            </el-table-column>
+            <el-table-column prop="providerCode" label="供应商编码"  width="200"></el-table-column>
+            <el-table-column prop="providerName" label="供应商名称" width="200">
+            </el-table-column>
+            <el-table-column prop="contactName" label="联系人"  width="120">
+            </el-table-column>
+            <el-table-column prop="contactPhone" label="联系电话"  width="150">
+            </el-table-column>
+            <el-table-column prop="email" label="邮箱"  width="180">
+            </el-table-column>
+            <el-table-column prop="address" label="地址" width="200">
+            </el-table-column>
+            <el-table-column prop="remark" label="备注" width="300">
+            </el-table-column>
+            
+            <el-table-column label="操作" width="150" fixed="right">
+                <template slot-scope="scope">
+                    <el-button size="mini" type="primary" @click="handleAdd(scope.$index, scope.row)">编辑</el-button>
+                    <el-button size="mini"  @click="deletePro(scope.$index, scope.row)">删除</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+
+        <!--工具条-->
+        <el-col :span="24" class="toolbar">
+            <el-button type="primary" size="small" @click="batchDelete" :loading="delLoading">批量删除</el-button>
+            <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>
+
+        <!--新增界面-->
+        <el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="800px">
+            <el-form ref="form1" :model="addForm" :rules="rules" label-width="120px">
+                <el-form-item label="供应商编号" >
+                    <el-input v-model="addForm.providerCode" :max="20" placeholder="请输入供应商编号" clearable></el-input>
+                </el-form-item>
+                <el-form-item label="供应商名称" prop="providerName">
+                    <el-input v-model="addForm.providerName" :max="20" placeholder="请输入供应商名称" clearable></el-input>
+                </el-form-item>
+                <el-form-item label="联系人" prop="contactName">
+                    <el-input v-model="addForm.contactName" :max="20" placeholder="请输入供应商联系人" clearable></el-input>
+                </el-form-item>
+                <el-form-item label="联系电话" prop="contactPhone">
+                    <el-input v-model="addForm.contactPhone" :max="20" placeholder="请输入供应商联系电话" clearable></el-input>
+                </el-form-item>
+                <el-form-item label="邮箱" prop="email">
+                    <el-input v-model="addForm.email" :max="25" placeholder="请输入供应商邮箱" clearable></el-input>
+                </el-form-item>
+                <el-form-item label="地址" prop="address">
+                    <el-input v-model="addForm.address" :max="50"  placeholder="请输入供应商联系地址" clearable></el-input>
+                </el-form-item>
+                <el-form-item label="备注" prop="remark ">
+                    <el-input type="textarea" :rows="4" v-model="addForm.remark " maxlength="100" show-word-limit placeholder="请输入备注" clearable></el-input>
+                </el-form-item>
+
+            </el-form>
+            <div slot="footer" class="dialog-footer;">
+                <el-button @click.native="addFormVisible = false">取消</el-button>
+                <el-button type="primary" @click="submitInsert" :loading="addLoading">提交</el-button>
+            </div>
+        </el-dialog>
+         <!-- 导入结果说明 -->
+        <el-dialog title="分摊比例导入结果" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
+            <div>
+                <span>{{importResultMsg}}</span>
+                
+            </div>
+            <span slot="footer" class="dialog-footer">
+                <el-button type="primary" @click="showImportResult=false">确定</el-button>
+            </span>
+        </el-dialog>
+         <el-dialog title="导入供应商数据" v-if="intocustomerDialog" :visible.sync="intocustomerDialog" customClass="customWidth" width="500px">
+            <p>1. 下载
+            <el-link type="primary" style="margin-left:5px;" :underline="false" href="./upload/新增供应商导入模板.xlsx" download="新增供应商导入模板.xlsx">新增供应商导入模板.xlsx</el-link>
+            </p>
+            <!-- <p>2. 填写excel模板,请确保模板中的项目和人员已添加到系统中。</p> -->
+            <p style="display: flex;justify-content: center;padding:1em 0">
+                <el-upload ref="upload"  action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
+                <el-button type="primary" :underline="false" :loading="importingData">开始导入</el-button>
+            </el-upload>
+            </p>
+        </el-dialog>
+    </section>
+</template>
+<style scoped>
+.input-with-select .el-input-group__prepend {
+    background-color: #fff;
+  }
+.line {
+    padding:10px;
+}
+.line span{
+    font-size:15px;
+}
+.line span:nth-child(even){
+    float:right;
+}
+</style>
+<script>
+    import util from "../../common/js/util";
+    export default {
+        data() {
+            return {
+                roleArray:["普通员工","超级管理员", "系统管理员", "公司高层","财务管理员", "项目管理员"],
+                status:null,
+                statusTxt:["-","进行中","已完成","已撤销"],
+                importanceList:[{id:1,label:'正常'},{id:2,label:'紧急'},{id:3,label:'重要'},{id:4,label:'重要且紧急'}],
+                searchField:null,
+                keyword:null,
+                user: JSON.parse(sessionStorage.getItem("user")),
+                userDetailVisible: false,
+                userDetail:{},
+                date: new Date(),
+                users: [],
+                participator:[],
+                tableHeight: 0,
+                listLoading: false,
+                total: 0,
+                page: 1,
+                size: 20,
+                list: [],
+                subProjectVisible: false,
+                subProjectList: [],//子项目列表
+                currentProject:{},
+                addSubProject: false,
+                addFormVisible: false,
+                addLoading: false,
+                addUp: 0, // 合计
+                title: "",
+                addForm: {
+                    name: '',
+                    userId: [],
+                    level:1,
+                },
+                rules: {
+                    providerName: [{ required: true, message: "请输入供应商名称", trigger: "blur" }],
+                },
+                intocustomerDialog:false,
+                importingData: false,
+                importResultMsg:null,
+                showImportResult:false,
+                selectArr: [],
+                delLoading: false
+            };
+        },
+        // 过滤器
+        filters: {
+            numberToCurrency(value) {
+                if (!value) return '0.00'
+                // 将数值截取,保留两位小数
+                value = value.toFixed(2)
+                // 获取整数部分
+                const intPart = Math.trunc(value)
+                // 整数部分处理,增加,
+                const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
+                // 预定义小数部分
+                let floatPart = '.00'
+                // 将数值截取为小数部分和整数部分
+                const valueArray = value.toString().split('.')
+                if (valueArray.length === 2) { // 有小数部分
+                floatPart = valueArray[1].toString() // 取得小数部分
+                return intPartFormat + '.' + floatPart
+                }
+                return intPartFormat + floatPart
+            }
+        },
+        methods: {
+            // 批量删除
+            selectionChange(selection){
+                console.log('sel',selection);
+                this.selectArr = selection
+            },
+            batchDelete(){
+                if(this.selectArr.length == 0){
+                    this.$message('请选择要删除的供应商数据')
+                    return
+                }else{
+                    let nametext = ''
+                    for(let i in this.selectArr){
+                        nametext += this.selectArr[i].providerName + '、'
+                    }
+                    nametext = nametext.substring(0,nametext.length - 1)
+                    this.$confirm("确定要批量删除供应商:" + nametext + "\u3000吗?","删除供应商", {
+                        confirmButtonText: "确定",
+                        cancelButtonText: "取消",
+                        type: "warning"
+                    }).then(()=>{
+                        this.delLoading = true
+                        let batchIds = ''
+                        for(let m in this.selectArr){
+                            batchIds += this.selectArr[m].id + ','
+                        }
+                        batchIds = batchIds.substring(0,batchIds.length - 1)
+                        this.http.post('/provider-info/batchDelete',{
+                            batchIds
+                        },res => {
+                            this.delLoading = false
+                            if(res.code == 'ok'){
+                                this.$message({
+                                    message: '删除成功',
+                                    type: 'success'
+                                })
+                                this.getList()
+                            }else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: 'error'
+                                })
+                            }
+                        },err => {
+                            this.delLoading = false
+                            this.$message({
+                                message: res.msg,
+                                type: 'error'
+                            })
+                        })
+                    })
+                    
+                }
+            },
+            intocustomerRatio(){
+                this.intocustomerDialog=true;
+            },
+            batchImportData(item) {
+                //首先判断文件类型
+                let str = item.file.name.split(".");
+                let format = str[str.length - 1];
+                if (format != "xls" && format != "xlsx") {
+                    this.$message({
+                        message: "请选择.xls或.xlsx文件",
+                        type: "error"
+                    });
+                } else {
+                    this.importingData = true;
+                    let formData = new FormData();
+                    formData.append("file", item.file);
+                    this.http.uploadFile('/provider-info/importData', formData,
+                    res => {
+                        this.$refs.upload.clearFiles();
+                        this.importingData = false;
+                        this.showImportResult = true;
+                        if (res.code == "ok") {
+                            //换成弹出框,以免有人等了半天回来啥也没看到
+                            this.importResultMsg = "成功导入/更新"+res.data+"条供应商数据。"+(res.msg?res.msg:"");
+                            this.getList();
+                        } else {
+                            this.importResultMsg = "导入失败:"+res.msg;
+                        }
+                    },
+                    error => {
+                        this.$refs.upload.clearFiles();
+                        this.importingData = false;
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                }
+            },
+            importProject(item) {
+                //首先判断文件类型
+                let str = item.file.name.split(".");
+                let format = str[str.length - 1];
+                if (format != "xls" && format != "xlsx") {
+                    this.$message({
+                        message: "请选择.xls或.xlsx文件",
+                        type: "error"
+                    });
+                } else {
+                    this.listLoading = true;
+                    let formData = new FormData();
+                    formData.append("file", item.file);
+                    formData.append("userId", this.user.id);
+                    this.http.uploadFile('/project/importData', formData,
+                    res => {
+                        this.$refs.upload.clearFiles();
+                        this.listLoading = false;
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: "导入成功",
+                                type: "success"
+                            });
+                            this.getList();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.$refs.upload.clearFiles();
+                        this.listLoading = false;
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                }
+            },
+            number(){  
+        //      this.addForm.budget = this.addForm.budget.replace(/[^\.\d]/g,'');
+        //         this.addForm.budget = this.addForm.budget.replace('.','');
+          },
+            deleteSubPro(subProject) {
+                this.$confirm("确定要删除子项目" + subProject.name + "吗?","删除子项目", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning"
+                })
+                .then(() => {
+                    this.listLoading = true;
+                    this.http.post('/sub-project/deleteProject',{ 
+                        id: subProject.id 
+                    },
+                    res => {
+                        this.listLoading = false;
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: "删除成功",
+                                type: "success"
+                            });
+                            this.subProject(this.currentProject);
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.listLoading = false;
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                        }
+                    );
+                })
+                .catch(() => {});
+            },
+            searchList() {
+                this.page = 1;
+                this.getList();
+            },
+            addNewSubProject(subProject) {
+                console.log(123);
+                if (subProject == null) {
+                    this.addForm = {projectId: this.currentProject.id, level:1}
+                } else {
+                    this.addForm = subProject;
+                }
+                this.addSubProject = true;
+            },
+            //显示子项目
+            subProject(item) {
+                this.subProjectVisible = true;
+                this.currentProject = item;
+                this.http.post('/sub-project/list', {
+                    projectId: item.id
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.subProjectList = res.data;
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            //显示用户详情
+            showUser(userId) {
+                this.userDetailVisible = true;
+                this.http.post(this.port.manage.userDetail, {
+                    userId: userId
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.userDetail = res.data;
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            
+            
+            //分页
+            handleCurrentChange(val) {
+                this.page = val;
+                this.getList();
+            },
+
+            handleSizeChange(val) {
+                this.size = val;
+                this.getList();
+            },
+
+            //获取项目列表
+            getList() {
+                this.listLoading = true;
+                this.http.post('/provider-info/list', {
+                    pageIndex: this.page,
+                    pageSize: this.size,
+                    keyword:this.keyword
+                },
+                res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        var list = res.data.records;
+                        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"
+                    });
+                });
+            },
+
+            //显示新增界面
+            handleAdd(i, item) {
+                if(i == -1) {
+                    this.title = "新增供应商";
+                    this.addForm = {
+                    }
+                } else {
+                    this.title = "修改供应商";
+                    this.addForm = JSON.parse(JSON.stringify(item));
+                }
+                this.addFormVisible = true;
+            },
+
+            submitInsert() {
+                this.$refs.form1.validate(valid => {
+                    if (valid) {
+                        this.addLoading = true;
+                        this.http.post('/provider-info/addOrMod', this.addForm,
+                        res => {
+                            this.addLoading = false;
+                            if (res.code == "ok") {
+                                this.addFormVisible = false;
+                                this.getList();
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: "error"
+                                });
+                            }
+                        },
+                        error => {
+                            this.addLoading = false;
+                            this.$message({
+                                message: error,
+                                type: "error"
+                            });
+                        });
+                        }
+                });
+            },
+
+            // 删除
+            deletePro(i, item) {
+                this.$confirm("确定要删除供应商" + item.providerName + "吗?","删除供应商", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning"
+                })
+                .then(() => {
+                    this.listLoading = true;
+                    this.http.post('/provider-info/delete',{ 
+                        id: item.id 
+                    },
+                    res => {
+                        this.listLoading = false;
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: "删除成功",
+                                type: "success"
+                            });
+                            this.getList();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.listLoading = false;
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                        }
+                    );
+                })
+                .catch(() => {});
+            },
+        },
+        created() {
+            let height = window.innerHeight;
+            this.tableHeight = height - 195;
+            const that = this;
+            window.onresize = function temp() {
+                that.tableHeight = window.innerHeight - 195;
+            };
+        },
+        mounted() {
+            this.getList();
+        }
+    };
+</script>
+
+<style lang="scss" scoped>
+.rg_span{
+    display: inline-block;
+}
+.rg_span span {
+    text-align: right;
+    box-sizing: border-box;
+    padding-right: 10px;
+}
+.el-dialog__title {
+    display: inline-table;
+    margin-top: 20px;
+}
+</style>

+ 64 - 9
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -70,6 +70,9 @@
                     <el-form-item style="float:right;" v-if="user.corpwxUserid != null && permissions.structureImport">
                         <el-link type="primary" :underline="false" @click="syncWithCorpWx">同步企微通讯录</el-link>
                     </el-form-item>
+                    <el-form-item style="float:right;" v-if="user.dingdingUserid != null && permissions.structureImport">
+                        <el-link type="primary" :underline="false" @click="syncWithCorpDingding">同步钉钉通讯录</el-link>
+                    </el-form-item>
 
                     <!-- <el-form-item style="float:right;" v-if="user.dingdingUserid == null && permissions.structureImport">
                         <el-link type="primary" :underline="false" href="./upload/人员导入模板.xlsx" download="人员导入模板.xlsx">模板下载</el-link>
@@ -84,7 +87,7 @@
                     </el-form-item> -->
                     <el-form-item style="float:right;">
                         <span style="color: #666666">角色</span>
-                        <el-select v-model="roleId" placeholder="请选择" @change="getUser()" style="width: 120px" clearable>
+                        <el-select v-model="roleId" placeholder="请选择" @change="getUser()" style="width: 120px" clearable size="small">
                             <!-- <el-option
                             v-for="item in rolesa"
                             :key="item.value"
@@ -96,7 +99,7 @@
                     </el-form-item>
                     <el-form-item style="float:right;">
                         <span style="color: #666666">状态</span>
-                        <el-select v-model="status" placeholder="请选择" @change="getUser()" style="width: 120px">
+                        <el-select v-model="status" placeholder="请选择" @change="getUser()" style="width: 120px" size="small">
                             <el-option
                             v-for="item in states"
                             :key="item.value"
@@ -106,12 +109,16 @@
                         </el-select>
                     </el-form-item>
                     <el-form-item style="float:right;">
-                        <div style="width: 250px;display: inline-block;">
-                            <el-input v-model="keyword" class="input-with-select" placeholder="请输入人员名字搜索" clearable="true">
+                        <div style="width: 200px;display: inline-block;margin-top: 4px">
+                            <el-input v-model="keyword" class="input-with-select" placeholder="请输入人员名字" clearable="true" size="small">
                                 <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button>
                             </el-input>
                         </div>
                     </el-form-item>
+                     <el-form-item style="float:right;" v-if="depData != null && depData.id != '-1'">
+                        <el-checkbox v-model="onlyDirect" @change="getUser()">直属员工</el-checkbox>
+                    </el-form-item>
+                     
                 </el-form>
             </el-col>
 
@@ -173,6 +180,7 @@
                     @current-change="handleCurrentChange"
                     :page-sizes="[20 , 50 , 80 , 100]"
                     :page-size="size"
+                    :current-page="page"
                     layout="total, sizes, prev, pager, next"
                     :total="total"
                     style="float:right;"
@@ -738,7 +746,8 @@
 
                 suoying: ['plate1','plate2','plate3','plate4','plate5'],
                 insertFormPlates: [],
-                saveBtnLoading: false
+                saveBtnLoading: false,
+                onlyDirect: false
             };
         },
         filters: {
@@ -844,6 +853,45 @@
                     })
                 })
             },
+            // 从钉钉同步通讯录
+            syncWithCorpDingding(){
+                this.$confirm('确认从钉钉同步通讯录吗?(可能需要一定的加载时间,请耐心等待)','提示',{
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(()=>{
+                    this.listLoading = true
+                    this.http.post('/company/syncCorpMembs',{},
+                    res => {
+                        this.listLoading = false
+                        if(res.code == 'ok'){
+                            this.$message({
+                                message: res.data,
+                                type: 'success'
+                            })
+                            this.getDepartment();
+                            this.getUser();
+                            this.getUsers();
+                        }else{
+                            this.$message({
+                                message: res.msg,
+                                type: 'error'
+                            })
+                        }
+                    },err => {
+                        this.listLoading = false
+                        this.$message({
+                            message: err,
+                            type: 'error'
+                        })
+                    })
+                }).catch(()=>{
+                    this.$message({
+                        message: '已取消操作',
+                        type: 'info'
+                    })
+                })
+            },
             test(){
                 this.getCustomConfigList()
             },
@@ -1229,12 +1277,14 @@
                                 message: '删除成功',
                                 type: "success"
                             });
+                            this.dialogVisible = false
                             this.getUser()
                         } else {
                             this.$message({
                             message: res.msg,
                             type: "error"
                             });
+                            this.dialogVisible = false
                         }
                     },
                     error => {
@@ -1242,6 +1292,7 @@
                             message: error,
                             type: "error"
                         });
+                        this.dialogVisible = false
                     });
                 })
             },
@@ -1549,16 +1600,19 @@
             //分页
             handleCurrentChange(val) {
                 this.page = val;
-                this.getUser();
+                this.getUser(1);
             },
 
             handleSizeChange(val) {
                 this.size = val;
-                this.getUser();
+                this.getUser(1);
             },
 
             //获取所有员工的列表
-            getUser() {
+            getUser(e) {
+                if(e != 1){
+                    this.page = 1
+                }
                 // console.log(12345)
                 this.listLoading = true;
                 this.http.post( this.port.manage.list, {
@@ -1568,7 +1622,8 @@
                     keyword: this.keyword,
                     status: this.status,
                     // role: this.role
-                    roleId: this.roleId
+                    roleId: this.roleId,
+                    onlyDirect: this.onlyDirect ? '1' : '0'
                 },
                 res => {
                     this.listLoading = false;

+ 47 - 9
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -8,7 +8,7 @@
                 <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
                         <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
                          style="width:190px;"
-                         @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
+                         @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份" :picker-options="getPickerOptions"></el-date-picker>
                          <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini"  @click="showWorkTime"></el-button>
                          <!-- <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini"  @click="tiaoshi"></el-button> -->
                     </div>
@@ -511,7 +511,7 @@
                         </el-form-item>
                         <!-- 自定义文本 -->
                         <el-form-item :label="yonghuUser.customTextName" v-if="yonghuUser.customTextActive == 1" :prop="'domains.' + index + '.customText'" :rules="user.timeType.customTextStatus == 1 ? { required: true, message: '请填写' + yonghuUser.customTextName, trigger: ['change','blur'] } : null">
-                            <el-input :disabled="!canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" maxlength="25" show-word-limit></el-input>
+                            <el-input :disabled="!canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" maxlength="1000"></el-input>
                         </el-form-item>
                         <!--项目管理专业版模式下,项目下的近期执行的任务 -->
                         <el-form-item label="任务/里程碑" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
@@ -1124,7 +1124,7 @@
         <!-- 工时导入记录弹窗 -->
         <el-dialog title="工时导入记录" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
             <div style="height: 452px">
-                <el-table :data="toViewList" stripe style="width: 100%;" height="400">
+                <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
                     <el-table-column prop="indate" label="导入时间"> </el-table-column>
                     <el-table-column prop="userName" label="操作人"> </el-table-column>
                     <el-table-column prop="datel" label="文件">
@@ -1288,6 +1288,30 @@
     export default {
         data() {
             return {
+                getPickerOptions: {
+                     disabledDate: (time) => {
+                        var date = new Date();
+                        var year = date.getFullYear();
+                        var month = date.getMonth() + 1;
+                        if (month >= 1 && month <= 9) {
+                            month = "0" + month;
+                        }
+                        var currentdate = year.toString()  + month.toString();
+            
+                        var timeyear = time.getFullYear();
+                        var timemonth = time.getMonth() + 1;
+                        if (timemonth >= 1 && timemonth <= 9) {
+                            timemonth = "0" + timemonth;
+                        }
+                        var timedate = timeyear.toString() + timemonth.toString();
+                        if(this.user.timeType.fillAhead == 0){
+                            return currentdate < timedate;
+                        }else{
+                            return false
+                        }
+                        
+                    }
+                },
                 alalal: '8.0',
                 timeBasecostList:null,
                 tbload: false,
@@ -1828,6 +1852,7 @@
                 if(this.isBatch == 0) {
                     return
                 }
+                
                 this.http.post('/report/getWorkDays',{ 
                     startDate: this.workForm.createDate[0],
                     endDate: this.workForm.createDate[1]
@@ -3328,12 +3353,18 @@
             // 改变月份     -------
             changeMonthOut() {
                 this.getAllDate();
+                
+                this.choseDay = 0;
+                sessionStorage.msg = this.date + '-01'
+                let monthdate = new Date(this.date + '-01')
+                this.curDate = (monthdate.getMonth() + 1) + '月' + monthdate.getDate() + '日'
                 this.getReportList();
                 this.getDepartment();
             },
 
             // 选择日期
             choseDate(i, item) {
+
                 if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
                     return
                 }
@@ -4592,12 +4623,15 @@
 
             // 改变月份
             changeMonth() {
+                let date = new Date()
+                let nowmon = date.getMonth() + 1
+                let nowday = date.getDate()
+                let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday) 
                 if (this.isBatch == 0) {
                     if(this.user.timeType.fillAhead == 0){
                         let date_a = new Date(this.workForm.createDate)
-                        let date_b = new Date(sessionStorage.msg)
-                        if(date_a.getTime() > date_b.getTime()){
-                            this.workForm.createDate = sessionStorage.msg
+                        if(date_a.getTime() > date.getTime()){
+                            this.workForm.createDate = nowdate
                         }
                     }
                     //只有按天填报才能获取当天的日报
@@ -4607,9 +4641,13 @@
                 }else {
                     if(this.user.timeType.fillAhead == 0){
                         let date_a = new Date(this.workForm.createDate[1])
-                        let date_b = new Date(sessionStorage.msg)
-                        if(date_a.getTime() > date_b.getTime()){
-                            this.workForm.createDate[1] = sessionStorage.msg
+                        if(date_a.getTime() > date.getTime()){
+                            this.workForm.createDate[1] = nowdate
+                            let sdate = new Date(this.workForm.createDate[0])
+                            let edate = new Date(this.workForm.createDate[1])
+                            if(sdate > edate){
+                                this.workForm.createDate[0] = this.workForm.createDate[1]
+                            }
                         }
                     }
                 }