소스 검색

2022.8.19 八爪鱼客户操作日志、企业管理其他设置添加设置|| 工时管家批量设置项目经理

ggooalice 2 년 전
부모
커밋
f8dfffae18

+ 12 - 11
fhKeeper/formulahousekeeper/octopus/src/routes.js

@@ -11,6 +11,7 @@ import Home from './views/Home.vue'
 import daily from './views/workReport/daily.vue'
 
 import reviewImport from './views/workReport/list_import.vue'
+import review from './views/workReport/review.vue'
 
 // 项目管理
 import list from './views/project/list.vue'
@@ -143,26 +144,26 @@ export const allRouters = [//组织架构
     //         { path: '/reviewDepartment', component: reviewDepartment, name: '部门审核' },
     //     ]
     // },
-    // {
-    //     path: '/',
-    //     component: Home,
-    //     name: '项目报告审核',
-    //     iconCls: 'iconfont firerock-iconshenhe',
-    //     leaf: true,
-    //     children: [
-    //         { path: '/review', component: review, name: '项目报告审核' },
-    //     ]
-    // },
     {
         path: '/',
         component: Home,
-        name: '导入日报审核',
+        name: '项目报告审核',
         iconCls: 'iconfont firerock-iconshenhe',
         leaf: true,
         children: [
             { path: '/reviewImport', component: reviewImport, name: '操作记录' },
         ]
     },
+    {
+        path: '/',
+        component: Home,
+        name: '导入日报审核',
+        iconCls: 'iconfont firerock-iconshenhe',
+        leaf: true,
+        children: [
+            { path: '/review', component: review, name: '客户操作日志' },
+        ]
+    },
     {
         path: '/',
         component: Home,

+ 7 - 1
fhKeeper/formulahousekeeper/octopus/src/views/customer/list.vue

@@ -198,7 +198,9 @@
                 <el-form-item><el-checkbox v-model="dialogData.projectLevelState">是否开启项目级别自定义</el-checkbox></el-form-item>
                 <el-form-item><el-checkbox v-model="dialogData.outputValueStatus">是否开启项目产值字段</el-checkbox></el-form-item>
                 <el-form-item><el-checkbox v-model="dialogData.choseFromAlbum">是否开启从相册选择</el-checkbox></el-form-item>
-                <el-form-item><el-checkbox v-model="dialogData.reportApproveMsgpush">日报审核通过是否发送通知</el-checkbox></el-form-item>
+                <el-form-item><el-checkbox v-model="dialogData.reportApproveMsgpush">日报审核通过是否推送消息</el-checkbox></el-form-item>
+                <el-form-item><el-checkbox v-model="dialogData.projectWithDept">项目是否有所属部门</el-checkbox></el-form-item>
+                <el-form-item><el-checkbox v-model="dialogData.financeJobnumEnabled">财务导入薪资是否支持工号</el-checkbox></el-form-item>
                 <el-form-item>
                     日报审核模式:
                     <el-select v-model="dialogData.reportAuditType" size="small">
@@ -345,6 +347,8 @@
                             this.$set(this.dialogData,'outputValueStatus',res.data.outputValueStatus ? true : false)
                             this.$set(this.dialogData,'choseFromAlbum',res.data.choseFromAlbum ? true : false)
                             this.$set(this.dialogData,'reportApproveMsgpush',res.data.reportApproveMsgpush ? true : false)
+                            this.$set(this.dialogData,'projectWithDept',res.data.projectWithDept ? true : false)
+                            this.$set(this.dialogData,'financeJobnumEnabled',res.data.financeJobnumEnabled ? true : false)
                             this.$set(this.dialogData,'reportAuditType',res.data.reportAuditType)
                         }else{
                             this.$message({
@@ -595,6 +599,8 @@
                     outputValueStatus: this.dialogData.outputValueStatus ? 1 : 0,
                     choseFromAlbum: this.dialogData.choseFromAlbum ? 1 : 0,
                     reportApproveMsgpush: this.dialogData.reportApproveMsgpush ? 1 : 0,
+                    projectWithDept: this.dialogData.projectWithDept ? 1 : 0,
+                    financeJobnumEnabled: this.dialogData.financeJobnumEnabled ? 1 : 0,
                     reportAuditType: this.dialogData.reportAuditType
                 },res => {
                     if(res.code == 'ok'){

+ 2 - 2
fhKeeper/formulahousekeeper/octopus/src/views/workReport/list_import.vue

@@ -81,10 +81,10 @@
         },
         created() {
             let height = window.innerHeight;
-            this.tableHeight = height - 195;
+            this.tableHeight = height - 120;
             const that = this;
             window.onresize = function temp() {
-                that.tableHeight = window.innerHeight - 195;
+                that.tableHeight = window.innerHeight - 120;
             };
         },
         mounted() {

+ 179 - 0
fhKeeper/formulahousekeeper/octopus/src/views/workReport/review.vue

@@ -0,0 +1,179 @@
+<template>
+    <section>
+        <el-col :span="24" class="toolbar" style="">
+            <div style="display:flex;justify-content: left;align-items: center;">
+                <el-input id="contractAmount" v-model="paramCompanyId" placeholder="输入公司ID" @keyup.native="restrictNumber('contractAmount')" style="width:200px" clearable size="small"></el-input>
+                <el-button size="small" @click="toolbarSelect()">确定</el-button>
+                <el-date-picker 
+                v-model="dateArray" 
+                type="daterange" 
+                range-separator="至" 
+                :clearable="false" 
+                value-format="yyyy-MM-dd"
+                format="yyyy-MM-dd"
+                size="small" 
+                style="margin-left:20px"
+                @change="toolbarSelect()"
+                ></el-date-picker>
+                
+            </div>
+        </el-col>
+        
+        <el-table :data="tableList" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
+            <el-table-column prop="companyName" label="公司名称" min-width="160"></el-table-column>
+            <el-table-column prop="moduleName" label="模块" min-width="80"></el-table-column>
+            <el-table-column prop="operatorName" label="操作人" min-width="100"></el-table-column>
+            <el-table-column prop="operationTime" label="操作时间" min-width="200">
+                <template slot-scope="scope">
+                    <span>{{timeString(scope.row.operationTime)}}</span>
+                </template>
+            </el-table-column>
+            <el-table-column prop="content" label="操作内容" min-width="500">
+                <template slot-scope="scope">
+                    <div v-for="item,index in contentString(scope.row.content)" :key="index">{{item}}</div>
+                    <!-- <span>{{contentString(scope.row.content)}}</span> -->
+                    <!-- <span>{{scope.row.content}}</span> -->
+                </template>
+            </el-table-column>
+        </el-table>
+
+        <!--工具条-->
+        <el-col :span="24" class="toolbar">
+            <el-pagination
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :page-sizes="[20, 50 , 80 , 100]"
+                :page-size="20"
+                :current-page="page"
+                layout="total, sizes, prev, pager, next"
+                :total="total"
+                style="float:right;"
+            ></el-pagination>
+        </el-col>
+        
+    </section>
+</template>
+<script>
+    export default {
+        data() {
+            return {
+                listLoading: false,
+                tableHeight: 0,
+                page: 1,
+                size: 20,
+                total: 0,
+
+                tableList: [],
+                dateArray: [],
+                paramCompanyId: ''
+            }
+        },
+        created() {
+            let height = window.innerHeight;
+            this.tableHeight = height - 180;
+            const that = this;
+            window.onresize = function temp() {
+                that.tableHeight = window.innerHeight - 180;
+            };
+
+            let date = new Date()
+            let datemonth = date.getMonth() + 1
+            let dateday = date.getDate()
+            let datestr1 = date.getFullYear()+'-'+(datemonth<10?'0'+datemonth:datemonth)+'-'+(dateday<10?'0'+dateday:dateday)
+
+            let date2 = new Date(date.getFullYear(),date.getMonth(),date.getDate()-7)
+            let date2month = date2.getMonth() + 1
+            let date2day = date2.getDate()
+            let datestr2 = date2.getFullYear()+'-'+(date2month<10?'0'+date2month:date2month)+'-'+(date2day<10?'0'+date2day:date2day)
+            this.dateArray = [datestr2,datestr1]
+        },
+        mounted() {
+            this.getTableList()
+        },
+        methods: {
+
+            toolbarSelect(){
+                this.page = 1
+                this.getTableList()
+            },
+            getTableList(){
+                this.listLoading = true
+                this.http.post('/operation-record/getList',{
+                    startDate: this.dateArray[0],
+                    endDate: this.dateArray[1],
+                    companyId: this.paramCompanyId,
+                    pageIndex: this.page,
+                    pageSize: this.size,
+                },res => {
+                    this.listLoading = false
+                    if(res.code == 'ok'){
+                        this.total = res.data.total
+                        this.tableList = res.data.record
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },err => {
+                    this.listLoading = false
+                    this.$message({
+                        message: err,
+                        type: 'error'
+                    })
+                })
+            },
+
+            timeString(list){
+                let str1 = list[0] + '-'
+                let str2 = list[1] < 10 ? '0' + list[1] + '-' : list[1] + '-'
+                let str3 = list[2] < 10 ? '0' + list[2] : list[2]
+                let str4 = list[3] < 10 ? '0' + list[3] + ':' : list[3] + ':'
+                let str5 = list[4] < 10 ? '0' + list[4] + ':' : list[4] + ':'
+                let str6 = list[5] < 10 ? '0' + list[5] : list[5]
+                let str7 = str1 + str2 + str3 + ' ' + str4 + str5 + str6
+                return str7
+            },
+            contentString(string){
+                return string.split('\n')
+            },
+
+            handleSizeChange(){
+                this.size = val;
+                this.page = 1
+                this.getTableList();
+            },
+            handleCurrentChange(val) {
+                this.page = val;
+                this.getTableList();
+            },
+            restrictNumber(targetId){
+                let inpu = document.getElementById(targetId);
+                inpu.value = inpu.value.replace(/\D/g,'')
+            }
+        },
+    };
+</script>
+
+<style lang="scss" scoped>
+.classification {
+    width: 120px;
+    border-right: 1px solid #f2f2f2;
+    display: flex;
+    flex-wrap: wrap;
+    padding-top: 20px;
+    .on {
+        color: #409EFF;
+    }
+    p{
+        width: 120px;
+        text-align: center;
+        line-height: 50px;
+        margin: 0;
+        cursor: pointer;
+    }
+    p:hover{
+        background: #dddddd;
+    }
+}
+</style>

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

@@ -343,8 +343,9 @@
             </template>
             <template v-if="(showColumnWidth != '0' || permissions.projectManagement)">
                 <el-button size="small" type="primary" @click="addProPreson()">批量添加项目参与人</el-button>
-                <!-- <el-button size="small" type="primary" @click="batchDelete()">批量删除项目</el-button> -->
+                <el-button size="small" type="primary" @click="batchIncharger()">批量设置项目经理</el-button>
             </template>
+                
             
             <el-pagination
                 @size-change="handleSizeChange"
@@ -996,6 +997,20 @@
                 </div>
             </el-dialog>
         </el-dialog>
+        <!-- 批量设置项目经理 -->
+        <el-dialog title="批量设置项目经理" v-if="batchInchargerDialog" :visible.sync="batchInchargerDialog" width="30%">
+            <el-form model="" label-width="120px">
+                <el-form-item label="设置项目经理">
+                    <el-select v-model="paramInchargerId" placeholder="请选择项目经理" style="width: 80%">
+                        <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                    </el-select>
+                </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <el-button  @click="batchInchargerDialog = false" >取消</el-button>
+                <el-button type="primary" @click="batchInchargerSure()">确定</el-button>
+            </div>
+        </el-dialog>
 
         <el-dialog append-to-body title="项目导入结果" v-if="showImportResult" :visible.sync="showImportResult" width="40%">
                 <div >
@@ -1184,7 +1199,11 @@ a {
                 deptId: [],
                 contractAmountOld: 0,
                 contractAmountReasonShow: false,
-                centerNameDegree: ''
+                centerNameDegree: '',
+
+                batchInchargerDialog: false,
+                paramInchargerId: ''
+
             };
         },
         // 过滤器
@@ -1744,6 +1763,53 @@ a {
                 })
             },
 
+            // 批量设置项目经理
+            batchIncharger(){
+                if(this.checkedProjectArr.length == 0){
+                    this.$message('请选择项目')
+                    return
+                }
+                this.batchInchargerDialog = true
+                this.paramInchargerId = ''
+            },
+            batchInchargerSure(){
+                if(!this.paramInchargerId){
+                    this.$message({
+                        message: '请选择项目经理',
+                        type: 'warning'
+                    })
+                    return
+                }
+                let proArr = ''
+                for(let i=0;i<this.checkedProjectArr.length;i++){
+                    // proArr.push(this.checkedProjectArr[i].id)
+                    proArr += this.checkedProjectArr[i].id + ','
+                }
+                proArr = proArr.substring(0,proArr.length - 1)
+                this.http.post('/project/batchExchangeIncharger',{
+                    inchargerId: this.paramInchargerId,
+                    projectIds: proArr
+                },res => {
+                    if(res.code == 'ok'){
+                        this.batchInchargerDialog = false
+                        this.$message({
+                            message: '设置成功',
+                            type: 'success'
+                        })
+                        this.getList()
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },err => {
+                    this.$message({
+                        message: err,
+                        type: 'error'
+                    })
+                })
+            },
             // 批量添加项目参与人
             addProPreson(){
                 if(this.checkedProjectArr.length == 0){

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

@@ -591,7 +591,7 @@
             </el-form>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">撤回</el-button>
-                <el-button @click="deleteReport"  v-if="workForm.domains[0].id != null && canEdit">删除</el-button>
+                <el-button @click="deleteReport"  v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">删除</el-button>
                 <el-button @click="dialogVisible = false">取消</el-button>
                 <el-button v-if="!isSubstitude" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">暂存</el-button>
                 <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
@@ -602,11 +602,23 @@
         <!-- 按周填报 -->
         <el-dialog title="按周填报" :visible.sync="diasZho" width="60%" :close-on-click-modal="false" @closed="guanbi(),zhoAddqx()">
             <!-- 按周填报-已填工时-点击 -->
-            <!-- <el-dialog append-to-body title="已填日报" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
-                <el-table :data="weeklyFilledTimeList">
-                    <el-table-column></el-table-column>
+            <el-dialog append-to-body title="已填日报" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
+                <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
+                    <el-table-column prop="project" label="项目名称"></el-table-column>
+                    <el-table-column prop="time" label="工时(h)"></el-table-column>
+                    <el-table-column prop="state" label="状态">
+                        <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
+                    </el-table-column>
+                    <!-- <el-table-column label="操作">
+                        <template slot-scope="scope">
+                            <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
+                        </template>
+                    </el-table-column> -->
                 </el-table>
-            </el-dialog> -->
+                <span slot="footer" class="dialog-footer">
+                    <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">删除</el-button>
+                </span>
+            </el-dialog>
             <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!selConShow">
                 <el-form-item label="工作日期" prop="createDate">
                      <el-date-picker v-model="zhoRqi" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="zhoRqis()" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="margin-right: 18px" :clearable="false"></el-date-picker>
@@ -623,7 +635,7 @@
                     </el-table-column>
                     <el-table-column fixed="left" label="已填工时(h)" width="100" prop="filledTime" align="center">
                         <template slot-scope="scope">
-                            <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick">{{scope.row.filledTime}}</el-link>
+                            <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
                             <p v-else></p>
                         </template>
                     </el-table-column>
@@ -1579,7 +1591,15 @@
 
                 canCancelInDialog: false,
                 approveinData: {},
-                approveinDialog: false
+                approveinDialog: false,
+                reportCanDelete: false,
+
+                weeklyFilledTimeDialog: false,
+                weeklyFilledTimeList: [],
+                weeklyFilledTimeLoading: false,
+                workReportStateString: ['待审核','已通过','已驳回','待提交'],
+                weeklyFilledTimeCanDelete: false,
+                weeklyFilledTimeDate: null
             };
         },
         watch: {
@@ -1612,8 +1632,73 @@
             
         },
         methods: {
-            weeklyFilledTimeClick(){ //按周填报-已填工时-点击
+            weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
+                this.weeklyFilledTimeDialog = true
+                this.weeklyFilledTimeLoading = true
+                this.weeklyFilledTimeDate = parameterDate
+                this.http.post('/report/getReportList',{
+                    date: parameterDate,
+                    userId: this.user.id
+                },res => {
+                    this.weeklyFilledTimeLoading = false
+                    if(res.code == 'ok'){
+                        this.weeklyFilledTimeList = res.data[0].data
+                        let candelete = true
+                        for(let i in this.weeklyFilledTimeList){
+                            if(this.weeklyFilledTimeList[i].state < 2){
+                                candelete = false
+                            }
+                        }
+                        this.weeklyFilledTimeCanDelete = candelete
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },err => {
+                    this.weeklyFilledTimeLoading = false
+                    this.$message({
+                        message: err,
+                        type: 'error'
+                    })
+                })
+            },
 
+            weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
+                this.$confirm("确定要删除该日报吗?","提示", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning"
+                })
+                .then(() => {
+                    this.http.post('/report/delete',{ 
+                        userId: this.user.id,
+                        date: this.weeklyFilledTimeDate
+                    },res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: "删除成功",
+                                type: "success"
+                            });
+                            this.getWeeklyWorkTime()
+                            this.getReportList();
+                            this.getDepartment();
+                            this.weeklyFilledTimeDialog = false;
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                        }
+                    );
+                }).catch(() => {});
             },
 
 
@@ -3807,6 +3892,7 @@
                         if(list.report.length != 0) {
                             var arr = [];
                             this.canEdit = false;
+                            let candelete = true
                             for(var i in list.report) {
                                 var flg = null
                                 list.report[i].isOvertime == 1 ? flg = true : flg = false
@@ -3849,10 +3935,14 @@
                                 if (list.report[i].state >= 2) {
                                     this.canEdit = true;
                                 }
+                                if(list.report[i].state < 2){
+                                    candelete = false
+                                }
                                 if (list.report[i].state == 0){
                                     this.canCancelInDialog = true
                                 }
                             }
+                            this.reportCanDelete = candelete
                             this.workForm = {
                                 createDate: this.workForm.createDate,
                                 domains: arr,
@@ -3918,6 +4008,7 @@
             // 打开日报填写
             fillInReport(i, isBatch) {
                 this.isWeekend = false
+                this.reportCanDelete = false
                 // console.log(this.user.timeType.type, '选择时长')
                 if(i != 1) {
                     this.falsss = false 
@@ -4340,6 +4431,9 @@
                             dateStr: JSON.stringify(dateStr)
                         },res => {
                             if(res.code == 'ok'){
+                                for(let n in this.zhoData){
+                                    delete this.zhoData[n].filledTime
+                                }
                                 for(let i in res.data){
                                     let datei = res.data[i].createDate.split('-');
                                     for(let m in this.zhoData){