Explorar o código

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper

ggooalice %!s(int64=2) %!d(string=hai) anos
pai
achega
d19f309dfd

+ 10 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/project/info.vue

@@ -13,7 +13,7 @@
                         <el-col :span="5" ><span class="gray_label">项目描述:</span></el-col><el-col :span="7" ></el-col>
                         <el-col :span="18" ><span>{{project.projectDesc}}</span></el-col>
                     </el-row>
-                    <el-row :gutter="10" >
+                    <el-row :gutter="10" v-if="user.timeType.projectWithDept">
                         <el-col :span="5" ><span class="gray_label">所属部门:</span></el-col><el-col :span="7" ></el-col>
                         <el-col :span="18" ><span>{{project.departmentName}}</span></el-col>
                     </el-row>
@@ -291,7 +291,7 @@
                     <el-input type="textarea" :rows="2" v-model="addForm.projectDesc" maxlength="4000" show-word-limit  placeholder="请输入项目描述" clearable></el-input>
                 </el-form-item>
 
-                <el-form-item label="所属部门">
+                <el-form-item label="所属部门" v-if="user.timeType.projectWithDept">
                     <el-cascader v-model="addForm.deptId" :options="departmentList" placeholder="请选择部门"
                         :props="{ checkStrictly: true }" clearable filterable @change="cascaderChange"
                     ></el-cascader>
@@ -1440,7 +1440,7 @@
                             formData.append("projectDesc", this.addForm.projectDesc);
                         }
                         if(this.user.timeType.outputValueStatus == 1){
-                            formData.append("outputValue", this.addForm.outputValue)
+                            formData.append("outputValue", this.addForm.outputValue ? this.addForm.outputValue : 0)
                         }
                         var listId = []
                         var listName = []
@@ -1472,8 +1472,10 @@
                         if(this.user.companyId == '428') {
                              formData.append("projectCategorySub", this.addForm.projectSeparate.projectCategorySub ? this.addForm.projectSeparate.projectCategorySub : '');
                         }
-                        if(this.addForm.deptId != null && this.addForm.deptId != '') {
-                            formData.append("deptId", this.addForm.deptId[this.addForm.deptId.length - 1]);
+                        if(this.user.timeType.projectWithDept) {
+                            if(this.addForm.deptId != null && this.addForm.deptId != '') {
+                                formData.append("deptId", this.addForm.deptId[this.addForm.deptId.length - 1]);
+                            }
                         }
                         // return
                         this.http.uploadFile(this.port.project.add,formData,
@@ -1826,7 +1828,9 @@
             this.userssHu()
             this.yanjiuzx()
             this.getProjectLevel()
-            this.getDepartmentList()
+            if(this.user.timeType.projectWithDept) {
+                this.getDepartmentList()
+            }
         }
     };
 </script>

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

@@ -44,7 +44,7 @@
                     </el-select>
                 </el-form-item>
                 <!-- 部门筛选 -->
-                <el-form-item >
+                <el-form-item v-if="user.timeType.projectWithDept">
                     <span style="margin-left:5px;margin-right:5px;color:#606266;">部门</span>
                     <el-cascader v-model="deptId" :options="departmentList" placeholder="请选择部门"
                         :props="{ checkStrictly: true }" :show-all-levels="false" clearable filterable @change="searchClfList" size="small"
@@ -153,7 +153,7 @@
                      </div>
                 </template>
             </el-table-column>
-            <el-table-column prop="projectCategorySub" label="项目分组" width="200" v-if="user.companyId == '428'">
+            <!-- <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">
@@ -171,7 +171,7 @@
                         </div>
                      </div>
                 </template>
-            </el-table-column>
+            </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">
@@ -191,7 +191,7 @@
                      </div>
                 </template>
             </el-table-column>
-            <el-table-column prop="departmentName" label="所属部门" sortable="custom" width="200"></el-table-column>
+            <el-table-column prop="departmentName" label="所属部门" sortable="custom" width="200" v-if="user.timeType.projectWithDept"></el-table-column>
             <el-table-column prop="projectMainName" label="主项目" sortable="custom" min-width="250" v-if="user.timeType.mainProjectState == '1'">
             </el-table-column>
             <el-table-column prop="inchargerName" label="项目经理" sortable="custom" min-width="150">
@@ -381,9 +381,9 @@
                     </div>
                 </el-form-item>
 
-                <el-form-item label="所属部门">
+                <el-form-item label="所属部门" v-if="user.timeType.projectWithDept">
                     <el-cascader v-model="addForm.deptId" :options="departmentList" placeholder="请选择部门"
