Browse Source

调整自定义组件

Lijy 2 years ago
parent
commit
35edff14c6

+ 43 - 7
fhKeeper/formulahousekeeper/timesheet/src/components/select.vue

@@ -1,6 +1,6 @@
 <template>
   <div tabindex="0" @blur="selectClihide()" style="display: inline-block;">  
-    <div :style="'width:' + selectWidth + 'px;height:' + selectHeight + 'px'" :class="classDiv ? 'select selectDiv' : 'select'" @click="selectCli" ref="selectDiv">
+    <div :style="'width:' + selectWidth + 'px;height:' + selectHeight + 'px'" :class="classDiv ? 'select selectDiv' : 'select'" @click="selectCli" :ref="disabled ? '' : 'selectDiv'">
         <div :class="selectName == $t('defaultText.pleaseChoose') ? 'selecttex selecttexXuan' : 'selecttex'">
             <!-- <ww-open-data type='userName' :openid='selectName'></ww-open-data> -->
             {{selectName}}
@@ -37,8 +37,9 @@ export default {
             type: String
         },
         subjectId: {
-            type: String
+            type: [String, Number]
         },
+        // 当前页面用到的第几个
         distinction: {
             type: String,
             default: '1',
@@ -55,7 +56,26 @@ export default {
         index: {
             type: String
         },
-
+        // 是否禁用
+        disabled: {
+            type: Boolean,
+            default: false
+        },
+        // 是否可清空
+        clearable: {
+            type: Boolean,
+            default: false
+        },
+        // 是否可搜索
+        filterable: {
+            type: Boolean,
+            default: false
+        },
+        // 其他数据
+        other: {
+            type: [String, Number, Boolean],
+            default: false
+        }
     },
     components: {
         selectWidth: '150',
@@ -94,6 +114,19 @@ export default {
                 console.log(newValue, oldValue)
                 this.dailyListIndex = newValue
             },
+        },
+        subjectId: {
+            handler(newValue, oldValue) {
+                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
+                        }
+                    }
+                }
+            },
         }
     },
     created() {},
@@ -116,14 +149,16 @@ export default {
                 }
             }
         }
