Parcourir la source

部门转译第一版

Lijy il y a 2 ans
Parent
commit
0f63cf195b

+ 59 - 27
fhKeeper/formulahousekeeper/timesheet/src/components/cascader.vue

@@ -1,8 +1,8 @@
 <template>
   <div tabindex="0" @blur="selectClihide()" style="display: inline-block;position: relative;">  
     <div :class="disabled ? 'disabledTrue' : 'disabledFalse'" @mouseenter="moveIonDiv" @mouseleave="outIonDiv">
-        <div :style="`width:${selectWidth}px;height:${selectHeight}px`" :class="classDiv ? 'select selectDiv' : 'select'" @click="selectCli" :ref="disabled ? '' : 'selectDiv'">
-            <div :style="'line-height: '+selectHeight+'px'" :class="selectName == $t('defaultText.pleaseChoose') ? 'selecttex selecttexXuan' : 'selecttex'">
+        <div :style="`width:${selectWidth}px;height:${selectHeight}px`" :class="classDiv ? 'select selectDiv' : 'select'" @click.stop="selectCli" :ref="disabled ? '' : 'selectDiv'">
+            <div :style="'line-height: '+selectHeight+'px;font-size: '+selectFontSize+'px;'" :class="(selectName == $t('defaultText.pleaseChoose') || selectName == $t('qing-xuan-ze-bu-men')) ? 'selecttex selecttexXuan' : 'selecttex'">
                 <ww-open-data type='departmentName' :openid='selectName'></ww-open-data>
                 <!-- {{selectName}} -->
             </div>
