Przeglądaj źródła

研究中心管理加搜索,企业微信测试,组织架构编辑人员部门显示错误

Lijy 2 lat temu
rodzic
commit
0ef7ab0588

+ 3 - 1
fhKeeper/formulahousekeeper/timesheet/src/components/cascader.vue

@@ -154,8 +154,10 @@ export default {
             handler(newValue, oldValue) {
                 console.log(newValue, oldValue)
                 this.optionsOId = newValue
-                if(this.optionsOId) {
+                if(this.optionsOId && this.optionsOId.length != 0) {
                     this.traverseArr(this.options, this.optionsOId)
+                } else {
+                    this.selectName = this.$t('defaultText.pleaseChoose')
                 }
             },
         },

+ 24 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/centerManage/centerManage.vue

@@ -3,7 +3,11 @@
         <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
             <el-form :inline="true">
                 <el-form-item :label="user.timeType.customDegreeName + $t('guan-li')">
+                    <el-input placeholder="请输入关键名称" v-model.trim="searchNameVal" clearable class="input-with-select" style="margin-left: 50px">
+                        <el-button slot="append" @click="searchName()">搜索</el-button>
+                    </el-input>
                 </el-form-item>
+                
                 <!-- <el-link type="primary" :underline="false" @click="intoCenterRatio" class="tanjia">批量导入{{user.timeType.customDegreeName}}</el-link>
                 <el-link icon="el-icon-circle-plus-outline" type="primary" :underline="false" class="tanjia" @click="addNewSubProject()">添加{{user.timeType.customDegreeName}}</el-link>
                 <el-link type="primary" :underline="false" @click="batchDelete" class="tanjia">批量删除{{user.timeType.customDegreeName}}</el-link> -->
@@ -77,7 +81,6 @@
         data() {
             return {
                 user: JSON.parse(sessionStorage.getItem("user")),
-                subProjectList: [],//子项目列表
                 listLoading: false,
                 addfm: {
                     name: '',
@@ -92,10 +95,28 @@
                 importingData: false,
                 importResultMsg:null,
                 showImportResult:false,
-                selectionArr: []
+                selectionArr: [],
+                subProjectList: [],//子项目列表
+                subProjectListArr: [], // 备用列表
+                searchNameVal: ''
             };
         },
         methods: {
+            searchName() {
+                var val = this.searchNameVal
+                let arr = []
+                if(val) {
+                    arr =  this.subProjectListArr.filter((num)=>{
+                        if(num.name.indexOf(val) != '-1') {
+                            return num
+                        }
+                    })
+                    this.subProjectList = arr
+                } else {
+                    this.subProjectList = this.subProjectListArr
+                }
+                
+            },
             // 批量删除
             selectionChange(selection){
                 this.selectionArr = selection
@@ -218,6 +239,7 @@
                     if (res.code == "ok") {
                         console.log(res, '看看')
                         this.subProjectList = res.data
+                        this.subProjectListArr = res.data
                     } else {
                         this.$message({
                             message: res.msg,

+ 14 - 12
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -458,12 +458,12 @@
                 <el-table-column prop="jobNumber" :label="$t('Worknumber')" width="120"></el-table-column>
                 <el-table-column prop="departmentName" :label="$t('lable.department')" width="140">
                   <template slot-scope="scope" >
-                    <span v-if="user.userNameNeedTranslate == '1'">
-                      <ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data>
-                    </span>
-                    <span v-if="user.userNameNeedTranslate != '1'">
-                      {{scope.row.departmentName}}
-                    </span>
+                      <span v-if="user.userNameNeedTranslate == '1'">
+                        <ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data>
+                      </span>
+                      <span v-if="user.userNameNeedTranslate != '1'">
+                        {{scope.row.departmentName}}
+                      </span>
                   </template>
                 </el-table-column>
                 <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="120"></el-table-column>
@@ -499,11 +499,11 @@
               <el-table-column prop="deptName" :label="$t('subordinatedepartments')" width="150">
                 <template slot-scope="scope" >
                     <span v-if="user.userNameNeedTranslate == '1'">
-                      <!-- <span v-for="item, index in scope.row.deptName" :key="index">
+                      <span v-for="item, index in scope.row.deptName" :key="index">
                         <ww-open-data type='departmentName' :openid='item'></ww-open-data>
                         <span v-if="index < scope.row.deptName.length - 1">/</span>
-                      </span> -->
-                        <ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data>
+                      </span>
+                        <!-- <ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data> -->
                     </span>
                     <span v-if="user.userNameNeedTranslate != '1'">
                       {{scope.row.deptName}}
@@ -2033,9 +2033,11 @@ export default {
       res => {
         this.listLoading = false
         if(res.code == 'ok'){
-          // if(this.user.userNameNeedTranslate == '1') {
-          //   res.data.result = res.data.result.deptName.split('/')
-          // }
+          if(this.user.userNameNeedTranslate == '1') {
+            for(var i in res.data.result) {
+              res.data.result[i].deptName = res.data.result[i].deptName.split('/')
+            }
+          }
           this.userWorkHoursList = res.data.result
           this.total = res.data.total
         }else {