فهرست منبع

调整请假管理的问题

Lijy 2 سال پیش
والد
کامیت
937b447b53

+ 71 - 1
fhKeeper/formulahousekeeper/timesheet/src/components/select.vue

@@ -1,5 +1,6 @@
 <template>
-  <div tabindex="0" @blur="selectClihide()" style="display: inline-block;">  
+<div style="display: inline-block;">
+  <div tabindex="0" @blur="selectClihide()" style="display: inline-block;" v-if="!wxCope">
     <!-- <div :style="'width:' + selectWidth + 'px;height:' + selectHeight + 'px'" :class="classDiv ? 'select selectDiv' : 'select'" @click="selectCli" :ref="disabled ? '' : 'selectDiv'"> -->
     <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'">
@@ -70,6 +71,14 @@
       </div>
     </transition>
   </div>
+  <div v-if="wxCope" class="waihez">
+    <!-- <div @click="dianjis()">点击</div> -->
+    <div :style="`width:${selectWidth}px;height:${selectHeight}px;line-height:${selectHeight}px;background:#fff`" class="select selectDandu" @click="dianjis()">
+        <span v-if="!multiSelect"><ww-open-data type='userName' :openid='selectName'></ww-open-data></span>
+        <!-- <span>你好</span> -->
+    </div>
+  </div>
+</div>
 </template>
 
 <script>