-                        :props="{ checkStrictly: true }" clearable filterable @change="cascaderChange"
+                        :props="{ checkStrictly: true }" clearable filterable @change="cascaderChange" style="width: 100%"
                     ></el-cascader>
                 </el-form-item>
 
@@ -2984,7 +2984,11 @@ a {
                         creatorId: this.user.id,
                         projectMainId: '',
                         outputValue: '',
-                        deptId: []
+                        // deptId: []
+                    }
+
+                    if(this.user.timeType.projectWithDept) {
+                        this.$set(this.addForm, 'deptId', [])
                     }
 
                     if(this.user.companyId == '936') {
@@ -3057,12 +3061,14 @@ a {
                         projectMainId: item.projectMainId,
                         creatorId: item.creatorId,
                         outputValue: item.outputValue,
-                        deptId: array.reverse(),
+                        // deptId: array.reverse(),
                         changeContractReason: ''
                     }
                     this.contractAmountOld = item.contractAmount ? item.contractAmount : 0
                     console.log(this.addForm, '数据')
-
+                    if(this.user.timeType.projectWithDept) {
+                        this.$set(this.addForm, 'deptId', array.reverse())
+                    }
                     // 判断公司id是否等于936
                     if(this.user.companyId == '936') {
                         if(item.projectSeparate) {
@@ -3368,11 +3374,13 @@ a {
                         if(this.user.companyId == '428') {
                              formData.append("projectCategorySub", this.addForm.projectCategorySub ? this.addForm.projectCategorySub : '');
                         }
-                        if(this.addForm.deptId != null && this.addForm.deptId != '') {
-                            formData.append("deptId", this.addForm.deptId[this.addForm.deptId.length - 1])
+                        if(this.user.timeType.projectWithDept) {
+                            if(this.addForm.deptId != null && this.addForm.deptId != '') {
+                                formData.append("deptId", this.addForm.deptId[this.addForm.deptId.length - 1])
+                            }
                         }
                         // formData.append("associateDegreeNames", listName)
-                        console.log("addform",this.addForm);
+                        // console.log("addform",this.addForm);
                         // return
                         this.http.uploadFile(this.port.project.add,formData,
                         res => {
@@ -3602,8 +3610,9 @@ a {
             }
 
             // 获取部门
-            this.getDepartmentList()
-            
+            if(this.user.timeType.projectWithDept) {
+                this.getDepartmentList()
+            }
         }
     };
 </script>

+ 3 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -149,13 +149,13 @@
                                         </div>
 
                                         <draggable class="taskListin" :style="'max-height:' + taskListinH + 'px;'" @start="drag=true" @end="drag=false" draggable=".taskCard" ghostClass="ghost" @update="onChange" @add="onChange" group="task1" :id="stage.id">
-                                            <div v-for="element in stage.taskList" :id="element.id" :key="element.id" class="taskCard" ref="tasks" @click="canAddTask ? editTask(element) : ''" :style="element.taskStatus==0?'':'background:#eFeFeF;'">
+                                            <div v-for="element in stage.taskList" :id="element.id" :key="element.id" class="taskCard" ref="tasks" @click="editTask(element)" :style="element.taskStatus==0?'':'background:#eFeFeF;'">
                                                 <!--任务卡片内容显示 -->
                                                 <div>
                                                     <div v-if="element.taskLevel == 2" class="taskImg hong"><img src="../../assets/image/hong.png" alt=""></div>
                                                     <div v-if="element.taskLevel == 1" class="taskImg huang"><img src="../../assets/image/huang.png" alt=""></div>
                                                     <div v-if="element.taskLevel == 0" class="taskImg hui"><img src="../../assets/image/hui.png" alt=""></div>
-                                                    <el-checkbox v-if="canAddTask" :disabled="element.taskStatus==2 || element.subTaskList.length > element.subTaskFinishNum" :checked="element.taskStatus==1?true:false" size="large" class="cb"  
+                                                    <el-checkbox :disabled="element.taskStatus==2 || element.subTaskList.length > element.subTaskFinishNum" :checked="element.taskStatus==1?true:false" size="large" class="cb"  
                                                     @change="finishTask(element)"
                                                     @click.stop.native=""
                                                     ></el-checkbox>
@@ -170,7 +170,7 @@
                                                     <span v-if="element.executorName">
                                                     <span v-for="(exeItem, exeIndex) in element.executorName.split(',')" :key="exeIndex" :style="element.executorColor ? 'background:' + element.executorColor.split(',')[exeIndex] : ''" class="user_name_icon">{{exeItem.length>2?exeItem.substring(exeItem.length-2, exeItem.length):exeItem}}</span>
                                                     </span>
-                                                    <el-button v-if="!element.executorName && canAddTask" type="primary" @click.stop.native="addAsMyTask(element)" size="mini" style="float:right;width:38px;padding:5px;position: absolute;z-index: 5;right: 5px;">认领</el-button>
+                                                    <el-button v-if="!element.executorName" type="primary" @click.stop.native="addAsMyTask(element)" size="mini" style="float:right;width:38px;padding:5px;position: absolute;z-index: 5;right: 5px;">认领</el-button>
                                                 </div>
                                                 <!--子任务 -->
                                                 <div v-if="element.subTaskList.length > 0" class="taskCardCircleBox">

+ 62 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/task/list.vue

@@ -18,13 +18,21 @@
                     <!-- </el-input> -->
                     </div>
                 </el-form-item>
-                <el-form-item label="项目分组" v-if="user.companyId == '428'">
+                <!-- <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 label="所属部门" v-if="user.timeType.projectWithDept">
+                    <!-- <span style="margin-left:5px;margin-right:5px;color:#606266;">部门</span> -->
+                    <el-cascader v-model="deptId" :options="departmentList" placeholder="请选择部门"
+                        :props="{ checkStrictly: true }" :show-all-levels="false" clearable filterable @change="hiddens"
+                    ></el-cascader>
                 </el-form-item>
+
                 <!-- <el-form-item style="float:right;">
                     <el-link type="primary" :underline="false" @click="handleAdd(-1,null)">新增任务</el-link>
                 </el-form-item> -->
@@ -109,7 +117,8 @@
                             </div>
                         </template>
                     </el-table-column>
-                    <el-table-column prop="projectCategorySub" label="项目分组" sortable width="300" v-if="user.companyId == '428'"></el-table-column>
+                    <!-- <el-table-column prop="projectCategorySub" label="项目分组" sortable width="300" v-if="user.companyId == '428'"></el-table-column> -->
+                    <el-table-column prop="departmentName" label="所属部门" sortable width="300" v-if="user.timeType.projectWithDept"></el-table-column>
                     <el-table-column prop="projectName" label="项目名称" sortable width="260" show-overflow-tooltip>
                         <template slot-scope="scope">
                             <el-link type="primary" :href="'#/projectInside/'+scope.row.projectId">{{scope.row.projectName}}</el-link>
@@ -799,7 +808,9 @@ import { error } from 'dingtalk-jsapi';
                 dateType: 0,
                 dateSelect: [],
                 groupName: '',
-                groupNameList: []
+                groupNameList: [],
+                departmentList: [],
+                deptId: []
             };
         },
         methods: {
@@ -994,8 +1005,13 @@ import { error } from 'dingtalk-jsapi';
                     parameter.startDate = this.dateSelect[0]
                     parameter.endDate = this.dateSelect[1]
                 }
-                if(this.user.companyId == '428') {
-                    parameter.groupName = this.groupName
+                // if(this.user.companyId == '428') {
+                //     parameter.groupName = this.groupName
+                // }
+                if(this.deptId.length > 0) {
+                    parameter.deptId = this.deptId[this.deptId.length - 1]
+                } else {
+                    parameter.deptId = ''
                 }
                 this.http.post('/task/listByPage', parameter,
                 res => {
@@ -1698,7 +1714,44 @@ import { error } from 'dingtalk-jsapi';
                         type: "error"
                     });
                 });
-            }
+            },
+            // 获取部门
+            getDepartmentList() {
+                this.http.post( this.port.manage.depList, {},
+                    res => {
+                    if (res.code == "ok") {
+                        let dptlist = JSON.parse(JSON.stringify(res.data));
+                        this.departmentList = this.changeArr(dptlist);
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                    },error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            changeArr(arr) {
+                for (var i = 0; i < arr.length; i++) {
+                    if(arr[i].id != -1 && arr[i].id != 0) {
+                        if (arr[i].children != null && arr[i].children.length>0) {
+                            arr[i].children = this.changeArr(arr[i].children);
+                        }
+                        arr[i].id && (arr[i].value = arr[i].id);
+                        delete arr[i].id;
+                    }
+                }
+                for(var i in arr) {
+                    if(arr[i].id == -1 || arr[i].id == 0) {
+                        arr.splice(i,1)
+                    }    
+                }
+                return arr;
+            },
         },
         created() {
             let height = window.innerHeight;
@@ -1711,6 +1764,9 @@ import { error } from 'dingtalk-jsapi';
         mounted() {
             this.getList();
             this.getUsers();
+            if(this.user.timeType.projectWithDept) {
+                this.getDepartmentList()
+            }
             if(this.user.companyId == '428') {
                 this.getSthForSb()
             }