Browse Source

提交文件

Lijy 10 months ago
parent
commit
13720e7887

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet/index.html

@@ -2,6 +2,7 @@
 <html>
 <html>
   <head>
   <head>
     <meta charset="utf-8" />
     <meta charset="utf-8" />
+    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
     <!-- 尝试清除打包缓存 -->
     <!-- 尝试清除打包缓存 -->
     <!-- <meta http-equiv="pragram" content="no-cache">
     <!-- <meta http-equiv="pragram" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">
         <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">

+ 5 - 0
fhKeeper/formulahousekeeper/timesheet/src/App.vue

@@ -94,4 +94,9 @@
         opacity: 0;
         opacity: 0;
     }
     }
 
 
+    .resetElEmtClass {
+        .el-dialog__body {
+            padding: 0 !important;
+        }
+    }
 </style>
 </style>

+ 8 - 1
fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json

@@ -2177,5 +2177,12 @@
   "qingJiaJiWeiTianBaoJiShi": "Leave calculation for timely reporting",
   "qingJiaJiWeiTianBaoJiShi": "Leave calculation for timely reporting",
   "qingShuRuHeXiaoYuanYing": "Please enter the reason for verification",
   "qingShuRuHeXiaoYuanYing": "Please enter the reason for verification",
   "wuXiaoJiaBan": "Invalid overtime",
   "wuXiaoJiaBan": "Invalid overtime",
-  "yiFaFangJIaBanGongShi": "Overtime pay has been paid"
+  "yiFaFangJIaBanGongShi": "Overtime pay has been paid",
+  "gongJiGongShi": "Total working hours",
+  "queRenZhuanYi": "Confirm transfer",
+  "tiaoShuJu": "Article data",
+  "yiXuanZe": "Selected",
+  "zhuanYIGongShi": "Transfer of working hours",
+  "zhuanYiChengGong": "Transfer successful",
+  "zhuanYiZhi": "Transfer to"
 }
 }

+ 8 - 1
fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json

@@ -2177,5 +2177,12 @@
   "jiaBanHeXiao": "加班核销",
   "jiaBanHeXiao": "加班核销",
   "qingShuRuHeXiaoYuanYing": "请输入核销原因",
   "qingShuRuHeXiaoYuanYing": "请输入核销原因",
   "yiFaFangJIaBanGongShi": "已发放加班工资",
   "yiFaFangJIaBanGongShi": "已发放加班工资",
-  "wuXiaoJiaBan": "无效加班"
+  "wuXiaoJiaBan": "无效加班",
+  "zhuanYIGongShi": "转移工时",
+  "yiXuanZe": "已选择",
+  "tiaoShuJu": "条数据",
+  "gongJiGongShi": "共计工时",
+  "zhuanYiZhi": "转移至",
+  "queRenZhuanYi": "确认转移",
+  "zhuanYiChengGong": "转移成功"
 }
 }

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

@@ -150,6 +150,7 @@
                                     <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">{{ $t('tuiSongGongShi') }}</el-link>
                                     <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">{{ $t('tuiSongGongShi') }}</el-link>
                                     <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">{{ $t('gongShiTuiSongRiZhi') }}</el-link>
                                     <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">{{ $t('gongShiTuiSongRiZhi') }}</el-link>
                                     <el-link type="primary" v-if="user.roleName == $t('role.superAdministrator') && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">{{ $t('riBaoShenHeXiuGai') }}</el-link>
                                     <el-link type="primary" v-if="user.roleName == $t('role.superAdministrator') && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">{{ $t('riBaoShenHeXiuGai') }}</el-link>
+                                    <el-link type="primary" v-if="(user.roleName == $t('role.superAdministrator') || user.roleName == $t('role.systemAdministrator')) && user.companyId==936" :underline="false" @click="transferWorkingHoursVisable=true">{{ $t('zhuanYIGongShi') }}</el-link>
                                     <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
                                     <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
                                 </span>
                                 </span>
                             </div>
                             </div>
@@ -2162,6 +2163,8 @@
             </div>
             </div>
         </el-dialog>
         </el-dialog>
         
         
+        <!-- 威派格定制 -->
+        <TransferWorkingHours v-model="transferWorkingHoursVisable" :projectList="projectList" :userList="usersList"></TransferWorkingHours>
     </section>
     </section>
 </template>
 </template>
 
 