@@ -106,12 +106,17 @@ export default {
         widthStr: {
             type: String,
             default: false
-        }
+        },
+        // 默认文字
+        selectNameChuan: {
+            type: String
+        },
     },
     data() {
         return {
             selectWidth: '150',
             selectHeight: '28',
+            selectFontSize: '12',
             show: false, // 下拉框
             options: [], // 列表数据
             transitionBoxLiIdx: '-1', // hover 背景色
@@ -131,8 +136,8 @@ export default {
     watch: {
         subject: {
             handler(newValue, oldValue) {
-                console.log(newValue, '看看值')
                 this.options = newValue
+                console.log(this.options, '我收到的数据')
                 if(newValue) {
                     
                 }
@@ -150,36 +155,40 @@ export default {
                 console.log(newValue, oldValue)
                 this.optionsOId = newValue
                 if(this.optionsOId) {
-                    for(let i in this.options) {
-                        if(this.options[i].id == this.optionsOId || this.options[i].auditorId == this.optionsOId) {
-                            this.selectName = this.options[i].name || this.options[i].auditorName
-                        }
-                    }
+                    this.traverseArr(this.options, this.optionsOId)
                 }
             },
         },
         widthStr: {
             handler(newValue, oldValue) {
-                console.log('卧槽')
                 this.selectWidth = newValue
             },
         }
     },
-    created() {},
-    mounted() {
+    created() {
+        console.log(this.size)
         if(this.size == 'mini') {
             this.selectWidth = '150'
             this.selectHeight = '28'
         } else if(this.size == 'small') {
             this.selectWidth = '191'
             this.selectHeight = '32'
-        } 
+        } else if(this.size == 'medium') {
+            this.selectWidth = '205'
+            this.selectHeight = '40'
+            this.selectFontSize = '14'
+        }
         if(this.widthStr) {
-            console.log('one')
             this.selectWidth = this.widthStr
         }
+    },
+    mounted() {
+        if(this.selectNameChuan) {
+            this.selectName = this.selectNameChuan
+        }
         if(this.subject) {
             this.options = JSON.parse(JSON.stringify(this.subject))
+            console.log(this.options, '我收到的数据')
         }
         if(this.subjectId) {
             this.optionsOId = JSON.parse(JSON.stringify(this.subjectId))
@@ -189,13 +198,28 @@ export default {
                 }
             }
         }
-        console.log(this.subjectId)
         this.dailyListIndex = this.idx
+        console.log(this.selectWidth, this.selectHeight)
         // this.moveIon = JSON.parse(JSON.stringify(this.clearable))
     },
     methods: {
+        // 循环取值
+        traverseArr(arr, idd){
+            console.log(arr, idd, '传过来的值')
+            let id = idd[0]
+            if(arr) {
+                for(var i in arr) {
+                    if(arr[i].value == id) {
+                        this.selectName = arr[i].label
+                        return
+                    }
+                    if(arr[i].children) {
+                        this.traverseArr(arr[i].children, idd)
+                    }
+                }
+            }
+        },
         selectCli() {
-            console.log('我被你触发了')
             if(!this.disabled) {
                 this.$refs.selectDiv.focus()
                 this.classDiv = !this.classDiv
@@ -205,10 +229,13 @@ export default {
         },
         selectClihide() {
             if(this.classDiv) {
-                this.transitionBoxLiIdx = ''
-                this.show = !this.show
-                this.classDiv = false
-                this.move = false
+                let that = this
+                setTimeout(function () {
+                    that.transitionBoxLiIdx = ''
+                    that.show = !that.show
+                    that.classDiv = false
+                    that.move = false
+                }, 100)
             }
         },
         liMouseOver(index, item) {
@@ -223,6 +250,7 @@ export default {
         },
         // 点击
         liClist(item) {
+            console.log('我被你点击了')
             if(!item.children) {
                 this.selectName = item.label
                 let obj = {
@@ -235,14 +263,16 @@ export default {
                 this.selectName = item.label
                 let obj = {
                     id: item.value,
-                    distinction: this.distinction
+                    distinction: this.distinction,
+                    item: item
                 }
                 this.$emit('vueCasader', obj)
+            } else {
+                this.transitionBoxLiIdx = ''
+                this.show = !this.show
+                this.classDiv = false
+                this.move = false
             }
-            this.transitionBoxLiIdx = ''
-            this.show = !this.show
-            this.classDiv = false
-            this.move = false
         },
         // 接受子组件传过来的值
         cascaderOptionClick(item) {
@@ -267,7 +297,9 @@ export default {
                 label: this.$t('defaultText.pleaseChoose'),
                 value: ''
             }
-            this.show = true
+            this.show = false
+            this.classDiv = false
+            this.move = false
             this.liClist(obj)
         }
     },
@@ -344,7 +376,7 @@ export default {
         box-sizing: border-box;
         margin: 5px 0;
         // box-shadow: 0 2px 12px #dfdfdf;
-        max-height: 274px;
+        height: 274px;
         overflow: auto;
         z-index: 500 !important;
     }

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet/src/components/cascaderOption.vue

@@ -2,7 +2,7 @@
   <div class="childComponents">
     <div class="child">
         <ul class="transitionBoxUl">
-            <li :class="transitionBoxLiIdx == index ? 'liHover' : ''" v-for="(item, index) in options" :key="index" @mouseover="liMouseOver(index, item)" @click="liClick(item)"> 
+            <li :class="transitionBoxLiIdx == index ? 'liHover' : ''" v-for="(item, index) in options" :key="index" @mouseover="liMouseOver(index, item)" @click.stop="liClick(item)"> 
                 <span :class="item.children ? 'idxspan' : ''" v-if="!radios">{{item.label}}</span>
                 <span v-if="radios" style="margin-left: -15px">
                     <el-radio v-model="departmentId" :label="item.value">
@@ -97,6 +97,7 @@ export default {
         }
     },
     liClick(item) {
+        console.log('我是子组件')
         if(!item.children) {
             this.$emit("cascaderOptionClick", item);
         }

+ 33 - 8
fhKeeper/formulahousekeeper/timesheet/src/views/awayOffice/awayOffice.vue

@@ -397,7 +397,8 @@
             <el-dialog  :title="$t('pleaseselectapprover')" v-if="dialogVisible" :visible.sync="dialogVisible"  width="460px">
                 <el-form label-width="140px">
                     <el-form-item :label="$t('selectdepartmentsdesignatepersonnel')" >
-                        <el-cascader filterable ref="deptCascader" v-model="curDeptId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 100%" @change="chooseDept" :options="soption" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
+                        <el-cascader filterable ref="deptCascader" v-model="curDeptId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 100%" @change="chooseDept" v-if="user.userNameNeedTranslate != 1" :options="soption" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
+                        <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="soption" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
                     </el-form-item>
                 </el-form>
                 <div slot="footer" class="dialog-footer">
@@ -660,9 +661,14 @@
 // 自定义select组件
 import selectCat from "@/components/select.vue"
 import citys from '../../assets/citys/shju.json'
+
+ // 引入自定义级联组件
+import vueCascader from "@/components/cascader.vue"
+
 export default {
     components: {
-        selectCat
+        selectCat,
+        vueCascader
     },
     name: "awayOffice",
     data(){
@@ -1670,14 +1676,33 @@ export default {
         addNode() {
             this.dialogVisible = false;
             if (this.curDeptId == null) return;
-            var node = this.$refs.deptCascader.getCheckedNodes()[0];
+
+            var node = this.user.userNameNeedTranslate != '1' ? this.vueCasaderItem : this.$refs.deptCascader.getCheckedNodes()[0];
+
+            // var node = this.$refs.deptCascader.getCheckedNodes()[0];
             if (this.isAdd) {
-                if(node.path[0] == 1){
-                    var node = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
-                }else if(node.path[0] == 2){
-                    var node = {userId: node.value, userName: node.label, auditorType: 2};
+                // if(node.path[0] == 1){
+                //     var node = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
+                // }else if(node.path[0] == 2){
+                //     var node = {userId: node.value, userName: node.label, auditorType: 2};
+                // }
+                var nodes
+                if(this.user.userNameNeedTranslate != 1) {
+                  if(node.path[0] == 1){
+                    nodes = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
+                  }else if(node.path[0] == 2){
+                    nodes = {userId: node.value, userName: node.label, auditorType: 2};
+                  }
+                } else {
+                  if(node.managerId) {
+                    nodes = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
+                  } else {
+                    nodes = {userId: node.value, userName: node.label, auditorType: 2};
+                  }
                 }
-                this.dataArray.splice(this.sindex, 0, node);
+
+
+                this.dataArray.splice(this.sindex, 0, nodes);
             } else {
             //编辑
                 this.dataArray[this.sindex].auditDeptId = node.value;

+ 16 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -86,11 +86,14 @@
         </el-select>
           
           <!-- 部门筛选 -->
-          <el-cascader v-if="(ins == 9 && permissions.reportAllTimely) || (ins == 8 && permissions.reportAllTimeDivide) || (ins == 6 && permissions.reportAllOvertime) || (ins == 11 && permissions.reportPersonnel)" v-model="departmentIdArray" :options="departmentList" :placeholder="$t('qing-xuan-ze-bu-men')"
+          <el-cascader v-if="((ins == 9 && permissions.reportAllTimely) || (ins == 8 && permissions.reportAllTimeDivide) || (ins == 6 && permissions.reportAllOvertime) || (ins == 11 && permissions.reportPersonnel)) && user.userNameNeedTranslate != 1" v-model="departmentIdArray" :options="departmentList" :placeholder="$t('qing-xuan-ze-bu-men')"
             :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable
             @change="selcts(9)" size="small" style="margin-left:10px"
           ></el-cascader>
 
+          <!-- 部门筛选 -->
+          <vueCascader :size="'small'" :widthStr="'125'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="(((ins == 9 && permissions.reportAllTimely) || (ins == 8 && permissions.reportAllTimeDivide) || (ins == 6 && permissions.reportAllOvertime) || (ins == 11 && permissions.reportPersonnel)) && user.userNameNeedTranslate == 1)" :selectNameChuan="$t('qing-xuan-ze-bu-men')"></vueCascader>
+
           <!-- 任务筛选 -->
           <el-select v-if="ins == 1" v-model="taskTypeId" :placeholder="$t('pleaseselecttype')" clearable filterable size="small" @change="selcts()" style="margin-left:10px">
             <el-option v-for="(item) in taskTypeObj" :key="item.id" :label="item.value" :value="item.id">
@@ -840,11 +843,14 @@
 
 // 自定义select组件
 import selectCat from "@/components/select.vue"
+// 引入自定义级联组件
+import vueCascader from "@/components/cascader.vue"
 
 export default {
   name: "expense",
   components: {
-    selectCat
+    selectCat,
+    vueCascader
   },
   props: {},
   data() {
@@ -2078,6 +2084,14 @@ export default {
         this.userId = obj.id
         this.selcts()
       }
+    },
+    vueCasader(obj) {
+      if(obj.distinction == 1) {
+        let arr = []
+        arr.push(obj.id)
+        this.departmentIdArray = arr
+        this.selcts(9)
+      }
     }
   },
 };

+ 7 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/expense/expense.vue

@@ -217,7 +217,7 @@
               </el-select>
             </el-form-item>
             <!-- 填报日期 -->
-            <el-form-item label="$t('fillinthedate')" >
+            <el-form-item :label="$t('fillinthedate')" >
               <el-date-picker
                 v-model="date"
                 type="daterange"
@@ -526,10 +526,15 @@
 <script>
 // 自定义select组件
 import selectCat from "@/components/select.vue"
+
+ // 引入自定义级联组件
+import vueCascader from "@/components/cascader.vue"
+
 export default {
   name: "expense",
   components: {
-    selectCat
+    selectCat,
+    vueCascader
   },
   props: {},
   data() {

+ 65 - 16
fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue

@@ -438,7 +438,10 @@
               <el-form label-width="140px">
               <el-form-item :label="$t('selectdepartmentsdesignatepersonnel')" >
                   <el-cascader filterable ref="deptCascader"  v-model="curDeptId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 100%" @change="chooseDept"
-                    :options="soption" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
+                    :options="soption" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable v-if="user.userNameNeedTranslate != 1"></el-cascader>
+
+                  <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="soption" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
+
               </el-form-item>
               </el-form>
             <div slot="footer" class="dialog-footer">
@@ -473,8 +476,9 @@
                 clearable
                 :options="Nsdata"
                 :props="{ checkStrictly: true, expandTrigger: 'hover' }"
-                :show-all-levels="false">
+                :show-all-levels="false" v-if="user.userNameNeedTranslate != 1">
               </el-cascader>
+              <vueCascader :size="'small'" :widthStr="'120'" :clearable="true" :subject="Nsdata" :radios="true" :distinction="'2'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
             </div>
             
         </div>
@@ -679,11 +683,15 @@ import { config, error } from 'dingtalk-jsapi';
 import selectCat from "@/components/select.vue"
 import Select from '../../components/select.vue';
 
+ // 引入自定义级联组件
+import vueCascader from "@/components/cascader.vue"
+
 export default {
   name: "expense",
   components: {
     selectCat,
-    Select
+    Select,
+    vueCascader
   },
   props: {},
   data() {
@@ -842,7 +850,9 @@ export default {
       userSelId: '',
       synchronizeLoading: false,
       kuanBl: 0,
-      hubs: 0
+      hubs: 0,
+      vueCasaderItem: [], // 仿数据
+      vueIAlDataSItems: undefined, // 仿数据
     };
   },
   computed: {},
@@ -1156,17 +1166,17 @@ export default {
       )
     },
     selAl(){
-        let e = this.$refs.selectAl.getCheckedNodes()[0]
+        let e = this.user.userNameNeedTranslate != 1 ? this.$refs.selectAl.getCheckedNodes()[0] : this.vueIAlDataSItems
         if(e == undefined){
           this.iAlDataS = this.iAlData
         }else{
           this.iAlDataS = []
-        for (let i = 0; i < this.iAlData.length; i++) {
-          if (e.label == this.iAlData[i].department) {
-            this.iAlDataS.push(this.iAlData[i])
+          for (let i = 0; i < this.iAlData.length; i++) {
+            if (e.label == this.iAlData[i].department) {
+              this.iAlDataS.push(this.iAlData[i])
+            }
           }
         }
-        }
     },
     // ---------
 
@@ -1281,18 +1291,33 @@ export default {
                 
             },
     addNode() {
+      // console.log(this.curDeptId, 'zhilail')
+      // return
               this.dialogVisible = false;
               if (this.curDeptId == null) return;
-              var node = this.$refs.deptCascader.getCheckedNodes()[0];
-              // console.log("node",node);
+              // if(this.user.userNameNeedTranslate != '1') {
+              var node = this.user.userNameNeedTranslate != '1' ? this.vueCasaderItem : this.$refs.deptCascader.getCheckedNodes()[0];
+              // var node = this.$refs.deptCascader.getCheckedNodes()[0];
+              console.log(this.vueCasaderItem)
+              console.log("node",node);
               
               if (this.isAdd) {
-                if(node.path[0] == 1){
-                  var node = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
-                }else if(node.path[0] == 2){
-                  var node = {userId: node.value, userName: node.label, auditorType: 2};
+                if(this.user.userNameNeedTranslate != 1) {
+                  var nodes
+                  if(node.path[0] == 1){
+                    nodes = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
+                  }else if(node.path[0] == 2){
+                    nodes = {userId: node.value, userName: node.label, auditorType: 2};
+                  }
+                } else {
+                  if(node.managerId) {
+                    nodes = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
+                  } else {
+                    nodes = {userId: node.value, userName: node.label, auditorType: 2};
+                  }
                 }
-                this.dataArray.splice(this.sindex, 0, node);
+                
+                this.dataArray.splice(this.sindex, 0, nodes);
                 
               } else {
                 //编辑
@@ -1896,6 +1921,30 @@ export default {
         this.addForm.ownerId = obj.id
         this.selts()
       }
+    },
+    vueCasader(obj) {
+      if(obj.distinction == 1) {
+        let arr = []
+        arr.push(obj.id)
+        this.curDeptId = arr
+        this.vueCasaderItem = obj.item
+        console.log(obj)
+      } else if(obj.distinction == 2) {
+        let arr = []
+        arr.push(obj.id)
+        this.NcurDeptId = arr
+        console.log(obj, '闯过奥的值')
+        if(obj.item) {
+          if(obj.item.label != this.$t('defaultText.pleaseChoose')) {
+            this.vueIAlDataSItems = obj.item
+          } else {
+            this.vueIAlDataSItems = undefined
+          }
+        } else {
+          this.vueIAlDataSItems = undefined
+        }
+        this.selAl()
+      }
     }
   }
 };

+ 54 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -24,6 +24,18 @@
                           <span v-else>
                             {{ node.label }}
                           </span>
+
+                          <!-- <span v-if="user.userNameNeedTranslate == '1'">
+                              <span v-if="node.data.children">
+                                  <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
+                              </span>
+                              <span v-else>
+                                  <ww-open-data type='userName' :openid='node.label'></ww-open-data>
+                              </span>
+                          </span>
+                          <span v-if="user.userNameNeedTranslate != '1'">
+                              {{ node.label }}
+                          </span> -->
                         </span>
 
                         <!-- <span v-if="node.label != '全部人员'" class="node none"> -->
@@ -66,7 +78,12 @@
                         </div>
                         <div v-else-if="depData != null && depData.id != -1 && depData.id != 0" class="nowTime" @click="createDepartment(0)">
                             <i class="fa fa-pencil-square-o"></i>
-                            {{depData!=null?depData.label:''}}
+                            <!-- {{depData !=null ? depData.label : ''}} -->
+                            <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
+                            <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
+                            <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
+                            <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
+                            <!-- {{translation}} -->
                         </div>
                     </el-form-item>
                     <el-form-item>
@@ -241,8 +258,11 @@
                 <el-form-item :label="$t('setupdepartment')">
                     <!-- <el-cascader v-model="handleSelectionZzjgwillchange" placeholder="请选择部门" style="width: 60%;"
                     :options="option" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader> -->
-                    <el-cascader v-model="handleSelectionZzjgwillchange" :placeholder="$t('qing-xuan-ze-bu-men')" style="width: 100%;"
+
+                    <el-cascader v-model="handleSelectionZzjgwillchange" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('qing-xuan-ze-bu-men')" style="width: 100%;"
                     :options="option" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
+
+                    <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="option" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
                 </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
@@ -332,7 +352,10 @@
                     <!-- <el-cascader v-model="insertForm.departmentId" placeholder="请选择部门" style="width: 100%"
                     :options="option" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader> -->
                     <el-cascader v-model="insertForm.departmentId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width: 100%"
-                    :options="option" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false"  clearable></el-cascader>
+                    :options="option" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false"  clearable v-if="user.userNameNeedTranslate != 1"></el-cascader>
+
+                    <vueCascader :size="'medium'" :widthStr="'430'" :clearable="true" :subject="option" :subjectId="insertForm.departmentId" :radios="true" :distinction="'2'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
+
                 </el-form-item>
                 <el-form-item :label="$t('immediatesuperior')">
                     <el-select v-model="insertForm.superiorId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 100%" filterable clearable>
@@ -652,10 +675,14 @@
 // 左右滑動
 import dragMixin from "@/common/js/tensile.js";
 import util from "../../common/js/util";
+ // 引入自定义级联组件
+import vueCascader from "@/components/cascader.vue"
 let that
 export default {
   name: "Home",
-  components: {},
+  components: {
+    vueCascader
+  },
   mixins: [dragMixin],
   created() {
     let height = window.innerHeight;
@@ -703,6 +730,7 @@ export default {
   },
   data() {
     return {
+      translation: '1', // 1、文字, 2、部门, 3、人员
       fullscreenLoading: false,
       syncMembByCardTimeResultGialog:false,
       syncMembByCardTimeMsg:null,
@@ -2555,6 +2583,8 @@ export default {
 
     // 部门列表点击
     handleNodeClick(data) {
+      this.theValues(data)
+      console.log(data)
       if (this.depData == null || data.id != this.depData.id) {
         this.depData = data;
         this.page = 1;
@@ -2562,6 +2592,13 @@ export default {
       }
     },
 
+    theValues(obj) {
+        if(obj.id != '-1') {
+          this.translation = '2'
+        } else {
+          this.translation = '1'
+        }
+    },
     // 新增、修改部门
     createDepartment(i) {
       console.log(i, '看看')
@@ -3094,6 +3131,19 @@ export default {
     //       console.log(error, '哦耶')
     //    })
     // },
+
+    // 自定义组件事件
+    vueCasader(obj) {
+        if(obj.distinction == '1') {
+          let arr = []
+          arr.push(obj.id)
+          this.handleSelectionZzjgwillchange = arr
+        } else if(obj.distinction == '2') {
+          let arr = []
+          arr.push(obj.id)
+          this.insertForm.departmentId = arr
+        } 
+    } 
   },
   mounted() {
     this.deactiveDate = util.formatDate.format(new Date(), "yyyy-MM-dd");

+ 17 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_import.vue

@@ -6,8 +6,9 @@
                 <el-form-item :label="$t('lable.department') + ':'">
                     <el-cascader v-model="search.departmentId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width: 100%"
                     :options="option" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
-                    @change="getList()" size="small"
+                    @change="getList()" size="small" v-if="user.userNameNeedTranslate != 1"
                     ></el-cascader>
+                    <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="option" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
                 </el-form-item>
                 <el-form-item :label="$t('other.project') + ':'">
                     <el-select v-model="search.projectId" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="getList()" filterable="true" size="small">
@@ -229,8 +230,12 @@
 
 <script>
     import util from "../../common/js/util";
-
+    // 引入自定义级联组件
+    import vueCascader from "@/components/cascader.vue"
     export default {
+        components: {
+            vueCascader
+        },
         data() {
             return {
                 denyForm:null,
@@ -590,6 +595,16 @@
                         type: "error"
                     });
                 });
+            },
+            // 自定义组件
+            vueCasader(obj) {
+                console.log(obj)
+                if(obj.distinction == '1') {
+                    let arr = []
+                    arr.push(obj.id)
+                    this.search.departmentId = arr
+                    this.getList()
+                }
             }
         },
         created() {

+ 23 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_profession.vue

@@ -9,10 +9,13 @@
                     </el-select>
                 </el-form-item>
                 <el-form-item label="部门:">
-                    <el-cascader v-model="search.departmentIdArray" placeholder="请选择部门" style="width: 100%"
+                    <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="search.departmentIdArray" placeholder="请选择部门" style="width: 100%"
                     :options="option" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
                     @change="getList()"
                     ></el-cascader>
+
+                    <vueCascader :size="'medium'" :clearable="true" :subject="option" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
+
                 </el-form-item>
                 <el-form-item label="日期:" style="margin-left:20px;">
                     <el-date-picker v-model="search.date" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd" 
@@ -117,8 +120,12 @@
 
 <script>
     import util from "../../common/js/util";
-
+    // 引入自定义级联组件
+    import vueCascader from "@/components/cascader.vue"
     export default {
+        components: {
+            vueCascader
+        },
         data() {
             return {
                 isAllSelect:false,
@@ -351,6 +358,20 @@
                         type: "error"
                     });
                 });
+            },
+            // 自定义级联选择器
+            vueCasader(obj) {
+                console.log(obj, '级联选择器')
+                if(obj.distinction == '1') {
+                    if(obj.id != '') {
+                        let arr = []
+                        arr.push(obj.id)
+                        this.search.departmentIdArray = arr
+                    } else {
+                        this.search.departmentIdArray = []
+                    }
+                    this.getList()
+                }
             }
         },
         created() {