Browse Source

调整钉钉转译登陆,填写日报,转译组件

Lijy 1 year ago
parent
commit
e0d3d2ac15

+ 4 - 2
fhKeeper/formulahousekeeper/timesheet/src/components/cascader.vue

@@ -318,7 +318,8 @@ export default {
                     }
                     let obj = {
                         id: item.value,
-                        distinction: this.distinction
+                        distinction: this.distinction,
+                        other: this.other
                     }
                     this.$emit('vueCasader', obj)
                 }
@@ -330,7 +331,8 @@ export default {
                     let obj = {
                         id: item.value,
                         distinction: this.distinction,
-                        item: item
+                        item: item,
+                        other: this.other
                     }
                     this.$emit('vueCasader', obj)
                 } else {

+ 46 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -475,6 +475,18 @@
                                 <el-input :disabled="!domain.canEdit || domain.isOvertime==null || domain.isOvertime==0 || !domain.isOvertime" v-model="domain.overtimeHours" @blur="triggerCalculateOT(index)" @input="domain.overtimeHours=domain.overtimeHours.replace(/[^\d.]/g,'')" style="width: 100px;"></el-input><span style="margin-left:5px">{{$t('time.hour')}}</span>
                             </div>
                         </el-form-item>
+
+                        <el-form-item label="填报部门" v-if="user.timeType.userWithMultiDept == 1">
+                            <el-select v-model="domain.reportTargetDeptId" :placeholder="'请选择部门'" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
+                                <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
+                                    <span style="float: left">
+                                        <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
+                                    </span>
+                                </el-option>
+                            </el-select>
+
+                            <vueCascader :size="'medium'" :widthStr="'200'" :clearable="true" :other="index" :subjectId="domain.reportTargetDeptId" :subject="userReportDeptList" :radios="false" :distinction="'10'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
+                        </el-form-item>
                     
                         <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
                             :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
@@ -2404,6 +2416,8 @@
                 pushWorkTimeLogDig:false,
                 pushWorkTimeLogData:[],
                 WorktimeDatepickValueForMonth:[],
+
+                userReportDeptList: []
             };
         },
         watch: {
@@ -2461,6 +2475,9 @@
             if (this.user.company.packageProject == 1) {
                 this.getBasecostItemList();
             }
+            if(this.user.timeType.userWithMultiDept == 1) {
+                this.getDeptMembData();
+            }
             if(this.user.timeType.lockWorktime){
                 this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
             }
@@ -2489,6 +2506,25 @@
                 const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
                 return isReportPictureRequired
             },
+            // 获取如何信息选的可填写部门
+            getDeptMembData() {
+                this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
+                    if (res.code == "ok") {
+                        let lists = res.data.userReportDeptList || []
+                        const optimizedList = lists.map(item => ({
+                            ...item,
+                            label: item.departmentName,
+                            value: item.departmentId,
+                        }));
+                        this.$set(this, 'userReportDeptList', optimizedList || []);
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },error => { });  
+            },
             //任务被选中
             onTaskSelected(domainItem) {
                 //取服务
@@ -7910,7 +7946,7 @@
                                 formData.append("progress", this.workForm.domains[i].progress);
                                 formData.append("workingTime", this.workForm.domains[i].workingTime);
                             } 
-
+                            
                             if(this.user.timeType.choseFromAlbum == 1 ) {
                                 console.log(this.workForm.domains[i].imgList)
                                 if(this.workForm.domains[i].imgList) {
@@ -8071,6 +8107,10 @@
                                 });
                                 return
                             }
+
+                            if(this.user.timeType.userWithMultiDept == 1) {
+                                formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId || '');
+                            }
                         }
                         this.submitingReport = true;
                         this.http.uploadFile( this.port.report.editPort, formData,
@@ -8289,6 +8329,11 @@
                     arr.push(obj.item.value)
                     this.exportParam.departmentId = arr
                 }
+
+                if(obj.distinction == '10' && obj) {
+                    const { id, other } = obj
+                    this.workForm.domains[other].reportTargetDeptId = id
+                }
             },
             //分页
             handleCurrentChange(val) {

+ 5 - 3
fhKeeper/formulahousekeeper/timesheet_h5/src/views/login/index.vue

@@ -33,7 +33,7 @@
                 rules: {
                     username: [{ required: true, message: '请输入账号' }],
                     password: [{ required: true, message: '请输入密码' }]
-                }
+                },
             };
         },
         methods: {
@@ -296,13 +296,15 @@
                         }
                         
                     } else {
+                        console.log(window.location.href)
+                        console.log(href.indexOf("corpid") > 0, '<==== href.indexOf("corpid") > 0')
+                        console.log(!(window.location.href.indexOf("ddLoginUnique") > 0), '!(window.location.href.indexOf("ddLoginUnique") > 0)')
                         //检查环境,如果是钉钉有$CORPID$
                         if(href.indexOf("corpid") > 0) {
                             if(!(window.location.href.indexOf("ddLoginUnique") > 0)) {
                                 this.tryDingDingUrlRedirect()
-                                return
+                                // return
                             }
-
                             var key = '?corpid=';
                             var jumpkey = '&jumpto=';
                             var url = location.href;