@@ -84,6 +93,10 @@ export default {
         subjectId: {
             type: [String, Number, Array]
         },
+        wxCope: {
+            type: Boolean,
+            default: false,
+        },
         // 是否支持多选
         multiSelect: {
             type: Boolean,
@@ -265,6 +278,54 @@ export default {
         this.dailyListIndex = this.idx
     },
     methods: {
+        dianjis() {
+            if(!this.disabled) {
+                let modes = this.multiSelect ? 'multi' : 'single'
+                let that = this
+                wx.invoke("selectEnterpriseContact", {
+                    "fromDepartmentId": 0,// 必填,表示打开的通讯录从指定的部门开始展示,-1表示自己所在部门开始, 0表示从最上层开始
+                    "mode": modes,// 必填,选择模式,single表示单选,multi表示多选
+                    "type": ["user"],// 必填,选择限制类型,指定department、user中的一个或者多个
+                    "selectedDepartmentIds": [],// 非必填,已选部门ID列表。用于多次选人时可重入,single模式下请勿填入多个id
+                    "selectedUserIds": []// 非必填,已选用户ID列表。用于多次选人时可重入,single模式下请勿填入多个id
+                        },function(res){
+                            console.log(res)
+                            if (res.err_msg == "selectEnterpriseContact:ok"){
+                                console.log(res, '数据来源')
+                                if(typeof res.result == 'string'){
+                                    res.result = JSON.parse(res.result) //由于目前各个终端尚未完全兼容,需要开发者额外判断result类型以保证在各个终端的兼容性
+                                }
+                                var selectedUserList = res.result.userList; // 已选的成员列表
+                                var userId = ''
+                                var userName = ''
+                                for (var i = 0; i < selectedUserList.length; i++) {
+                                        var user = selectedUserList[i];
+                                        userId = user.id; // 已选的单个成员ID
+                                        userName = user.name;// 已选的单个成员名称
+                                        console.log(userId, userName)
+                                }
+                                for(var s in that.options) {
+                                    if(that.options[s].name == userId) {
+                                        that.selectName = userId
+                                        that.wxCoper(that.options[s].id)
+                                    }
+                                }
+                            }
+                        }
+                );
+            }
+        },
+        wxCoper(id) {
+            let obj = {
+                id: id,
+                distinction: this.distinction,
+                index: this.index, // 选中的索引
+                other: this.other,
+                name: this.selectName
+            }
+            console.log(obj)
+            this.$emit("selectCal", obj)
+        },
         selectCli() {
             if(!this.disabled) {
                 this.$refs.selectDiv.focus()
@@ -443,6 +504,15 @@ export default {
 </script>
 
 <style scoped lang="scss">
+    .selectDandu {
+        font-size: 16px;
+    }
+    .waihez {
+        // padding-top: 7px;
+        // box-sizing: border-box;
+        // background: #FFF;
+        display: inline-block;
+    }
     .selectDiv {
         border-color: #409EFF !important;
     }

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue

@@ -558,7 +558,7 @@
                                             timestamp: res.data.timestamp, // 必填,生成签名的时间戳
                                             nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
                                             signature: res.data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
-                                            jsApiList: ['selectExternalContact'], //必填,传入需要使用的接口名称
+                                            jsApiList: ['selectExternalContact', 'selectEnterpriseContact'], //必填,传入需要使用的接口名称
                                             success: function (result) {
                                                 console.log(result, '请求微信成功')
                                                 console.log(window, 'window')

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

@@ -185,7 +185,7 @@
                   <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" style="width: 120px"></selectCat>
+              <selectCat v-if="user.userNameNeedTranslate == 1" :size="'small'" :subject="users" :subjectId="ownerIds" :distinction="'3'" :disabled="false" :widthStr="'120'" :clearable="true" @selectCal="selectCal" v-show="permissions.leaveAll" style="width: 120px"></selectCat>
             </div>
             <div>
               <span style="color: #606266">{{ $t('leavetype') }}</span>
@@ -323,7 +323,7 @@
         <div class="ctons" style="width: 98%;">
           <div style="display: flex;align-items: center;padding-bottom: 20px;border-bottom: 1px solid #f2f2f2">
             <div style="display: inline-block;width: 350px">
-              <el-input style="float:left;" v-model="keyword" class="input-with-select" :placeholder="$t('pleaseenterstaffsearch')" clearable="true" size="small">
+              <el-input style="float:left;" v-if="user.userNameNeedTranslate != 1" v-model="keyword" class="input-with-select" :placeholder="$t('pleaseenterstaffsearch')" clearable="true" size="small">
                   <el-button slot="append" @click="statistical()" icon="el-icon-search"></el-button>
               </el-input>
             </div>
@@ -390,7 +390,19 @@
         <el-col :span="6" >
             <el-scrollbar style="height:100%;border:1px solid #dddddd;margin-left:15px;" >
             <div class="tree" :style="'height:'+ (tableHeight-120) + 'px'">
-                <el-tree :data="sdata" :props="sdefaultProps" @node-click="handleNodeClick" accordion></el-tree>
+                <el-tree :data="sdata" :props="sdefaultProps" @node-click="handleNodeClick" accordion>
+                  <!-- 添加试试看 -->
+                  <span class="custom-tree-node" slot-scope="{ node, data }">
+                      <!-- <span>{{ node.label }}</span> -->
+                      <span v-if="user.userNameNeedTranslate == '1'">
+                        <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
+                      </span>
+                      <span v-else>
+                        {{ node.label }}
+                        <span v-if="false">{{data}}</span>
+                      </span>
+                  </span>
+                </el-tree>
             </div>
             </el-scrollbar>
         </el-col>
@@ -459,7 +471,7 @@
               <el-button size="small" @click="changeAltime(0)">{{ $t('volumeset') }}</el-button>
             </div>
             <div style="display: inline-block;width: 26%">
-              <el-input style="float:left;" v-model="keywordAl" class="input-with-select" :placeholder="$t('pleaseenterhepersonnamesearch')" clearable="true" size="small" @clear="clearsearchAl()">
+              <el-input style="float:left;" v-model="keywordAl" v-if="user.userNameNeedTranslate != 1" class="input-with-select" :placeholder="$t('pleaseenterhepersonnamesearch')" clearable="true" size="small" @clear="clearsearchAl()">
                   <el-button slot="append" @click="searchAl()" icon="el-icon-search"></el-button>
               </el-input>
             </div>

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

@@ -420,6 +420,8 @@
                         </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>
+                        <!-- <selectCat v-if="user.userNameNeedTranslate == '1'" :wxCope="true" :size="'size'" :subjectId="executorItem.executorId" :distinction="'1'" :subject="users"  @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>