Przeglądaj źródła

2022.7.7 20:09

ggooalice 2 lat temu
rodzic
commit
6d005740fe

+ 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

+ 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 = []

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

@@ -262,7 +262,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">

+ 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,

+ 52 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -69,6 +69,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>
@@ -172,6 +175,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;"
@@ -843,6 +847,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()
             },
@@ -1228,12 +1271,14 @@
                                 message: '删除成功',
                                 type: "success"
                             });
+                            this.dialogVisible = false
                             this.getUser()
                         } else {
                             this.$message({
                             message: res.msg,
                             type: "error"
                             });
+                            this.dialogVisible = false
                         }
                     },
                     error => {
@@ -1241,6 +1286,7 @@
                             message: error,
                             type: "error"
                         });
+                        this.dialogVisible = false
                     });
                 })
             },
@@ -1548,16 +1594,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, {

+ 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]
+                            }
                         }
                     }
                 }