Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

yurk 2 gadi atpakaļ
vecāks
revīzija
137c883e69

+ 121 - 15
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -35,14 +35,20 @@
                 <el-radio-button label="部门"></el-radio-button>
                 <el-radio-button label="人员" v-if="permissions.countPersonnel"></el-radio-button>
                 <el-radio-button :label="namess" v-if="jichu.customDegreeActive == 1"></el-radio-button>
+                <el-radio-button v-for="item in theCustomList" :key="item.id" :label="item.name"></el-radio-button>
             </el-radio-group>
+<!-- 
+            <el-select v-model="customName" filterable placeholder="请选择" style="margin-top: 10px;width: 350px" v-if="theCustomListFlg" @change="jieliu()">
+                <el-option v-for="item in customList" :key="item.id" :label="item.name" :value="item.name"></el-option>
+            </el-select> -->
 
             <el-select v-model="personnelValue" filterable clearable placeholder="请选择人员" style="margin-top: 10px;width: 350px" v-if="radio == '人员'" @change="personnel()">
                 <el-option v-for="item in hasReportUserList" :key="item.id" :label="item.name" :value="item.name"></el-option>
             </el-select>
         </el-col>
         <el-col :span="4">
-            <el-button @click="showExportDialog">报表导出</el-button>
+            <el-button @click="exportProjectData" v-if="theCustomListFlg">报表导出</el-button>
+            <el-button @click="showExportDialog" v-else>报表导出</el-button>
         </el-col>
         </el-row>
         <!-- <div id="clearfix" :style="'width:'+widthHtval+'px;position: relative; height:'+containerHeight+'px;'">
@@ -160,7 +166,15 @@
                 jichu: [],
                 namess: '',
                 timers: null, // 点击的时间
-                zhishin: 0
+                zhishin: 0,
+                theCustomList: [], // 自定义数据来源
+                theCustomListFlg: false, // 判断是否点击的是自定义配置的数据来源
+                theCustomListId: '',
+                theCustomListPlantLIst: [],
+                theCustomListPlant: '',
+                customId: '',
+                customName: '',
+                customList: []
             };
         },
         methods: {
@@ -297,7 +311,16 @@
                         param.projectSum = this.exportParam.projectSum;
                     }
                 }