-        console.log(this.options, this.optionsOId)
+        console.log(this.subjectId)
         this.dailyListIndex = this.idx
     },
     methods: {
         selectCli() {
-            this.$refs.selectDiv.focus()
-            this.classDiv = !this.classDiv
-            this.show = !this.show
+            if(!this.disabled) {
+                this.$refs.selectDiv.focus()
+                this.classDiv = !this.classDiv
+                this.show = !this.show
+            }
         },
         selectClihide() {
             if(this.classDiv) {
@@ -148,6 +183,7 @@ export default {
                     id: nameId,
                     distinction: this.distinction,
                     index: this.index, // 选中的索引
+                    other: this.other
                 }
                 this.$emit("selectCal", obj)
             }

+ 39 - 9
fhKeeper/formulahousekeeper/timesheet/src/views/awayOffice/awayOffice.vue

@@ -157,14 +157,17 @@
             <div class="ctons">
         <!-- 出差列表筛选 -->
                 <div class="flex">
-                    <div><el-select v-model="ownerIds" :placeholder="$t('pleaseselectbusinesstraveler')" clearable @change="billss(1)" style="width: 140px" size="small" filterable="true">
+                    <div>
+                        <el-select v-if="user.userNameNeedTranslate != 1" v-model="ownerIds" :placeholder="$t('pleaseselectbusinesstraveler')" clearable @change="billss(1)" style="width: 140px" size="small" filterable="true">
                             <el-option
                             v-for="item in users"
                             :key="item.id"
                             :label="item.name"
                             :value="item.id">
                             </el-option>
-                    </el-select></div>
+                        </el-select>
+                        <selectCat v-if="user.userNameNeedTranslate == 1" :size="'small'" :subject="users" :subjectId="ownerIds" :clearable="true" :filterable="true" :distinction="'1'" :other="'1'" @selectCal="selectCal"></selectCat>
+                    </div>
                     <div><span style="color: #606266">{{ $t('traffictools') }}</span>
                         <el-select v-model="type" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="billss(1)" style="width: 140px;" size="small" filterable="true">
                             <el-option :label="$t('plane')" :value="0"></el-option>
@@ -201,7 +204,10 @@
                 <el-table :data="tableList" style="width: 100%" height="90%" :loading="tableListLoading">
                     <el-table-column prop="ownerName" :label="$t('businesspersonnel')" width="100" fixed="left" align="center">
                         <template slot-scope="scope">
-                            <span :style="scope.row.dayCount >= 10 ? 'color:#e62412' : ''">{{scope.row.ownerName}}</span>
+                            <span :style="scope.row.dayCount >= 10 ? 'color:#e62412' : ''">
+                                <span v-if="user.userNameNeedTranslate != 1">{{scope.row.ownerName}}</span>
+                                <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.ownerName'></ww-open-data></span>
+                            </span>
                         </template>
                     </el-table-column>
                     <!-- <el-table-column prop="reason" label="出差事由" width="150" header-align="center"></el-table-column> -->
@@ -317,7 +323,8 @@
                     <el-table-column prop="ownerName" :label="$t('lable.name')" width="300">
                         <template slot-scope="scope">
                             <div v-if="scope.row.ownerName">
-                            {{scope.row.ownerName}}
+                                <span v-if="user.userNameNeedTranslate != 1">{{scope.row.ownerName}}</span>
+                                <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.ownerName'></ww-open-data></span>
                             </div>
                             <div v-else>
                             <span>{{ $t('nostatisticsonbusinesstripsatpresent') }}</span>
@@ -325,9 +332,10 @@
                         </template>
                     </el-table-column>
                     <el-table-column prop="departmentName" :label="$t('lable.department')" width="300">
-                        <!-- <template slot-scope="scope">
-                            {{scope.row.departmentName}}/天
-                        </template> -->
+                        <template slot-scope="scope">
+                            <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>
+                        </template>
                     </el-table-column>
                     <el-table-column prop="dayCount" :label="$t('cumulativebusinesstripdays')" width="300">
                         <template slot-scope="scope">
@@ -506,7 +514,14 @@
             <!-- <el-table-column prop="date" label="日期" width="150"></el-table-column>
             <el-table-column prop="name" label="姓名" width="200"></el-table-column>
             <el-table-column prop="address" label="地址"></el-table-column> -->
-            <el-table-column prop="ownerName" :label="$t('businesspersonnel')" width="100" fixed="left"></el-table-column>
+            <el-table-column prop="ownerName" :label="$t('businesspersonnel')" width="100" fixed="left">
+                <template slot-scope="scope">
+                    <div>
+                        <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.ownerName'></ww-open-data></span>
+                        <span v-if="user.userNameNeedTranslate != 1">{{scope.row.ownerName}}</span>
+                    </div>
+                </template>
+            </el-table-column>
             <el-table-column prop="reason" :label="$t('travelreason')" width="150" header-align="center"></el-table-column>
             <el-table-column prop="projectName" :label="$t('screening.inputProject')" width="150" align="center"></el-table-column>
             <el-table-column :label="$t('traffictools')" width="120" align="center">
@@ -621,10 +636,11 @@
         <div>
             <div class="dingdingtongbu">
                 <span>{{ $t('screening.selectPeople') }}</span>
-                <el-select v-model="ownerIdsId" :placeholder="$t('pleaseselectpersonnel')" style="width:280px" size="small" filterable="true">
+                <el-select v-if="user.userNameNeedTranslate != 1" v-model="ownerIdsId" :placeholder="$t('pleaseselectpersonnel')" style="width:280px" size="small" filterable="true">
                     <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
                     </el-option>
                 </el-select>
+                <selectCat v-if="user.userNameNeedTranslate == 1" :size="'small'" :subject="users" :subjectId="ownerIdsId" :distinction="'2'" :filterable="true" @selectCal="selectCal"></selectCat>
             </div>
             <div class="dingdingtongbu" style="margin-top: 20px">
                 <span>{{ $t('message.period') }}</span>
@@ -641,8 +657,13 @@
 </template>
 
 <script>
+// 自定义select组件
+import selectCat from "@/components/select.vue"
 import citys from '../../assets/citys/shju.json'
 export default {
+    components: {
+        selectCat
+    },
     name: "awayOffice",
     data(){
         // 验证手机号
@@ -800,6 +821,15 @@ export default {
         // console.log("session",this.wuduData);
     },
     methods: {
+        // 自定义事件
+        selectCal(obj) {
+            if(obj.distinction == '1') {
+                this.ownerIds = obj.id
+                this.billss(obj.other)
+            } else if(obj.distinction == '2') {
+                this.ownerIdsId = obj.id
+            }
+        },
         dingdingListExport(){
             let parameter = {
                 keyword: ''

+ 58 - 9
fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue

@@ -106,11 +106,14 @@
                 <!-- 请假人 -->
                 <el-form-item :label="$t('leavepeople')" prop="ownerId"  style="width: 300px">
                     <!--普通员工只能自己填报自己的 -->
-                    <el-select v-model="addForm.ownerId" @change="txselts(addForm.leaveType,addForm.ownerId)" :placeholder="$t('defaultText.pleaseChoose')" style="width: 240px" :disabled="true" filterable="true">
+                    <el-select v-if="user.userNameNeedTranslate != 1" v-model="addForm.ownerId" @change="txselts(addForm.leaveType,addForm.ownerId)" :placeholder="$t('defaultText.pleaseChoose')" style="width: 240px" :disabled="true" filterable="true">
                         <span v-for="(item, index) in users" :key="index">
                         <el-option :label="item.name" :value="item.id"></el-option>
                         </span> 
                     </el-select>
+
+                    <selectCat v-if="user.userNameNeedTranslate == 1" :size="'small'" :subject="users" :subjectId="addForm.ownerId" :distinction="'1'" :disabled="true" @selectCal="selectCal"></selectCat>
+
                 </el-form-item>
                 <!-- 电话 -->
                 <el-form-item :label="$t('phone')" prop="tel" style="margin-right:300px">
@@ -133,6 +136,8 @@
                       :value="item.id"
                       ></el-option>
                     </el-select>
+
+                    <!-- <selectCat v-if="user.userNameNeedTranslate != 1" :size="'small'" :subject="users" :subjectId="addForm.ownerId" :distinction="'1'" :disabled="false" @selectCal="selectCal"></selectCat> -->
                 </el-form-item>
                 <!-- 时间选择 -->
                 <el-form-item :label="flg ? $t('optiondate') : $t('other.timeSelection')" style="width: 100%;">
@@ -175,11 +180,12 @@
         <div class="ctons" style="width: 98%;">
           <div class="flex">
             <div>
-              <el-select v-model="ownerIds" :placeholder="$t('pleaseselectthepersonaskingforleave')" clearable @change="chufas()" style="width: 160px" size="small" v-show="permissions.leaveAll" filterable="true">
+              <el-select v-if="user.userNameNeedTranslate != 1" v-model="ownerIds" :placeholder="$t('pleaseselectthepersonaskingforleave')" clearable @change="chufas()" style="width: 160px" size="small" v-show="permissions.leaveAll" filterable="true">
                   <span v-for="(item, index) in users" :key="index">
                   <el-option :label="item.name" :value="item.id"></el-option>
                   </span> 
               </el-select>
+              <selectCat v-if="user.userNameNeedTranslate == 1" :size="'small'" :subject="users" :subjectId="ownerIds" :distinction="'3'" :disabled="false" :clearable="true" @selectCal="selectCal" v-show="permissions.leaveAll"></selectCat>
             </div>
             <div>
               <span style="color: #606266">{{ $t('leavetype') }}</span>
@@ -213,7 +219,16 @@
             </div>
           </div>
             <el-table v-loading="loading" :data="tableData" style="width: 100%" height="94%">
-                <el-table-column prop="ownerName" :label="$t('leavepeople')" min-width="120" fixed="left"></el-table-column>
+                <el-table-column prop="ownerName" :label="$t('leavepeople')" min-width="120" fixed="left">
+                  <template slot-scope="scope">
+                    <div>
+                      <span v-if="user.userNameNeedTranslate != 1">{{scope.row.ownerName}}</span>
+                      <span v-if="user.userNameNeedTranslate == 1">
+                        <ww-open-data type='userName' :openid='scope.row.ownerName'></ww-open-data>
+                      </span>
+                    </div>
+                  </template>
+                </el-table-column>
                 <el-table-column prop="tel" :label="$t('phone')" min-width="120"></el-table-column>
                 <el-table-column prop="leaveType" :label="$t('leavetype')" min-width="120">
                   <template slot-scope="scope">
@@ -345,7 +360,8 @@
               <el-table-column prop="ownerName" :label="$t('lable.name')" width="300">
                 <template slot-scope="scope">
                     <div v-if="scope.row.ownerName">
-                      {{scope.row.ownerName}}
+                      <span v-if="user.userNameNeedTranslate != 1">{{scope.row.ownerName}}</span>
+                      <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.ownerName'></ww-open-data></span>
                     </div>
                     <div v-else>
                       <span>{{ $t('Nstatisticpresent') }}</span>
@@ -468,13 +484,23 @@
               <el-table-column prop="userName" :label="$t('lable.name')" width="200">
                 <template slot-scope="scope">
                   <div v-if="scope.row.userName">
-                    {{scope.row.userName}}
+                    <span v-if="user.userNameNeedTranslate != 1">
+                      {{scope.row.userName}}
+                    </span>
+                    <span v-if="user.userNameNeedTranslate == 1">
+                      <ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data>
+                    </span>
                   </div>
                 </template>
               </el-table-column>
               <el-table-column prop="department" :label="$t('departmentsuod')" width="200">
                 <template slot-scope="scope">
-                  {{scope.row.department}}
+                  <span v-if="user.userNameNeedTranslate != 1">
+                    {{scope.row.department}}
+                  </span>
+                  <span v-if="user.userNameNeedTranslate == 1">
+                    <ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data>
+                  </span>
                 </template>
               </el-table-column>
               <el-table-column prop="yearDays" :label="$t('annualleaveperyear')" width="200">
@@ -592,11 +618,12 @@
         <!-- 请假人 -->
         <el-form-item :label="$t('leavepeople')" prop="ownerId"  style="width: 300px;display: inline-block;">
             <!--普通员工只能自己填报自己的 -->
-            <el-select v-model="addForm.ownerId" @change="selts()" :placeholder="$t('pleaseselectthepersonaskingforleave')" style="width: 240px" :disabled="true" filterable="true">
+            <!-- <el-select v-if="user.userNameNeedTranslate != 1" v-model="addForm.ownerId" @change="selts()" :placeholder="$t('pleaseselectthepersonaskingforleave')" style="width: 240px" :disabled="true" filterable="true">
                 <span v-for="(item, index) in users" :key="index">
                 <el-option :label="item.name" :value="item.id"></el-option>
                 </span>
-            </el-select>
+            </el-select> -->
+            <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :subject="users" :subjectId="addForm.ownerId" :disabled="true" :distinction="'4'" :filterable="true" @selectCal="selectCal"></selectCat>
         </el-form-item>
         <!-- 电话 -->
         <el-form-item :label="$t('phone')" prop="tel" style="width: 300px;display: inline-block;">
@@ -648,9 +675,16 @@
 
 <script>
 import { config, error } from 'dingtalk-jsapi';
+// 自定义select组件
+import selectCat from "@/components/select.vue"
+import Select from '../../components/select.vue';
+
 export default {
   name: "expense",
-  components: {},
+  components: {
+    selectCat,
+    Select
+  },
   props: {},
   data() {
     //验证手机号
@@ -1847,6 +1881,21 @@ export default {
         remark: ''
       }
       this.getUsers()
+    },
+    // 自定义组件事件
+    selectCal(obj) {
+      if(obj.distinction == '1') {
+        this.addForm.ownerId = obj.id
+        this.txselts(obj.other, obj.id)
+      } else if(obj.distinction == '2') {
+
+      } else if(obj.distinction == '3') {
+        this.ownerIds = obj.id
+        this.chufas()
+      } else if(obj.distinction == '4') {
+        this.addForm.ownerId = obj.id
+        this.selts()
+      }
     }
   }
 };

+ 8 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/fileCenter.vue

@@ -66,7 +66,14 @@
                         {{scope.row.isFolder==0?scope.row.size:"-"}}
                     </template>
                 </el-table-column>
-                <el-table-column prop="creatorName" :label="$t('creator')" width="100"></el-table-column>
+                <el-table-column prop="creatorName" :label="$t('creator')" width="100">
+                    <template slot-scope="scope">
+                        <div>
+                            <span v-if="user.userNameNeedTranslate != 1">{{scope.row.creatorName}}</span>
+                            <span v-else><ww-open-data type='userName' :openid='scope.row.creatorName'></ww-open-data></span>
+                        </div>
+                    </template>
+                </el-table-column>
                 <el-table-column prop="indate" :label="$t('creationtime')" sortable="true" width="100"></el-table-column>
                 <el-table-column width="140">
                     <template slot-scope="scope" >

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

@@ -15,7 +15,10 @@
                     </el-row>
                     <el-row :gutter="10" v-if="user.timeType.projectWithDept">
                         <el-col :span="5" ><span class="gray_label">{{ $t('subordinatedepartments') }}:</span></el-col><el-col :span="7" ></el-col>
-                        <el-col :span="18" ><span>{{project.departmentName}}</span></el-col>
+                        <el-col :span="18" >
+                            <span v-if="user.userNameNeedTranslate != 1">{{project.departmentName}}</span>
+                            <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='project.departmentName'></ww-open-data></span>
+                        </el-col>
                     </el-row>
                     <el-row :gutter="10">
                         <el-col :span="5" ><span class="gray_label">{{ $t('state.states') }}:</span></el-col><el-col :span="7" ><span >{{project.status==null?'-':statusTxt[project.status]}}</span></el-col>
@@ -95,7 +98,10 @@
                     <el-link v-if="user.id == project.creatorId || user.id == project.inchargerId || permissions.projectManagement" @click="showEditPar" style="float:right;"><i class="el-icon-edit"  ></i></el-link>
                     </div>
                     <div style="margin-top:10px;color:#999;">{{ $t('projectmanager') }}</div>
-                    <div><el-link style="margin:10px" @click="showUser(project.inchargerId)">{{project.inchargerName}}</el-link></div>
+                    <div><el-link style="margin:10px" @click="showUser(project.inchargerId)">
+                        <span v-if="user.userNameNeedTranslate != 1">{{project.inchargerName}}</span>
+                        <span v-else><ww-open-data type='userName' :openid='project.inchargerName'></ww-open-data></span>
+                    </el-link></div>
                     <div style="margin-top:10px;color:#999;">{{ $t('newspaperauditor') }}</div>
                     <div>
                         <span v-if="project.auditorList.length == 0" style="margin:10px;">-</span>
@@ -104,7 +110,10 @@
                    
                     <div v-show="project.isPublic == 0" style="color:#999;">{{ $t('participantin') }}</div>
                     <div v-show="project.isPublic == 0" >
-                        <el-link v-for="item in project.participationList" :key="item.id" style="margin:10px;" @click="showUser(item.id)">{{item.name}}</el-link>
+                        <el-link v-for="item in project.participationList" :key="item.id" style="margin:10px;" @click="showUser(item.id)">
+                            <span v-if="user.userNameNeedTranslate != 1">{{item.name}}</span>
+                            <span v-else><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
+                        </el-link>
                         <el-button class="el-icon-plus" @click="addMembVisible=true" size="mini"></el-button>
                     </div>
                 </div>
@@ -237,11 +246,17 @@
         </div>
         <!--用户详细信息弹出框-->
         <el-dialog :title="$t('Checkthedetails')" v-if="userDetailVisible" :visible.sync="userDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
-            <div class="line"><span>{{ $t('lable.name') }}</span><span>{{userDetail.name}}</span></div>
+            <div class="line"><span>{{ $t('lable.name') }}</span>
+                <span v-if="user.userNameNeedTranslate != 1">{{userDetail.name}}</span>
+                <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='userDetail.name'></ww-open-data></span>
+            </div>
             <div class="line"><span>{{ $t('Worknumber') }}</span><span>{{userDetail.jobNumber}}</span></div>
             <div class="line"><span>{{ $t('lable.phone') }}</span><span>{{userDetail.phone}}</span></div>
             <div class="line"><span>{{ $t('jiao-se') }}</span><span>{{roleArray[userDetail.role]}}</span></div>
-            <div class="line"><span>{{ $t('lable.department') }}</span><span>{{userDetail.departmentName}}</span></div>
+            <div class="line"><span>{{ $t('lable.department') }}</span>
+                <span v-if="user.userNameNeedTranslate != 1">{{userDetail.departmentName}}</span>
+                <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='userDetail.departmentName'></ww-open-data></span>
+            </div>
             <div slot="footer" class="dialog-footer">
                 <el-button type="primary" @click="userDetailVisible = false" >{{ $t('btn.determine') }}</el-button>
             </div>
@@ -273,8 +288,8 @@
             <el-table :data="contractRecordData" height="500px" :loading="contractRecordLoading" :default-sort="{prop: 'date', order: 'descending'}">
                 <el-table-column :label="$t('other.operator')" prop="name" min-width="100">
                     <template slot-scope="scope">
-                        <!-- <span>{{users.filter(item => item.id == scope.row.editUserId)[0].name}}</span> -->
-                        <span>{{filterUserContract(scope.row.editUserId)}}</span>
+                        <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='filterUserContract(scope.row.editUserId)'></ww-open-data></span>
+                        <span v-else>{{filterUserContract(scope.row.editUserId)}}</span>
                     </template>
                 </el-table-column>
                 <el-table-column :label="$t('xiu-gai-shi-jian')" prop="date" min-width="120">
@@ -431,9 +446,10 @@
                     </el-select>
                 </el-form-item>
                 <el-form-item :label="$t('projectmanager')" >
-                    <el-select v-model="addForm.inchargerId"  filterable :placeholder="$t('defaultText.pleaseChoose')" style="width:100%;" >
+                    <el-select v-if="user.userNameNeedTranslate != 1" v-model="addForm.inchargerId"  filterable :placeholder="$t('defaultText.pleaseChoose')" style="width:100%;" >
                         <el-option v-for="item in project.participationList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                     </el-select>
+                    <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :subject="project.participationList" :subjectId="addForm.inchargerId" :distinction="'1'" @selectCal="selectCal"></selectCat>
                 </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
@@ -479,15 +495,21 @@
                                
                                <el-table-column prop="membNames" :label="$t('personnelproportion')">
                                    <template slot-scope="scope">
-                                       <span style="margin:0 5px;" v-for="item in scope.row.membList" :key="item.membId">{{item.membName}}({{item.percentage}}%)</span>
-                                       <el-link @click="showEditPpMembs(scope.row)">{{(scope.row.membList == null || scope.row.membList.length == 0)?$t('professionalparticipants'):$t('setup')}}</el-link>
+                                       <span style="margin:0 5px;" v-for="item in scope.row.membList" :key="item.membId">
+                                            <span v-if="user.userNameNeedTranslate != 1">{{item.membName}}({{item.percentage}}%)</span>
+                                            <span v-if="user.userNameNeedTranslate == 1">
+                                                <ww-open-data type='userName' :openid='item.membName'></ww-open-data>({{item.percentage}}%)
+                                            </span>
+                                        </span>
+                                       <el-link @click="showEditPpMembs(scope.row)">
+                                            {{(scope.row.membList == null || scope.row.membList.length == 0)?$t('professionalparticipants'):$t('setup')}}
+                                       </el-link>
                                    </template>
                                </el-table-column>
                                <el-table-column prop="inchargerName" width="120" :label="$t('head')">
                                    <template slot-scope="scope">
                                        <el-select v-model="scope.row.inchargerId" >
                                            <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id">
-                                               
                                            </el-option>
                                        </el-select>
                                    </template>
@@ -634,8 +656,13 @@
 }
 </style>
 <script>
+    // 自定义select组件
+    import selectCat from "@/components/select.vue"
     import util from "../../common/js/util";
     export default {
+        components: {
+            selectCat
+        },
         data() {
             return {
                 permissions: JSON.parse(sessionStorage.getItem("permissions")),
@@ -1944,6 +1971,11 @@
                         type: "error"
                     });
                 });
+            },
+            selectCal(obj) {
+                if(obj.distinction == '1' ) {
+                    this.addForm.inchargerId = obj.id
+                }
             }
         },
         created() {

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

@@ -92,11 +92,20 @@
                         <div>
                             <el-form label-width="80px">
                                 <el-form-item :label="$t('head') + ':'">
-                                    {{groupDetailData.incharger}}
+                                    <span v-if="user.userNameNeedTranslate != '1'">{{groupDetailData.incharger}}</span>
+                                    <span v-if="user.userNameNeedTranslate == '1'">
+                                        <ww-open-data type='userName' :openid='groupDetailData.incharger'></ww-open-data>
+                                    </span>
                                 </el-form-item>
                                 <el-form-item :label="$t('participantin') + ':'">
                                     <span v-for="(item, index) in groupDetailData.participators" :key="index">
-                                        {{item.userName}} <span v-if="index < groupDetailData.participators.length - 1">、</span>
+                                        <span v-if="user.userNameNeedTranslate != '1'">
+                                            {{item.userName}} 
+                                        </span>
+                                        <span v-if="user.userNameNeedTranslate == '1'"> 
+                                            <ww-open-data type='userName' :openid='item.userName'></ww-open-data>
+                                        </span>
+                                        <span v-if="index < groupDetailData.participators.length - 1">、</span>
                                     </span>
                                 </el-form-item>
                             </el-form>
@@ -190,7 +199,14 @@
                                                             <span v-if="element.endDate >= times || element.taskStatus == 1"><i v-if="element.endDate != null" class="el-icon-date" style="margin-left:5px">&nbsp;&nbsp;{{element.endDate}}</i></span>
                                                             <span v-else><em v-if="element.endDate != null" style="display: inline-block;padding:3px 5px"><i v-if="element.endDate != null" class="el-icon-date"><span  class="element_span"> &nbsp;&nbsp;{{element.endDate}}{{ $t('jie-zhi') }}</span></i></em></span>
                                                             <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 v-for="(exeItem, exeIndex) in element.executorName.split(',')" :key="exeIndex" :style="element.executorColor ? 'background:' + element.executorColor.split(',')[exeIndex] : ''" class="user_name_icon">
+                                                                <span v-if="user.userNameNeedTranslate != '1'">
+                                                                    {{exeItem.length>2?exeItem.substring(exeItem.length-2, exeItem.length):exeItem}}
+                                                                </span>
+                                                                <span v-if="user.userNameNeedTranslate == '1'">
+                                                                    <ww-open-data type='userName' :openid='exeItem'></ww-open-data>
+                                                                </span>
+                                                            </span>
                                                             </span>
                                                             <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;">{{ $t('ren-ling') }}</el-button>
                                                         </div>
@@ -256,7 +272,17 @@
                             </el-table-column>
                             <el-table-column prop="executorName" :label="$t('zhi-hang-ren')" width="100" >
                                 <template slot-scope="scope">
-                                    {{scope.row.executorName == null?$t('dai-fen-pei'):scope.row.executorName}}
+                                    <span v-if="user.userNameNeedTranslate != '1'">
+                                        {{scope.row.executorName == null?$t('dai-fen-pei'):scope.row.executorName}}
+                                    </span>
+                                    <span v-if="user.userNameNeedTranslate == '1'">
+                                        <span v-if="scope.row.executorName == null">
+                                            {{$t('dai-fen-pei')}}
+                                        </span>
+                                        <span v-else>
+                                            <ww-open-data type='userName' :openid='scope.row.executorName'></ww-open-data>
+                                        </span>
+                                    </span>
                                 </template>
                             </el-table-column>
                             <!-- <el-table-column prop="endDate" label="截止时间" width="100" ></el-table-column> -->
@@ -355,12 +381,17 @@
 
                 <div style="border: 1px solid #ddd;margin:5px 0;padding:5px 0;">
                 <el-form-item :label="$t('zhi-hang-ren') + (index+1)" v-for="(executorItem, index) in addForm.executorListFront" :key="index">
-                    <el-select v-model="executorItem.executorId" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" size="small" filterable clearable :placeholder="$t('pleaseselectanexecutor')" style="width:40%;" @change="$forceUpdate()">
+
+                    <el-select v-if="user.userNameNeedTranslate != 1" v-model="executorItem.executorId" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" size="small" filterable clearable :placeholder="$t('pleaseselectanexecutor')" style="width:40%;" @change="$forceUpdate()">
                         <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
                              <span style="float: left">{{ item.name }}</span>
                              <span style="float: right; color: #8492a6; font-size: 13px;margin-left: 20px" v-if="item.jobNumber">{{ item.jobNumber }}</span>
                         </el-option>
                     </el-select>
+
+                    <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :subject="users" :subjectId="executorItem.executorId" :distinction="'1'" @selectCal="selectCal" :index="index" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)"></selectCat>
+
+
                     <span style="margin-left:30px;margin-right:10px;">{{ $t('plantime') }}</span>
                     <el-input-number size="small" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" v-model="gstimday[index]" style="width:16%;" :min="1" :max="100"  :placeholder="$t('danweitian')" @change="chggstim(0,index)"></el-input-number ><span style="margin-left:5px;">{{ $t('time.day') }}</span>
                     <el-input-number size="small" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" v-model="gstimhour[index]" style="width:16%;" :min="1" :max="100"  :placeholder="$t('pleaseentertheplannedworking')" @change="chggstim(1,index)"></el-input-number ><span style="margin-left:5px;">{{ $t('time.hour') }}</span>
@@ -548,7 +579,17 @@
                             </el-table-column>
                             <el-table-column prop="executorName" :label="$t('zhi-hang-ren')" width="100" >
                                 <template slot-scope="scope">
-                                    {{scope.row.executorName == null?$t('dai-fen-pei'):scope.row.executorName}}
+                                    <span v-if="user.userNameNeedTranslate != 1">
+                                        {{scope.row.executorName == null?$t('dai-fen-pei'):scope.row.executorName}}
+                                    </span>
+                                    <span v-if="user.userNameNeedTranslate == 1">
+                                        <span v-if="scope.row.executorName == null">
+                                            {{$t('dai-fen-pei')}}
+                                        </span>
+                                        <span v-else>
+                                            <ww-open-data type='userName' :openid='scope.row.executorName'></ww-open-data>
+                                        </span>
+                                    </span>
                                 </template>
                             </el-table-column>
                             <el-table-column prop="endDate" :label="$t('deadline')" width="100" >
@@ -588,7 +629,16 @@
                     </el-table-column>
                     <el-table-column :label="$t('filenames')" prop="documentName" min-width="180"></el-table-column>
                     <el-table-column :label="$t('filesize')" prop="size" min-width="60" align="center"></el-table-column>
-                    <el-table-column :label="$t('founder')" prop="creatorName" min-width="60" align="center"></el-table-column>
+                    <el-table-column :label="$t('founder')" prop="creatorName" min-width="60" align="center">
+                        <template slot-scope="scope">
+                            <div>
+                                <span v-if="user.userNameNeedTranslate != 1">{{scope.row.creatorName}}</span>
+                                <span v-if="user.userNameNeedTranslate == 1">
+                                    <ww-open-data type='departmentName' :openid='scope.row.creatorName'></ww-open-data>
+                                </span>
+                            </div>
+                        </template>
+                    </el-table-column>
                     <el-table-column :label="$t('creationtime')" prop="indate" min-width="120" align="center">
                         <template slot-scope="scope">
                             <span>{{scope.row.indate[0] + '-' + scope.row.indate[1] + '-' + scope.row.indate[2] + '\u0020\u0020' + scope.row.indate[3] + ':' + scope.row.indate[4] + ':' + scope.row.indate[5]}}</span>
@@ -657,7 +707,10 @@
                         <div class="player" v-if="pl">
                             <p>{{ $t('participantin') }}</p>
                             <div class="bj">
-                                <span style="background: #778899">{{pl.length > 2 ? pl.substring(pl.length - 2, pl.length) : pl}}</span>
+                                <span style="background: #778899" v-if="user.userNameNeedTranslate != 1">{{pl.length > 2 ? pl.substring(pl.length - 2, pl.length) : pl}}</span>
+                                <span v-if="user.userNameNeedTranslate == 1">
+                                    <ww-open-data type='userName' :openid='pl'></ww-open-data>
+                                </span>
                                 <!-- <span style="background: #778899">{{pl.length}}</span> -->
                             </div>
                         </div>
@@ -676,11 +729,23 @@
                                     <!-- <el-image style="width: 30px; height: 30px" :src="url" :fit="fit"></el-image> -->
                                     <!-- <i :style="'background' + item.userColor"> -->
                                     <i :style="'background' + item.userColor">
-                                        {{item.userName.length > 2 ? item.userName.substring(item.userName.length - 2, item.userName.length) : item.userName}}
+                                        <i v-if="user.userNameNeedTranslate != 1">
+                                            {{item.userName.length > 2 ? item.userName.substring(item.userName.length - 2, item.userName.length) : item.userName}}
+                                        </i>   
+                                        <i v-if="user.userNameNeedTranslate == 1">
+                                            <ww-open-data type='userName' :openid='item.userName'></ww-open-data>
+                                        </i>
                                     </i>
                                     <div>
                                         <!-- <p>{{item.userName}}</p> -->
-                                        <p>{{item.userName}}</p>
+                                        <!-- <p> -->
+                                            <p v-if="user.userNameNeedTranslate != 1">
+                                                {{item.userName}}
+                                            </p>
+                                            <p v-if="user.userNameNeedTranslate == 1">
+                                                <ww-open-data type='userName' :openid='item.userName'></ww-open-data>
+                                            </p>
+                                        <!-- </p> -->
                                         <em>{{item.content}}</em>
                                     </div>
                                     <span>{{item.createTime | relativeTime}}</span>
@@ -727,7 +792,17 @@
                 </el-table-column>
                 <el-table-column prop="executorName" :label="$t('zhi-hang-ren')" width="100" >
                     <template slot-scope="scope">
-                        {{scope.row.executorName == null?$t('dai-fen-pei'):scope.row.executorName}}
+                        <span v-if="user.userNameNeedTranslate != 1">
+                            {{scope.row.executorName == null?$t('dai-fen-pei'):scope.row.executorName}}
+                        </span>
+                        <span v-if="user.userNameNeedTranslate == 1">
+                            <span v-if="scope.row.executorName == null">
+                                {{$t('dai-fen-pei')}}
+                            </span>
+                            <span v-else>
+                                <ww-open-data type='userName' :openid='scope.row.executorName'></ww-open-data>
+                            </span>
+                        </span>
                     </template>
                 </el-table-column>
                 <el-table-column prop="endDate" :label="$t('deadline')" width="100" ></el-table-column>
@@ -735,10 +810,16 @@
         </el-dialog>
         <!--用户详细信息弹出框-->
         <el-dialog :title="$t('Checkthedetails')" v-if="userDetailVisible" :visible.sync="userDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="400px">
-            <div class="line"><span>{{ $t('lable.name') }}</span><span>{{userDetail.name}}</span></div>
+            <div class="line"><span>{{ $t('lable.name') }}</span>
+                <span v-if="user.userNameNeedTranslate != 1">{{userDetail.name}}</span>
+                <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='userDetail.name'></ww-open-data></span>
+            </div>
             <div class="line"><span>{{ $t('Worknumber') }}</span><span>{{userDetail.jobNumber}}</span></div>
             <div class="line"><span>{{ $t('lable.phone') }}</span><span>{{userDetail.phone}}</span></div>
-            <div class="line"><span>{{ $t('lable.department') }}</span><span>{{userDetail.departmentName}}</span></div>
+            <div class="line"><span>{{ $t('lable.department') }}</span>
+                <span v-if="user.userNameNeedTranslate != 1">{{userDetail.departmentName}}</span>
+                <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='userDetail.departmentName'></ww-open-data></span>
+            </div>
             <div class="line"><span>{{ $t('costof') }}</span><span>{{userDetail.cost}}{{ $t('Yuananhour') }}</span></div>
             <div slot="footer" class="dialog-footer">
                 <el-button type="primary" @click="userDetailVisible = false" >{{ $t('btn.determine') }}</el-button>
@@ -789,9 +870,10 @@
         <el-dialog :title="$t('taskgroupleader')" v-if="setInchargerDialog" :visible.sync="setInchargerDialog" :close-on-click-modal="false" customClass="customWidth" width="300px">
             <el-form ref="formIncharger" :model="groupForm" :rules="rules" style="margin-top:10px;">
                     <el-form-item prop="taskGpIncharge">
-                        <el-select v-model="groupForm.inchargerId" :placeholder="$t('defaultText.pleaseChoose')" style="width:100%;" clearable filterable>
+                        <el-select v-if="user.userNameNeedTranslate != 1" v-model="groupForm.inchargerId" :placeholder="$t('defaultText.pleaseChoose')" style="width:100%;" clearable filterable>
                             <el-option v-for="item in joinMembList" :key="item.id" :value="item.id" :label="item.name"></el-option>
                         </el-select>
+                        <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" @selectCal="selectCal" :subject="joinMembList" :subjectId="groupForm.inchargerId" :clearable="true" :distinction="'2'"></selectCat>
                     </el-form-item>
                 </el-form>
             <div slot="footer" class="dialog-footer">
@@ -883,6 +965,8 @@
     </section>
 </template>
 <script>
+    // 自定义select组件
+    import selectCat from "@/components/select.vue"
     import util from "../../common/js/util";
     import draggable from 'vuedraggable';
     import tinymce from 'tinymce/tinymce'
@@ -915,7 +999,8 @@ import delete$ from 'dingtalk-jsapi/api/biz/cspace/delete';
             Summary,
             CostBaseline,
             Earning,
-            quillEditor // 富文本
+            quillEditor, // 富文本
+            selectCat
         },
         
         data() {
@@ -3025,6 +3110,14 @@ import delete$ from 'dingtalk-jsapi/api/biz/cspace/delete';
                 console.log('pro',pro.creatorId);
                 this.projectCreatorId = pro.creatorId
                 this.projectInchargerId = pro.inchargerId
+            },
+            // 自定义组件事件
+            selectCal(obj) {
+                if(obj.distinction == '1') {
+                    this.addForm.executorListFront[obj.index].executorId = obj.id
+                } else if(obj.distinction == '2') {
+                    this.groupForm.inchargerId = obj.id
+                }
             }
         },
         created() {