Explorar o código

Merge remote-tracking branch 'origin/master'

yusm hai 6 meses
pai
achega
08b3c1361f

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

@@ -1123,7 +1123,9 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
         list.add(unAssignedDept);
 
         List<User> userList = new ArrayList<>();
-        userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId).eq("is_active", 1));
+        QueryWrapper<User> queryWrapper = new QueryWrapper<User>().eq("company_id", companyId);
+        //代填时,可以选择全部人员范围,包含已离职的
+        userList = userMapper.selectList(queryWrapper);
 
         List<HashMap> userMapList = new ArrayList<>();
         for (User u : userList) {

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

@@ -6002,14 +6002,14 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     }
                 }
                 if (cnt > 0 || auditorPids != null) {
-                    if (timeType.getShowFillauditTime() == 1) {
+                    if (exportType == 0 && timeType.getShowFillauditTime() == 1) {
                         reportsFromProjects = reportMapper.getProjectMembReportByDateWithReportLog(startDate, null, user.getId(), endDate, projectId,stateKey,branchDepartment, auditorPids);
                     } else{
                         reportsFromProjects = reportMapper.getProjectMembReportByDate(startDate, null, user.getId(), endDate, projectId,stateKey,branchDepartment, auditorPids);
                     }
                 } else {
                     //普通员工只能看自己的
-                    if (timeType.getShowFillauditTime() == 1) {
+                    if (exportType == 0 && timeType.getShowFillauditTime() == 1) {
                         reportsFromProjects = reportMapper.getAllReportByDateWithReportLog(startDate, null, user.getId(), endDate, projectId,stateKey,branchDepartment);
                     } else {
                         reportsFromProjects = reportMapper.getAllReportByDate(startDate, null, user.getId(), endDate, projectId,stateKey,branchDepartment);
@@ -6032,7 +6032,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             else {
                 //看公司所有人的
                 long t1 = System.currentTimeMillis();
-                if (timeType.getShowFillauditTime() == 1) {
+                if (exportType == 0 && timeType.getShowFillauditTime() == 1) {
                     allReportByDate = reportMapper.getAllReportByDateWithReportLog(startDate, user.getCompanyId(), null, endDate, projectId,stateKey,branchDepartment);
                 } else {
                     allReportByDate = reportMapper.getAllReportByDate(startDate, user.getCompanyId(), null, endDate, projectId,stateKey,branchDepartment);

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

@@ -187,7 +187,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 row.createCell(3).setCellValue(new BigDecimal(String.valueOf(map.get("planHours"))).doubleValue());
                 HSSFCell percentCell = row.createCell(4);
                 if (map.get("planHours") != null) {
-                    int percent = (int)(double) map.get("workHours")*100/new BigDecimal(String.valueOf(map.get("planHours"))).intValue();
+                    int percent = 0;
+                    int planHours = new BigDecimal(String.valueOf(map.get("planHours"))).intValue();
+                    if (planHours > 0) {
+                        percent = (int)(double) map.get("workHours")*100/planHours;
+                    }
+
                     percent = (percent - 100);
                     String sign = "";
                     if (percent > 0) {

+ 3 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml

@@ -75,7 +75,7 @@
         JOIN project AS b ON a.project_id=b.id
         LEFT JOIN project_separate AS ps on b.id=ps.id
         LEFT JOIN user AS c ON a.creator_id=c.id
-        LEFT JOIN user_with_beisen AS uwb ON uwb.job_number=c.job_number
+        LEFT JOIN user_with_beisen AS uwb ON uwb.job_number=c.job_number and uwb.company_id=c.company_id
         left join sub_project as d on d.id = a.sub_project_id
         left join task on task.id = a.task_id
         left join report_extra_degree on report_extra_degree.id = a.degree_id
@@ -132,7 +132,7 @@
         JOIN project AS b ON a.project_id=b.id
         LEFT JOIN project_separate AS ps on b.id=ps.id
         LEFT JOIN user AS c ON a.creator_id=c.id
-        LEFT JOIN user_with_beisen AS uwb ON uwb.job_number=c.job_number
+        LEFT JOIN user_with_beisen AS uwb ON uwb.job_number=c.job_number and uwb.company_id=c.company_id
         left join sub_project as d on d.id = a.sub_project_id
         left join task on task.id = a.task_id
         left join report_extra_degree on report_extra_degree.id = a.degree_id
@@ -1152,7 +1152,7 @@
         case  when p.man_day*8-SUM(r.working_time) &gt;= 0 then '否' else '是' end as isOver ,case when p.man_day*8-SUM(r.working_time) &gt; 0 then (p.man_day*8-SUM(r.working_time)) else '0' end as remaining,
         (select GROUP_CONCAT(CONCAT(u.job_number,'/',uwb.name)) from participation pa
         left join user u on pa.user_id=u.id
-        left join user_with_beisen uwb on u.job_number=uwb.job_number
+        left join user_with_beisen uwb on u.job_number=uwb.job_number and uwb.company_id=u.company_id
         where pa.project_id=p.id ) as participations
         from project p
         left join project_main pm on p.project_main_id=pm.id

+ 3 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/contract/components/customContract.vue

@@ -292,11 +292,11 @@
                       <span style="font-size:14px;font-weight:normal;">是否已付款</span>
                   </template>
               </el-table-column>
-                <el-table-column prop="payDate" label="付款日期" width="150">
+                <!-- <el-table-column prop="payDate" label="付款日期" width="150">
                   <template slot-scope="scope">
                       <div><el-date-picker type="date" v-model="scope.row.payDate" style="width:140px;" :placeholder="$t('optiondate')" value-format="yyyy-MM-dd" size="small"></el-date-picker></div>
                   </template>
-                </el-table-column>
+                </el-table-column> -->
                 <el-table-column prop="payedAmount" label="已付款金额(元)" width="160">
                   <template slot-scope="scope">
                     <el-input-number v-model="scope.row.payedAmount" controls-position="right" @change="chgPayedAmount()" :min="0" size="small" :precision="2" :controls="false"></el-input-number>
@@ -500,7 +500,7 @@
                           <span style="font-size:14px;font-weight:normal;">是否已付款</span>
                       </template>
                   </el-table-column>
-                  <el-table-column prop="payDate" label="付款日期" width="150"></el-table-column>
+                  <!-- <el-table-column prop="payDate" label="付款日期" width="150"></el-table-column> -->
                   <el-table-column prop="payedAmount" label="已付款金额(元)" width="160"></el-table-column>
                   <el-table-column prop="payType" label="付款类型" width="140">
                     <template slot-scope="scope">

+ 11 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue

@@ -107,7 +107,7 @@
                           <el-option v-for="item in qjType" :key="item.id" :label="item.name" :value="item.id"></el-option>
                     </el-select>
                     <template  v-if="addForm.leaveType == 6">
-                      <span style="margin-left:18px;color:#777;">{{ $t('restcanbeadjusted') }} {{addForm.ownerId != '' ? txselnum : '~'}} {{ $t('time.day') }}</span>
+                      <span style="margin-left:18px;color:#777;">{{ $t('restcanbeadjusted') }} {{addForm.ownerId != '' ? txselnum : '~'}} {{ addForm.timeType == 0 ? '天' : '小时' }}</span>
                       <el-tooltip effect="dark" :content="$t('overtimhourscabeusedforoffsetting')" placement="top-start">
                         <i class="el-icon-question" style="color:#606266;"></i>
                       </el-tooltip>
@@ -914,6 +914,7 @@ export default {
 
       // ---------
       txselnum: 0,
+      txselnumTwo: 0,
 
       approverList: [],
       isSyncData: 0,
@@ -1895,6 +1896,7 @@ export default {
             }else{
               this.txselnum = res.data.toFixed(1)
             }
+            this.txselnumTwo = res.data
           } else {
             this.$message({
               message: res.msg,
@@ -1926,6 +1928,7 @@ export default {
             this.addForm.timeType = '0'
             this.addForm.timeDays = '1'
             this.addForm.timeHours = '8'
+            this.txselnum = this.txselnumTwo > 0.5 ? this.txselnumTwo.toFixed(1) : 0
         } else {
             this.flg = false
             this.addForm.startDate = this.getCurrentTime()
@@ -1933,8 +1936,15 @@ export default {
             this.addForm.timeType = '1'
             this.addForm.timeHours = 1,
             this.addForm.timeDays = 1
+            this.txselnum = this.dayToHourConversion(this.txselnumTwo)
         }
     },
+    dayToHourConversion(val) {
+        let value = +val;  
+        let workHours = 8;   
+        let result = value * workHours; 
+        return result.toFixed(1);
+    },
     // 计算日期
     datas() {
         // this.addForm.timeDays = this.DateDiff(this.addForm.startDate, this.addForm.endDate)

+ 8 - 7
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -307,9 +307,9 @@ export default {
 
             // 先将数据置空,防止数据残留
             this.echartsEcharData = [{ data: [] }]
-
+            
             // 分页数据
-            if (this.singleChoiceType != '人员') {
+            if (this.singleChoiceType != '人员' && this.departmentPersonnel != 2) {
                 this.pageTotal = this.allListData.costList ? this.allListData.costList.length : 0
                 list = this.allListData.costList && this.allListData.costList.slice(0 + 10 * (this.pageIndex - 1), 49 + 50 * (this.pageIndex - 1))
 
@@ -327,9 +327,9 @@ export default {
                 newBarChartOptions = this.projectClassificationChartData(list, totalMoneyCost, newBarChartOptions)
             } else if (this.singleChoiceType == '设备') {
                 newBarChartOptions = this.equipmentChartData(list, totalMoneyCost, newBarChartOptions)
-            } else if (this.singleChoiceType == '部门') {
+            } else if (this.singleChoiceType == '部门' && this.departmentPersonnel != 2) {
                 newBarChartOptions = this.processDepartmentalChartData(list, totalMoneyCost, newBarChartOptions)
-            } else if (this.singleChoiceType == '人员') {
+            } else if (this.singleChoiceType == '人员' || this.departmentPersonnel == 2) {
                 newBarChartOptions = this.personnelChartData(totalMoneyCost)
             } else if (this.theCustomListFlg) {
                 this.pageTotal = this.allListData.list ? this.allListData.list.length : 0
@@ -440,7 +440,7 @@ export default {
             const paginatedList = list.slice(startIndex, endIndex);
 
             let totalHours = this.totalHours.toFixed(1);
-            const totalMoneyCost = totalCostMoney;
+            let totalMoneyCost = totalCostMoney;
 
             this.hasReportUserList = userList;
             this.pageTotal = list ? list.length : 0;
@@ -550,6 +550,7 @@ export default {
             }
 
             let chartData = { ...barChartOptions }
+            totalMoneyCost = totalMoneyCost.toFixed(2)
             chartData.title = {
                 ...chartData.title,
                 text: `工时成本总计:${countCost ? `成本 ${totalMoneyCost},` : ''} ${countHours ? `时长 ${totalHours} 小时` : ''}`
@@ -652,7 +653,7 @@ export default {
 
             totalHours = this.totalHours.toFixed(1);
             totalMoneyCost = totalMoneyCost.toFixed(2)
-
+            console.log(xList, yList, list, '<==== xList, yList,')
             return { ...this.sameChartProcessing(xList, yList, totalHours, totalMoneyCost, chartData) }
         },
         projectClassificationChartData(list, totalMoneyCost = 0, chartData) { // 处理项目分类图表数据
@@ -929,7 +930,7 @@ export default {
                                     this.getEchart()
                                 }
                             } else {
-                                if (this.departmentadio == '2') {
+                                if (this.departmentPersonnel == '2') {
                                     return
                                 }
                                 if (this.chartDate != null) {

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

@@ -5443,7 +5443,7 @@
             //获取可以选择的代填的人员列表
             getSubstitudeUserDeptList() {
                 if (this.deptMembData.length == 0) {
-                    this.http.post("/department/listMyMembs", {},
+                    this.http.post("/department/listMyMembs", {includeInactiveUser: 1},
                         res => {
                             if (res.code == "ok") {
                                 let noAllData = JSON.parse(JSON.stringify(res.data));

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

@@ -244,7 +244,7 @@
                 </el-table-column>
                 <el-table-column label="工作内容" v-if="user.companyId == 469" width="480">
                     <template slot-scope="scope">
-                        <span v-for="(item, index) in scope.row.data" style="margin-right:10px;"><b>{{item.project}}</b>{{ ':'+item.content }}</span>
+                        <span v-for="(item, index) in scope.row.data" style="margin-right:10px;" ><template v-if="index==0 || (index>0 && (scope.row.data[index-1].content != item.content))"><b>{{item.project}}</b>{{ ':'+item.content }}</template></span>
                     </template>
                 </el-table-column>
                 <el-table-column prop="state" :label="$t('state.states')" sortable width="200">

+ 15 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/exaLeave/applyLeave.vue

@@ -15,6 +15,11 @@
                 <!-- 请假类型 -->
                 <van-field v-model="editForm.leaveType" label="请假类型" @click="typeShow = true" readonly clickable>
                     <template #input>{{typeList[editForm.leaveType]}}</template>
+                    <template #extra>
+                        <span v-if="editForm.leaveType == 6" style="color: #C8C9CC">
+                            {{ txselnum }} {{ editForm.timeType == 0 ? '天' : '小时' }}
+                        </span>
+                    </template>
                 </van-field>
                 <van-popup v-model="typeShow" position="bottom">
                     <van-picker
@@ -191,6 +196,7 @@ export default {
             leaveFil: false,
             active: 0,
             txselnum: 0,
+            txselnumTwo: 0,
             editForm: {
                 leaveType: 0,
                 ownerId: '',
@@ -320,15 +326,23 @@ export default {
                 }else{
                     this.formshowText.dateTitle = ''
                 }
+                this.txselnum = this.txselnumTwo > 0.5 ? this.txselnumTwo.toFixed(1) : 0
             }else{
                 if(this.editForm.startDate){
                     this.formshowText.dateTitle = this.editForm.startDate
                 }else{
                     this.formshowText.dateTitle = ''
                 }
+                this.txselnum = this.dayToHourConversion(this.txselnumTwo)
             }
             
         },
+        dayToHourConversion(val) {
+            let value = +val;  
+            let workHours = 8;   
+            let result = value * workHours; 
+            return result.toFixed(1);
+        },
         dateShow(){
             
             if(this.editForm.timeType == '0'){
@@ -545,6 +559,7 @@ export default {
                     }else{
                         this.txselnum = res.data.toFixed(1)
                     }
+                    this.txselnumTwo = res.data
                 } else {
                     this.$toast.fail('获取失败');
                 }