-                param.type = this.exportParam.type*1
+                if(!this.theCustomListFlg) {
+                    param.type = this.exportParam.type*1
+                } 
+                if(this.theCustomListFlg) {
+                    url = '/project/exportTimeCostByUserCustom'
+                    fileName = this.radio + '统计.xls'
+                    // param.subCustomName = this.customName
+                    param.customId = this.theCustomListId
+                    param.fieldName = this.theCustomListPlant
+                }
                 this.http.post(url, param,
                     res => {
                         this.listLoading = false;
@@ -703,17 +726,45 @@
             yanjiu() {
                 console.log('触发')
             },
-            getEchart(){
+            getEchart(e){
                 var that = this
-                // that.timers = setTimeout(()=>{
-                    // clearTimeout(that.timers)
-                    // console.log(that.timers)
-                    that.jieliu()
-                // },100);
-                // this.jieliu()
-                // if(this.radio == '项目分类'){
-                //     this.getCategoryList()
-                // }
+                // 更具选中的名字筛选出对应的自定义id
+                that.theCustomListFlg = false
+                let ints = null
+                for(var i in that.theCustomList) {
+                    if(that.radio == that.theCustomList[i].name) {
+                        that.theCustomListId = that.theCustomList[i].id
+                        that.theCustomListPlant = that.theCustomListPlantLIst[i]
+                        that.theCustomListFlg = true
+                        ints = i
+                    }
+                }
+                if(that.theCustomListFlg) {
+                    that.customList = that.theCustomList[ints].subUserCustomList
+                    that.customName = that.theCustomList[ints].subUserCustomList[0].name
+                    // that.getCusTom()
+                }
+                that.jieliu()
+            },
+            getCusTom() {
+                this.http.post('/sub-user-custom/list',{
+                    userCustomId: this.theCustomListId
+                },res => {
+                    if(res.code == 'ok'){
+                        this.customList = res.data
+                        this.customName = res.data[0].name
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    })
+                })
             },
             getCategoryList(){
                 this.http.post('/project-category/list',{},
@@ -776,7 +827,13 @@
                     return;
                 } else if (this.radio == this.namess) {
                     url = '/project/getDegreeCost'
-                } 
+                } else if (this.theCustomListFlg) {
+                    url = '/project/getTimeCostByUserCustom'
+                    // param.subCustomName = this.customName
+                    param.customId = this.theCustomListId
+                    param.fieldName = this.theCustomListPlant
+                    console.log(param, '要传的数据')
+                }
                 this.http.post(url, param,
                 res => {
                     if (res.code == "ok") {
@@ -864,7 +921,31 @@
                                     yList.push(item);
                                 }
                             }
-                        } else {
+                        } 
+                        else if(this.theCustomListFlg) {
+                            list = res.data.list
+                            
+                            for(var i in list) {
+                                // console.log(list[i].name, list[i].costMoney, list[i].cost)
+                                xList.push(list[i].name);
+                                let item = {
+                                    "value": this.yAxisValue==0?list[i].costMoney:list[i].cost,
+                                    "id": list[i].id || i,
+                                }
+                                if(this.permissions.countCost){
+                                    // item.money = list[i].costMoney.toFixed(2)
+                                    item.money = list[i].costMoney ? list[i].costMoney.toFixed(2) : 0
+                                    totalMoneyCost += parseFloat(list[i].costMoney);
+                                }
+                                if(this.permissions.countHours){
+                                    item.cost = list[i].cost
+                                    totalHours += parseFloat(list[i].cost);
+                                }
+                                yList.push(item);
+                                
+                            }
+                        } 
+                        else {
                             list = res.data
                             
                             for(var i in list) {
@@ -1062,6 +1143,27 @@
                 event.preventDefault() // 阻止浏览器默认事件
                 this.domObj.scrollLeft = this.domObj.scrollLeft + step
             },
+            // 判断后端给的字段
+            // 获取自定义
+            getZDY() {
+                this.http.post('/user-custom/getUserCustomTitle',{},res => {
+                    if(res.code == 'ok'){
+                        console.log(res, '数据来源')
+                        this.theCustomList = res.data.result
+                        this.theCustomListPlantLIst = res.data.field
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    })
+                })
+            }
         },
         created() {
             this.myChart = null
@@ -1111,6 +1213,10 @@
             this.getUsers()
             this.jutishez()
             this.scrollFunction()
+            // 判断
+            if(this.user.timeType.userCustomStatic) {
+                this.getZDY()
+            }
         },
         beforeDestroy () {
             var myChart = echarts.init(document.getElementById("container"));

+ 34 - 11
fhKeeper/formulahousekeeper/timesheet/src/views/project/info.vue

@@ -59,7 +59,7 @@
                             <el-col :span="18" ><span>{{project.projectSeparate.contractCode}}</span></el-col>
                         </el-row>
                         <el-row :gutter="10">
-                            <el-col :span="5" ><span class="gray_label">质保开始时间</span></el-col><el-col :span="7" >
+                            <el-col :span="5" ><span class="gray_label">质保开始时间:</span></el-col><el-col :span="7" >
                                 <span >{{project.projectSeparate.warrantyStartDate==null?'-':project.projectSeparate.warrantyStartDate}}</span></el-col>
                             <el-col :span="5" ><span class="gray_label">质保截止时间:</span></el-col><el-col :span="7" ><span>
                                 {{project.projectSeparate.warrantyEndDate == null?'-':project.projectSeparate.warrantyEndDate}}</span></el-col>
@@ -77,6 +77,12 @@
                             <el-col :span="18" ><span>{{project.projectSeparate.bu}}</span></el-col>
                         </el-row>
                     </div>
+                    <div v-if="user.companyId == '428'">
+                        <el-row :gutter="10" >
+                            <el-col :span="5" ><span class="gray_label">项目分组:</span></el-col><el-col :span="7" ></el-col>
+                            <el-col :span="18" ><div v-if="project.projectSeparate"><span>{{project.projectSeparate.projectCategorySub}}</span></div></el-col>
+                        </el-row>
+                    </div>
                 </div>
                 <div class="box" style="margin-top:10px;">
                     <div><label>相关人员</label>
@@ -354,6 +360,12 @@
                         <el-input v-model="addForm.projectSeparate.bu" placeholder="所属BU" clearable></el-input>
                     </el-form-item>
                 </div>
+
+                <div v-if="user.companyId == '428'">
+                    <el-form-item label="项目分组" >
+                        <el-input v-model="addForm.projectSeparate.projectCategorySub" placeholder="请输入项目分组" maxlength="50" show-word-limit clearable></el-input>
+                    </el-form-item>
+                </div>
                
             </el-form>
             <div slot="footer" class="dialog-footer">
@@ -1443,6 +1455,9 @@
                              formData.append("region", this.addForm.projectSeparate.region ? this.addForm.projectSeparate.region : '');
                              formData.append("bu", this.addForm.projectSeparate.bu ? this.addForm.projectSeparate.bu : '');
                         }
+                        if(this.user.companyId == '428') {
+                             formData.append("projectCategorySub", this.addForm.projectSeparate.projectCategorySub ? this.addForm.projectSeparate.projectCategorySub : '');
+                        }
                         // return
                         this.http.uploadFile(this.port.project.add,formData,
                         res => {
@@ -1663,20 +1678,28 @@
                     this.listLoading = false;
                     if (res.code == "ok") {
                         this.project = res.data;
-                        if(this.user.companyId == '936') {
+                        if(this.user.companyId == '936' || this.user.companyId == '428') {
                             if(res.data.projectSeparate) {
                                 this.project = res.data;
                             } else {
-                                var obj = {
-                                    contractCode: '',
-                                    warrantyStartDate: '',
-                                    warrantyEndDate: '',
-                                    projectCategorySub: '',
-                                    region: '',
-                                    bu: '',
+                                if(this.user.companyId == '936') {
+                                    var obj = {
+                                        contractCode: '',
+                                        warrantyStartDate: '',
+                                        warrantyEndDate: '',
+                                        projectCategorySub: '',
+                                        region: '',
+                                        bu: '',
+                                    }
+                                    res.data.projectSeparate = obj
+                                    this.project = res.data;
+                                } else {
+                                    var obj = {
+                                        projectCategorySub: '',
+                                    }
+                                    res.data.projectSeparate = obj
+                                    this.project = res.data;
                                 }
-                                res.data.projectSeparate = obj
-                                this.project = res.data;
                             }
                         } else {
                             this.project = res.data;

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

@@ -146,6 +146,25 @@
                      </div>
                 </template>
             </el-table-column>
+            <el-table-column prop="projectCategorySub" label="项目分组" width="200" v-if="user.companyId == '428'">
+                <template slot-scope="scope">
+                    <div v-if="scope.row.projectSeparate">
+                        <div v-if="scope.row.projectSeparate.projectCategorySub">
+                            <el-popover placement="top" width="400" trigger="hover" v-if="scope.row.projectSeparate.projectCategorySub.length > 15">
+                                <div>
+                                    <span>{{scope.row.projectSeparate.projectCategorySub}}</span>
+                                </div>
+                                <div slot="reference" class="kans">
+                                    <span>{{scope.row.projectSeparate.projectCategorySub}}...</span>
+                                </div>
+                            </el-popover>
+                            <div v-else>
+                                <span>{{scope.row.projectSeparate.projectCategorySub}}</span>
+                            </div>
+                        </div>
+                     </div>
+                </template>
+            </el-table-column>
             <el-table-column prop="categoryName" label="项目分类" sortable="custom" width="120"></el-table-column>
             <el-table-column prop="projectName" label="项目名称" width="250" sortable="custom">
                  <template slot-scope="scope">
@@ -455,6 +474,11 @@
                     <el-input v-model="addForm.bu" placeholder="所属BU" clearable></el-input>
                 </el-form-item>
                 </div>
+                <div v-if="user.companyId == '428'">
+                    <el-form-item label="项目分组" >
+                        <el-input v-model="addForm.projectCategorySub" maxlength="50" show-word-limit placeholder="请输入项目分组" clearable></el-input>
+                    </el-form-item>
+                </div>
                 <!-- 项目基线 -->
                 <div style="margin: 10px 0 30px 0;min-height:200px;" v-if="user.company.packageProject == 1">
                     <el-tabs v-model="activeName" @tab-click="handleClick">
@@ -2910,6 +2934,9 @@ a {
                         this.$set(this.addForm, 'region', '')
                         this.$set(this.addForm, 'bu', '')
                     }
+                    if(this.user.companyId == '428') {
+                        this.$set(this.addForm, 'projectCategorySub', '')
+                    }
                     this.projectBaseCostData = [];
                     this.auseList = [];
                     for (var m=0;m<this.baseCostItemList.length; m++) {
@@ -2975,6 +3002,14 @@ a {
                         }
                     }
 
+                    if(this.user.companyId == '428') {
+                        if(item.projectSeparate) {
+                            this.$set(this.addForm, 'projectCategorySub', item.projectSeparate.projectCategorySub)
+                        } else {
+                            this.$set(this.addForm, 'projectCategorySub', '')
+                        }
+                    }
+
                     // 判断是否有供应商
                     if(this.user.company.packageProvider) {
                         // this.addForm.supplierId = item.providerIds.split(',')
@@ -3247,6 +3282,9 @@ a {
                              formData.append("region", this.addForm.region ? this.addForm.region : '');
                              formData.append("bu", this.addForm.bu ? this.addForm.bu : '');
                         }
+                        if(this.user.companyId == '428') {
+                             formData.append("projectCategorySub", this.addForm.projectCategorySub ? this.addForm.projectCategorySub : '');
+                        }
 
                         // formData.append("associateDegreeNames", listName)
                         // console.log("addform",this.addForm);

+ 42 - 9
fhKeeper/formulahousekeeper/timesheet/src/views/task/list.vue

@@ -3,11 +3,11 @@
         <!--工具条-->
         <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
             <el-form :inline="true">
-                <div style="margin-left: 20px;display: inline-block">
+                <!-- <div style="margin-left: 20px;display: inline-block">
                 <el-form-item label="任务列表">
                 </el-form-item>
-                </div>
-                <el-form-item >
+                </div> -->
+                <el-form-item label="任务列表">
                     <div style="margin-left: 8px">
                     <!-- <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入项目名称关键字" clearable="true"> -->
                         <el-select v-model="searchField" style="width:120px;"  slot="prepend" placeholder="请选择">
@@ -18,15 +18,22 @@
                     <!-- </el-input> -->
                     </div>
                 </el-form-item>
+                <el-form-item label="项目分组" v-if="user.companyId == '428'">
+                    <div style="margin-left: 8px">
+                        <el-select v-model="groupName" style="width:200px;" placeholder="请选择" clearable @change="hiddens()">
+                            <el-option v-for="(item, index) in groupNameList" :key="index" :label="item" :value="item"></el-option>
+                        </el-select>
+                    </div>
+                </el-form-item>
                 <!-- <el-form-item style="float:right;">
                     <el-link type="primary" :underline="false" @click="handleAdd(-1,null)">新增任务</el-link>
                 </el-form-item> -->
 
-                <div style="margin-left: 40px;display: inline-block">
+                <!-- <div style="margin-left: 40px;display: inline-block">
                 <el-form-item label="类型">
                 </el-form-item>
-                </div>
-                <el-form-item >
+                </div> -->
+                <el-form-item label="类型">
                     <div style="margin-left: 8px">
                     <!-- <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入项目名称关键字" clearable="true"> -->
                         <el-select v-model="typeField" style="width:120px;"  slot="prepend" placeholder="请选择" clearable @change="hiddens()">
@@ -790,7 +797,9 @@ import { error } from 'dingtalk-jsapi';
                 selectedGroup:{},
                 dateClass: true,
                 dateType: 0,
-                dateSelect: []
+                dateSelect: [],
+                groupName: '',
+                groupNameList: []
             };
         },
         methods: {
@@ -985,6 +994,9 @@ import { error } from 'dingtalk-jsapi';
                     parameter.startDate = this.dateSelect[0]
                     parameter.endDate = this.dateSelect[1]
                 }
+                if(this.user.companyId == '428') {
+                    parameter.groupName = this.groupName
+                }
                 this.http.post('/task/listByPage', parameter,
                 res => {
                     this.listLoading = false;
@@ -1663,11 +1675,29 @@ import { error } from 'dingtalk-jsapi';
                         });
                     });
                 });
-
-                
             },
             chan() {
                 // console.log(this.critic)
+            },
+            getSthForSb() {
+                this.http.post('/task/getGroupNameList ',{},
+                res => {
+                    if (res.code == "ok") {
+                        console.log('看看是', res.data)
+                        this.groupNameList = res.data
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
             }
         },
         created() {
@@ -1681,6 +1711,9 @@ import { error } from 'dingtalk-jsapi';
         mounted() {
             this.getList();
             this.getUsers();
+            if(this.user.companyId == '428') {
+                this.getSthForSb()
+            }
         },
     };
 </script>