Explorar o código

调整说书部门的判断

Lijy %!s(int64=2) %!d(string=hai) anos
pai
achega
8843c677c9

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

+ 20 - 11
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"
@@ -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,7 +381,7 @@
                     </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" style="width: 100%"
                     ></el-cascader>
@@ -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>

+ 5 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/task/list.vue

@@ -26,7 +26,7 @@
                     </div>
                 </el-form-item> -->
 
-                <el-form-item label="所属部门">
+                <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"
@@ -118,7 +118,7 @@
                         </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="departmentName" 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>
@@ -1764,7 +1764,9 @@ import { error } from 'dingtalk-jsapi';
         mounted() {
             this.getList();
             this.getUsers();
-            this.getDepartmentList()
+            if(this.user.timeType.projectWithDept) {
+                this.getDepartmentList()
+            }
             if(this.user.companyId == '428') {
                 this.getSthForSb()
             }