@@ -2179,6 +2182,9 @@
 
 
     // 重庆物奇定制组件
     // 重庆物奇定制组件
     import WeeklyCustomization from "./weeklyCustomization.vue"
     import WeeklyCustomization from "./weeklyCustomization.vue"
+
+    // 威派格定制转移工时
+    import TransferWorkingHours from "./transferWorkingHours.vue"
     
     
     import { mapMutations } from 'vuex'
     import { mapMutations } from 'vuex'
     let _that = this
     let _that = this
@@ -2188,7 +2194,8 @@
             selectCat,
             selectCat,
             vueCascader,
             vueCascader,
             WeeklyCustomization,
             WeeklyCustomization,
-            vueMultipleDept
+            vueMultipleDept,
+            TransferWorkingHours
         },
         },
         data() {
         data() {
             return {
             return {
@@ -2507,6 +2514,8 @@
                 isReminder:true,
                 isReminder:true,
                 reportLogCheckDialog:false,
                 reportLogCheckDialog:false,
                 deptIdForHasReport:[],
                 deptIdForHasReport:[],
+
+                transferWorkingHoursVisable: false
             };
             };
         },
         },
         watch: {
         watch: {

+ 355 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/transferWorkingHours.vue

@@ -0,0 +1,355 @@
+<template>
+    <div class="resetElEmtClass">
+        <el-dialog :title="$t('zhuanYIGongShi')" :visible.sync="modelValue" width="90vw" :top="'8vh'" :before-close="handleClose">
+            <div class="transferWorkingHours">
+                <!-- 筛选条件 -->
+                <div class="transferWorkingHours-title">
+                    <el-form :inline="true" :model="filterCriteriaForm" class="demo-form-inline">
+                        <el-form-item :label="$t('ren-yuan')">
+                            <el-select v-model="filterCriteriaForm.userList" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable
+                                collapse-tags size="small" @change="filterSelect()" v-if="user.userNameNeedTranslate != 1">
+                                <el-option v-for="item in allUserList" :key="item.id" :label="item.name" :value="item.id">
+                                </el-option>
+                            </el-select>
+                            <selectCat :filterable="true" :size="'small'" v-if="user.userNameNeedTranslate == 1"
+                                :subject="allUserList" :clearable="true" :multiSelect="true" :distinction="'1'"
+                                :expandPersonnel="false" @selectCal="selectCal"></selectCat>
+                        </el-form-item>
+                        <el-form-item :label="$t('screening.workingDate')">
+                            <el-date-picker size="small" v-model="filterCriteriaForm.workDate" :editable="false"
+                                format="yyyy-MM-dd" value-format="yyyy-MM-dd" :clearable="true" @change="filterSelect()"
+                                :range-separator="$t('other.to')" type="daterange" :start-placeholder="$t('time.startDate')"
+                                :end-placeholder="$t('time.endDate')"></el-date-picker>
+                        </el-form-item>
+                        <el-form-item :label="$t('other.project')">
+                            <el-select v-model="filterCriteriaForm.projectId" clearable :placeholder="$t('defaultText.pleaseChoose')" size="small"
+                                @change="filterSelect()">
+                                <el-option v-for="item in allProjectList" :key="item.id" :label="item.projectName"
+                                    :value="item.id">
+                                    <span style="float: left">{{ item.projectName }}</span>
+                                    <span style="float: right; color: #8492a6; font-size: 13px">{{ item.projectCode
+                                    }}</span>
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                    </el-form>
+                </div>
+                <!-- 表格 -->
+                <div>
+                    <el-table :data="tableData" ref="multipleTable" height="50vh" border v-loading="tableDataLoading"
+                        @selection-change="handleSelectionChange" style="width: 100%">
+                        <el-table-column align="center" type="selection" width="55"></el-table-column>
+                        <el-table-column align="center" prop="jobNumber" :label="$t('Worknumber')" width="180"></el-table-column>
+                        <el-table-column align="center" prop="userName" :label="$t('lable.name')" width="180">
+                            <template slot-scope="scope">
+                                <TranslationOpenDataText type='userName' :openid='scope.row.userName'>
+                                </TranslationOpenDataText>
+                            </template>
+                        </el-table-column>
+                        <el-table-column align="center" prop="deptName" :label="$t('subordinatedepartments')" width="180">
+                            <template slot-scope="scope">
+                                <TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'>
+                                </TranslationOpenDataText>
+                            </template>
+                        </el-table-column>
+                        <el-table-column align="center" prop="projectCode" :label="$t('Itemno')" width="240"></el-table-column>
+                        <el-table-column align="center" prop="projectName" :label="$t('headerTop.projectName')" width="240"></el-table-column>
+                        <el-table-column align="center" prop="createDate" :label="$t('screening.workingDate')" width="180"></el-table-column>
+                        <el-table-column align="center" prop="workingTime" :label="$t('screening.workTime')" width="100"></el-table-column>
+                        <el-table-column align="center" prop="groupName" :label="$t('other.taskGroup')" width="180"></el-table-column>
+                        <el-table-column align="center" prop="stageName" :label="$t('other.inputStage')" width="180"></el-table-column>
+                    </el-table>
+                </div>
+                <!-- 分页 -->
+                <div class="transferWorkingHours-paging">
+                    <div>{{ $t('yiXuanZe') }} {{ tableSelected.length }} {{ $t('tiaoShuJu') }},{{ $t('gongJiGongShi') }}:{{ totalWorkingHours }} {{ $t('time.hour') }}</div>
+                    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+                        :current-page="pagingForm.pageIndex" :page-sizes="[30, 50, 100, 150, 200, 300]"
+                        :page-size="pagingForm.pageSize" layout="prev, pager, next, sizes" :total="pagingTotal">
+                    </el-pagination>
+                </div>
+                <!-- 转移至 -->
+                <div slot="footer">
+                    <el-form :inline="true" :model="transform" class="demo-form-inline">
+                        <el-form-item :label="$t('zhuanYiZhi')">
+                            <el-select v-model="transform.projectId" clearable :placeholder="$t('defaultText.pleaseChoose')" size="small"
+                                :disabled="!tableSelected.length" @change="changeProject()">
+                                <el-option v-for="item in allProjectList" :key="item.id" :label="item.projectName"
+                                    :value="item.id">
+                                    <span style="float: left">{{ item.projectName }}</span>
+                                    <span style="float: right; color: #8492a6; font-size: 13px">{{ item.projectCode
+                                    }}</span>
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item>
+                            <el-select v-model="transform.taskGroupingId" clearable :placeholder="$t('defaultText.pleaseSelectaTaskGroup')"
+                                :disabled="!transform.projectId" size="small" @change="changeTaskGroup()">
+                                <el-option v-for="item in taskGroupingList" :key="item.id" :label="item.name"
+                                    :value="item.id"></el-option>
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item>
+                            <el-select v-model="transform.stageId" clearable :placeholder="$t('pleaseselecttheprojectphase')"
+                                :disabled="!(transform.projectId && transform.taskGroupingId)" size="small">
+                                <el-option v-for="item in stageList" :key="item.id" :label="item.stagesName"
+                                    :value="item.id">
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item>
+                            <el-button type="primary" :size="'small'" :loading="confirmTransformLoading"
+                                @click="confirmTransform()"
+                                :disabled="!(transform.projectId && transform.taskGroupingId && transform.stageId)">{{ $t('queRenZhuanYi') }}</el-button>
+                        </el-form-item>
+                    </el-form>
+                </div>
+            </div>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+import selectCat from "@/components/select.vue"
+export default {
+    name: '',
+    components: {
+        selectCat
+    },
+    props: {
+        modelValue: {
+            type: Boolean,
+            default: () => false
+        },
+        projectList: {
+            type: Array,
+            default: () => []
+        },
+        userList: {
+            type: Array,
+            default: () => []
+        }
+    },
+    data() {
+        return {
+            user: JSON.parse(sessionStorage.getItem("user")),
+            allProjectList: [],
+            allUserList: [],
+            taskGroupingList: [],
+            stageList: [],
+            transform: {
+                projectId: '',
+                taskGroupingId: '',
+                stageId: ''
+            },
+            filterCriteriaForm: {
+                userList: [],
+                workDate: [],
+                projectId: ''
+            },
+            pagingForm: {
+                pageIndex: 1,
+                pageSize: 100
+            },
+            pagingTotal: 0,
+            tableSelected: [],
+            tableData: [],
+            tableDataLoading: false,
+            confirmTransformLoading: false
+        }
+    },
+    computed: {
+        totalWorkingHours() {
+            return this.tableSelected.reduce((total, item) => {
+                let num = item.workingTime || 0
+                return total + Number(num)
+            }, 0)
+        }
+    },
+    watch: {
+        modelValue(val) {
+            if (val) {
+                this.emptyFilterData()
+                this.getTableList()
+            }
+            this.updateModelValue()
+        },
+        projectList(val) {
+            this.allProjectList = val
+        },
+        userList(val) {
+            this.allUserList = val
+        }
+    },
+    model: {
+        prop: 'modelValue',
+        event: 'getValue'
+    },
+    created() { },
+    mounted() { },
+    methods: {
+        async confirmTransform() {
+            const { projectId, taskGroupingId, stageId } = this.transform
+            const reportIds = this.tableSelected.map(item => item.reportId).join(',')
+            this.confirmTransformLoading = true
+            const { data, code } = await this.postData('/report/transferReport', {
+                reportIds, projectId, stageId,
+                groupId: taskGroupingId,
+            })
+
+            if (code == 'ok') {
+                this.$message({
+                    message: this.$t('zhuanYiChengGong'),
+                    type: "success"
+                });
+                this.pagingForm.pageIndex = 1
+                this.emptyBasicData()
+                this.getTableList()
+            }
+            this.confirmTransformLoading = false
+        },
+        async getTableList() {
+            const { userList, workDate, projectId } = this.filterCriteriaForm
+            this.tableDataLoading = true
+            const { data } = await this.postData('/report/getReportListWithTransfer ', {
+                startDate: workDate[0],
+                endDate: workDate[1],
+                userIds: userList.join(','),
+                projectId: projectId,
+                ...this.pagingForm
+            })
+            this.tableDataLoading = false
+            this.tableData = data.result
+            this.pagingTotal = data.count
+        },
+        async getTaskGroups() {
+            const { projectId } = this.transform
+            let { data } = await this.postData('/task-group/listMyJoinGroup', {
+                projectId,
+                isSubstitude: 1
+            })
+            this.taskGroupingList = data
+        },
+        async getGroupStages() {
+            const { taskGroupingId } = this.transform
+            let { data } = await this.postData('/stages/getProjectStagesByGroup', {
+                groupId: taskGroupingId
+            })
+            this.stageList = data
+        },
+        filterSelect() {
+            this.pagingForm.pageIndex = 1
+            this.getTableList()
+        },  
+        emptyBasicData() {
+            this.transform = {
+                projectId: '',
+                taskGroupingId: '',
+                stageId: ''
+            }
+            this.taskGroupingList = []
+            this.stageList = []
+        },
+        emptyFilterData() {
+            this.filterCriteriaForm = {
+                userList: [],
+                workDate: [],
+                projectId: ''
+            }
+        },
+        changeTaskGroup() {
+            const { taskGroupingId } = this.transform
+            if (taskGroupingId) {
+                this.getGroupStages()
+            } else {
+                this.transform = {
+                    ...this.transform,
+                    stageId: ''
+                }
+                this.stageList = []
+            }
+        },
+        changeProject() {
+            const { projectId } = this.transform
+            if (projectId) {
+                this.getTaskGroups()
+            } else {
+                this.transform = {
+                    projectId: '',
+                    taskGroupingId: '',
+                    stageId: ''
+                }
+                this.taskGroupingList = []
+                this.stageList = []
+            }
+        },
+        handleSelectionChange(row) {
+            this.tableSelected = row
+        },
+        handleSizeChange(size) {
+            this.pagingForm = {
+                pageIndex: 1,
+                pageSize: size
+            }
+            this.getTableList()
+        },
+        handleCurrentChange(page) {
+            this.pagingForm.pageIndex = page
+            this.getTableList()
+        },
+        updateModelValue() {
+            this.$emit('getValue', this.modelValue);
+            this.$emit('change', this.modelValue);
+        },
+        selectCal(obj) {
+            if (obj.distinction == 1) {
+                let userListId = obj.arrUserList
+                let arr = []
+                for (var i in userListId) {
+                    arr.push(userListId[i].id)
+                }
+                this.filterCriteriaForm.userList = arr
+                this.filterSelect()
+            }
+        },
+        // 封装 post 请求
+        postData(url, params) {
+            return new Promise((resolve, reject) => {
+                this.http.post(url, { ...params },
+                    res => {
+                        if (res.code == 'ok') {
+                            resolve(res)
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                            reject(error)
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                        reject(error)
+                    })
+            })
+        },
+    },
+}
+</script>
+<style scoped lang='scss'>
+.transferWorkingHours {
+    padding: 0 20px;
+
+    .transferWorkingHours-title {}
+
+    .transferWorkingHours-paging {
+        margin: 10px 0;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+    }
+}
+</style>