Browse Source

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper

cs 2 năm trước cách đây
mục cha
commit
94d7b50821
16 tập tin đã thay đổi với 192 bổ sung83 xóa
  1. 5 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/AuthRedirectController.java
  2. 6 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/DingDingController.java
  3. 2 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/DingDingService.java
  4. 67 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java
  5. 21 20
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java
  6. 2 2
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/application-bkserver.yml
  7. 8 7
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/application-sgai.yml
  8. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml
  9. 1 0
      fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json
  10. 1 0
      fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json
  11. 12 12
      fhKeeper/formulahousekeeper/timesheet/src/views/awayOffice/awayOffice.vue
  12. 13 13
      fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue
  13. 16 11
      fhKeeper/formulahousekeeper/timesheet/src/views/settings/timetype.vue
  14. 11 2
      fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue
  15. 9 3
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue
  16. 17 10
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/expense/details.vue

+ 5 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/AuthRedirectController.java

@@ -221,14 +221,17 @@ public class AuthRedirectController {
             }
         }
         if (isMobile) {
-            redirecUrl = mobUrl + router;
+            redirecUrl = mobUrl +"/#/"+ router;
         } else {
-            redirecUrl = pcUrl + router;
+            redirecUrl = pcUrl +"/#/"+ router;
         }
         ModelAndView modelAndView = new ModelAndView(
                 new RedirectView(redirecUrl), reqParam);
         reqParam.put("isPrivateCorpWX", 1);
         System.out.println("跳转=="+redirecUrl);
+        if (reqParam.containsKey("errorMsg")) {
+            System.out.println(reqParam.get("errorMsg"));
+        }
         return modelAndView;
     }
 

+ 6 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/DingDingController.java

@@ -110,6 +110,12 @@ public class DingDingController {
         return null;
     }
 
+    @RequestMapping("/inactiveUserNotInAuthRange")
+    public HttpRespMsg inactiveUserNotInAuthRange(String corpid) {
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.data = dingDingService.inactiveUserNotInAuthRange(corpid);
+        return msg;
+    }
 
     @RequestMapping("/syncCorpMembs")
     public HttpRespMsg syncCorpMembs(String corpid) {

+ 2 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/DingDingService.java

@@ -48,4 +48,6 @@ public interface DingDingService {
     void userLeaveOrg(String corpId, JSONArray userIdArray, LocalDate leaveDate);
 
     void userAddOrg(String corpId, JSONArray userIdArray);
+
+    String inactiveUserNotInAuthRange(String corpid);
 }

+ 67 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java

@@ -445,6 +445,73 @@ public class DingDingServiceImpl implements DingDingService {
         }
     }
 
+    public String inactiveUserNotInAuthRange(String corpid) {
+        CompanyDingding dingding = companyDingdingMapper.selectById(corpid);
+        String accessToken = null;
+        Integer companyId = dingding.getCompanyId();
+        String resultStr = "";
+        try {
+            if (dingding.getExpireTime().isBefore(LocalDateTime.now())) {
+                SysConfig config = sysConfigMapper.selectOne(new QueryWrapper<SysConfig>().eq("param_key", "dingding_suite_ticket"));
+                OapiServiceGetCorpTokenResponse result = getAuthCorpAccessToken(corpid, config.getParamValue());
+                if (result != null) {
+                    if (result.getErrcode() == 0L) {
+                        //返回成功
+                        dingding.setAccessToken(result.getAccessToken());
+                        LocalDateTime time = LocalDateTime.now();
+                        time = time.plusSeconds(result.getExpiresIn());//设置token过期时间
+                        dingding.setExpireTime(time);
+                        companyDingdingMapper.updateById(dingding);
+
+                        accessToken = dingding.getAccessToken();
+                    } else {
+                        System.out.println(result.getBody());
+                    }
+                }
+            } else {
+                accessToken = dingding.getAccessToken();
+            }
+            List<User> allActiveUserList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId).eq("is_active", 1));
+            List<User> errorUserList = new ArrayList<>();
+            for (User user : allActiveUserList) {
+                DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/get");
+                OapiV2UserGetRequest req = new OapiV2UserGetRequest();
+                req.setUserid(user.getDingdingUserid());
+                req.setLanguage("zh_CN");
+                OapiV2UserGetResponse rsp = client.execute(req, accessToken);
+                JSONObject resp = JSONObject.parseObject(rsp.getBody());
+                if (resp.getInteger("errcode") == 0) {
+                    System.out.println("读取正确");
+                } else {
+                    errorUserList.add(user);
+                }
+            }
+            if (errorUserList.size() == 0) {
+                System.out.println("全部正确");
+                resultStr = "全部在授权范围,无需停用";
+            } else {
+                List<User> updateUser = new ArrayList<>();
+                errorUserList.stream().forEach(err->{
+                    System.out.println("无效User:"+err.getName());
+                    User u = new User();
+                    u.setId(err.getId());
+                    u.setIsActive(0);
+                    u.setInductionDate(LocalDate.now());
+                    updateUser.add(u);
+                });
+                if (updateUser.size() > 0) {
+                    userService.updateBatchById(updateUser);
+                }
+                resultStr = "已检测到:" + errorUserList.stream().map(User::getName).collect(Collectors.joining(","))+"不在授权范围,自动处理为停用";
+            }
+
+        } catch (ApiException e) {
+            e.printStackTrace();
+            resultStr = e.getMessage();
+        }
+        return resultStr;
+    }
+
     private void getAuthedDeptsAndUsers(CompanyDingding dingding, String accessToken) {
         try {
             //查找默认角色

+ 21 - 20
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java

@@ -179,24 +179,26 @@ public class TimingTask {
     //每天2:11 同步钉钉用户前2天到未来30天时间段的打卡,请假,出差数据
     @Scheduled(cron = "0 11 2 ? * *")
     private void synDingDingWorkData() {
-        //if (isDev) return;
+        if (isDev) return;
         List<TimeType> timeTypeList = timeTypeMapper.selectList(new QueryWrapper<TimeType>().eq("sync_dingding", 1));
-        List<Integer> compIds = timeTypeList.stream().map(TimeType::getCompanyId).collect(Collectors.toList());
-        //企业内部应用才有权限调用
-        List<CompanyDingding> dingdingList = companyDingdingService.list(new QueryWrapper<CompanyDingding>().in("company_id", compIds)
-                .isNotNull("inner_appkey"));
-        System.out.println("==========获取钉钉内部应用的数量是:"+dingdingList.size());
-        if (dingdingList.size() > 0) {
-            DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
-            LocalDateTime yestoday = LocalDateTime.now().minusDays(2);
-            String startDate = dtf.format(yestoday);
-            String endDate = dtf.format(yestoday.plusDays(32));
-            for (int i=0;i<dingdingList.size(); i++) {
-                System.out.println("钉钉公司:"+dingdingList.get(i).getCorpName());
-                long t1 = System.currentTimeMillis();
-                dingDingService.syncUserWorkData(dingdingList.get(i), null, startDate, endDate, false);
-                long t2 = System.currentTimeMillis();
-                System.out.println("同步 "+dingdingList.get(i).getCorpName()+", 总共耗时:"+(t2-t1)+"ms");
+        if (timeTypeList.size() > 0) {
+            List<Integer> compIds = timeTypeList.stream().map(TimeType::getCompanyId).collect(Collectors.toList());
+            //企业内部应用才有权限调用
+            List<CompanyDingding> dingdingList = companyDingdingService.list(new QueryWrapper<CompanyDingding>().in("company_id", compIds)
+                    .isNotNull("inner_appkey"));
+            System.out.println("==========获取钉钉内部应用的数量是:"+dingdingList.size());
+            if (dingdingList.size() > 0) {
+                DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+                LocalDateTime yestoday = LocalDateTime.now().minusDays(2);
+                String startDate = dtf.format(yestoday);
+                String endDate = dtf.format(yestoday.plusDays(32));
+                for (int i=0;i<dingdingList.size(); i++) {
+                    System.out.println("钉钉公司:"+dingdingList.get(i).getCorpName());
+                    long t1 = System.currentTimeMillis();
+                    dingDingService.syncUserWorkData(dingdingList.get(i), null, startDate, endDate, false);
+                    long t2 = System.currentTimeMillis();
+                    System.out.println("同步 "+dingdingList.get(i).getCorpName()+", 总共耗时:"+(t2-t1)+"ms");
+                }
             }
         }
     }
@@ -393,8 +395,7 @@ public class TimingTask {
                        break;
                    case "陪产假":leaveType=7;
                        break;
-                   case "其他":leaveType=8;
-                       break;
+                   default:leaveType=8;
                }
                leaveSheet.setLeaveType(leaveType);
                leaveSheet.setProcinstId(String.valueOf(map.get("procinstId")));
@@ -784,7 +785,7 @@ public class TimingTask {
                         jsonObj.put("value", StringUtils.isEmpty(t.getAlertMsg())?"":t.getAlertMsg());
                         dataJson.add(jsonObj);
                         if(isPrivateDeploy){
-                            json.put("content",StringUtils.isEmpty(t.getAlertMsg())?"":t.getAlertMsg()+"\\n<a href=\\\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="+corpId+"&redirect_uri=http://"+pcUrl+"/api/corpInsideWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect\\\">去填写</a>");
+                            json.put("content",StringUtils.isEmpty(t.getAlertMsg())?"":t.getAlertMsg()+"\\n<a href=\\\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="+corpId+"&redirect_uri="+pcUrl+"/api/corpInsideWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect\\\">去填写</a>");
                         }else {
                             json.put("template_id","tty9TkCAAAYoevY-40ciWD5lDncDfR5w");
                             json.put("url", "https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application-bkserver.yml

@@ -109,8 +109,8 @@ configEnv:
   isPrivateDeploy: true
 
 privateDeployURL:
-  pcUrl: http://dev.huoshishanxin.com/#/
-  mobUrl: http://dev.huoshishanxin.com/#/
+  pcUrl: http://dev.huoshishanxin.com
+  mobUrl: http://dev.huoshishanxin.com
 
 # 私有化部署的企业自己的corpId
 corpId: ww0b9aafe69e506b8b

+ 8 - 7
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application-sgai.yml

@@ -7,20 +7,17 @@ server:
 spring:
   servlet:
     multipart:
-      # 配置上传文件的大小设�?
-      # Single file max size  即单个文件大�?
       max-file-size: 100MB
       max-request-size: 100MB
   datasource:
     driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://10.168.54.5:3306/man_sgai?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
+    url: jdbc:mysql://10.168.54.5:3306/man_sgai?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&useSSL=false
     username: sgaigs
     password: gs5IP5qfsia#oq5P
     hikari:
       maximum-pool-size: 60
       minimum-idle: 10
       max-lifetime: 180000
-      # 数据库连接超时时�?默认30秒,�?0000
       connection-timeout: 60000
       connection-test-query: SELECT 1
     #######redis配置######
@@ -84,7 +81,11 @@ mybatis:
 upload:
   path: /www/staticproject/timesheet/upload/
 
-
+referer:
+  refererDomain:
+    - localhost
+    - gsmb.sgai.com.cn
+    - gspc.sgai.com.cn
 
 ##actuator健康检查配�?
 management:
@@ -106,8 +107,8 @@ configEnv:
   isPrivateDeploy: true
 
 privateDeployURL:
-  pcUrl: http://gspc.sgai.com.cn/#/
-  mobUrl: http://gsmb.sgai.com.cn/#/
+  pcUrl: http://gspc.sgai.com.cn
+  mobUrl: http://gsmb.sgai.com.cn
 
 # 私有化部署的企业自己的corpId
 corpId: ww69287a3380830fb1

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml

@@ -131,7 +131,7 @@ referer:
     - mldworktime.ttkuaiban.com
     - gs.farben.com.cn
     - 47.101.180.183
-excludeUrls: /wxcorp/*,/wxcorp/*/*,/dingding/*,/error,/testClient,/corpWXAuth,/wx-corp-info/*,/clean/*,/innerRoles/*,/report/getReportListByToken,/report/getProcessErrorData,/project/synchronizationProject
+excludeUrls: /wxcorp/*,/wxcorp/*/*,/dingding/*,/error,/testClient,/corpWXAuth,/corpInsideWXAuth,/wx-corp-info/*,/clean/*,/innerRoles/*,/report/getReportListByToken,/report/getProcessErrorData,/project/synchronizationProject
 
 #企业微信相关参数
 suitId: ww4e237fd6abb635af

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json

@@ -3,6 +3,7 @@
   "navigation": {
     "reports": "Hours report",
     "projectManagement": "project management",
+    "contractManagement": "contract management",
     "professionalAudit": "Professional audit",
     "departmentAudit": "Department audit",
     "projectReportReview": "Report review",

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json

@@ -3,6 +3,7 @@
   "navigation": {
     "reports": "工时报告",
     "projectManagement": "项目管理",
+    "contractManagement": "合同管理",
     "professionalAudit": "专业审核",
     "departmentAudit": "部门审核",
     "projectReportReview": "项目报告审核",

+ 12 - 12
fhKeeper/formulahousekeeper/timesheet/src/views/awayOffice/awayOffice.vue

@@ -1,6 +1,6 @@
 <template>
 <section>
-    <div class="sidebars" ref="sidebars" style="width: 200px;display: block;background: #fff" v-if="!isDingding">
+    <div class="sidebars" ref="sidebars" style="width: 200px;display: block;background: #fff" v-if="!isSyncData">
         <h3><i class="iconfont firerock-iconbaoxiao" style="padding-right: 10px"></i>{{ $t('navigation.evectionManagement') }}</h3>
         <el-divider ></el-divider>
         <el-col :span="12">
@@ -16,7 +16,7 @@
                     </template>
                     <!-- 导航切换 -->
                     <el-menu-item index="2-1" v-if="permissions.awayOfficeAll"><p @click="bills(false, 2)">{{ $t('all') }}</p></el-menu-item>
-                    <el-menu-item index="2-2" v-if="permissions.awayOfficeAudit && !isDingding"><p @click="bills(true, 1)">{{ $t('state.WaitingAudit') }}</p></el-menu-item>
+                    <el-menu-item index="2-2" v-if="permissions.awayOfficeAudit && !isSyncData"><p @click="bills(true, 1)">{{ $t('state.WaitingAudit') }}</p></el-menu-item>
                 </el-submenu>
                 <el-menu-item index="3" @click="bills(false, 2)" v-if="!permissions.awayOfficeAll">
                     <i class="iconfont firerock-iconbaoxiaodan"></i>
@@ -153,7 +153,7 @@
             </div>
         </div>
         <!-- 出差列表 -->
-        <div class="tops" v-if="displayTable && apk == 0" :style="isDingding ? 'padding-left:20px' : ''">
+        <div class="tops" v-if="displayTable && apk == 0" :style="isSyncData ? 'padding-left:20px' : ''">
             <div class="ctons">
         <!-- 出差列表筛选 -->
                 <div class="flex">
@@ -237,10 +237,10 @@
                             <span v-if="scope.row.way == 4">{{ $t('leave.other') }}</span>
                         </template>
                     </el-table-column>
-                    <el-table-column :label="$t('trip')" width="120" align="center" v-if="!isDingding">
+                    <el-table-column :label="$t('trip')" width="120" align="center" v-if="!isSyncData">
                         <template slot-scope="scope">{{scope.row.cityFrom + '-' + scope.row.cityTo}}</template>
                     </el-table-column>
-                    <el-table-column prop="indate" :label="$t('applytime')" width="150" align="center" v-if="!isDingding"></el-table-column>
+                    <el-table-column prop="indate" :label="$t('applytime')" width="150" align="center" v-if="!isSyncData"></el-table-column>
                     
                     <el-table-column prop="startDate" :label="$t('starttimeofbusinessrip')" width="150"></el-table-column>
                     <el-table-column prop="endDate" :label="$t('endtimeofbusinesstrip')" width="150"></el-table-column>
@@ -260,7 +260,7 @@
                             <span v-if="scope.row.status == 3" style="color: #666666">{{ $t('btn.undo') }}</span>
                         </template>
                     </el-table-column>
-                    <el-table-column v-if="!isDingding" :label="isAuditList ? $t('other.audit') : $t('operation')" width="180" fixed="right" >
+                    <el-table-column v-if="!isSyncData" :label="isAuditList ? $t('other.audit') : $t('operation')" width="180" fixed="right" >
                         <template slot-scope="scope">
                             <div v-if="isAuditList">
                                 <el-button icon="el-icon-check" circle size="mini" @click="approve(scope.row)"></el-button>
@@ -272,7 +272,7 @@
                             </div>
                         </template>
                     </el-table-column>
-                    <el-table-column v-if="isDingding" :label="$t('operation')" width="150" fixed="right">
+                    <el-table-column v-if="isSyncData" :label="$t('operation')" width="150" fixed="right">
                         <template slot-scope="scope">
                             <el-button icon="iconfont firerock-iconguanlian" circle size="mini" @click="DingdingEditor(scope.row)"></el-button>
                             <el-button v-if="permissions.awayOfficeDelete" icon="el-icon-delete" circle size="mini" @click="deleteOfDingding(scope.row)"></el-button>
@@ -778,7 +778,7 @@ export default {
             susers: [],
 
             // 钉钉环境交互
-            isDingding: 0,
+            isSyncData: 0,
             DingdingEditDialog: false,
             DingdingTableLoading: false,
             appendAddorModDialog: false,
@@ -815,10 +815,10 @@ export default {
         window.onresize = function temp() {
             that.tableHeight = window.innerHeight - 195;
         };
-        this.isDingding = this.wuduData.syncDingding
+        this.isSyncData = (this.wuduData.syncDingding || this.wuduData.syncFanwei)
     },
     mounted(){
-        if(this.isDingding){
+        if(this.isSyncData){
             this.staffs(2,['2'])
         }
         this.getTableList()
@@ -1174,7 +1174,7 @@ export default {
         handleSizeChange(val){
             this.size = val;
             this.page = 1
-            if(this.isDingding){
+            if(this.isSyncData){
                 this.billss()
             }else{
                 this.bills()
@@ -1184,7 +1184,7 @@ export default {
         handleCurrentChange(val) {
             // console.log(val, 1, '1')
             this.page =  val;
-            if(this.isDingding){
+            if(this.isSyncData){
                 this.billss()
             }else{
                 this.bills()

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

@@ -4,7 +4,7 @@
       <h3><i class="iconfont firerock-iconbaoxiao" style="padding-right: 10px"></i>{{ $t('navigation.askForLeaveManagement') }}</h3>
       <el-divider ></el-divider>
       <el-col :span="12">
-        <el-menu :default-active="isDingding ? '7' : '1'" class="el-menu-vertical-demo" @select="staffs" background-color="#ffffff" text-color="#666666" active-text-color="#20A0FF" style="width:100%">
+        <el-menu :default-active="isSyncData ? '7' : '1'" class="el-menu-vertical-demo" @select="staffs" background-color="#ffffff" text-color="#666666" active-text-color="#20A0FF" style="width:100%">
           <!-- <el-submenu index="1">
             <template slot="title">
               <i class="iconfont firerock-icontianbao"></i>
@@ -15,7 +15,7 @@
               <el-menu-item index="1-3"><p @click="ssl(2)">请年假</p></el-menu-item>
               <el-menu-item index="1-4"><p @click="ssl(3)">请产假</p></el-menu-item>
           </el-submenu> -->
-          <template v-if="!isDingding">
+          <template v-if="!isSyncData">
           <el-menu-item index="1" v-if="permissions.leaveFil">
             <i class="iconfont firerock-icontianbao"></i>
             <span slot="title">{{ $t('staffleavetofillin') }}</span>
@@ -55,7 +55,7 @@
           </template>
 
           <!-- 钉钉环境对接 -->
-          <template v-if="isDingding">
+          <template v-if="isSyncData">
             <el-menu-item index="7">
                 <template slot="title">
                   <i class="iconfont firerock-iconbaoxiaodan"></i>
@@ -80,7 +80,7 @@
       </div> -->
     <!-- 内容主体区域 -->
   <div class="contents">
-    <div v-if="!displayTable && !isDingding" class="headine" ref="headine">
+    <div v-if="!displayTable && !isSyncData" class="headine" ref="headine">
       <h3 ref="headHe" style="padding-left: 220px">{{ $t('aketimeoffto') }}</h3>
       <!-- <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="submits('addFormRules')" size="mini">提交</el-button></p> -->
     </div>
@@ -189,7 +189,7 @@
             </div>
             <div>
               <span style="color: #606266">{{ $t('leavetype') }}</span>
-              <el-select v-model="type" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="chufas()" style="width: 120px;" size="small" filterable="true">
+              <el-select v-model="type" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="chufas()" style="width: 110px;" size="small" filterable="true">
                   <span v-for="(item, index) in typess" :key="index">
                   <el-option :label="item.name" :value="item.id"></el-option>
                   </span> 
@@ -197,12 +197,12 @@
             </div>
             <div>
               <span style="color: #606266">{{$t('offstate')}}</span>
-              <el-select v-if="falg == 0" v-model="code" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="chufas()" size="small" style="width: 120px" filterable="true">
+              <el-select v-if="falg == 0" v-model="code" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="chufas()" size="small" style="width: 110px" filterable="true">
                   <span v-for="(item, index) in statuss" :key="index">
                   <el-option :label="item.name" :value="item.id"></el-option>
                   </span> 
               </el-select>
-              <el-select v-if="falg == 1" disabled v-model="code" :placeholder="$t('pleaseselectthetypeofleave')" clearable @change="chufas()" size="small" style="width: 120px" filterable="true">
+              <el-select v-if="falg == 1" disabled v-model="code" :placeholder="$t('pleaseselectthetypeofleave')" clearable @change="chufas()" size="small" style="width: 110px" filterable="true">
                   <span v-for="(item, index) in statuss" :key="index">
                   <el-option :label="item.name" :value="item.id"></el-option>
                   </span> 
@@ -212,7 +212,7 @@
               <!-- <span style="color: #606266">请假时间</span>
               <el-date-picker v-model="createDate" type="date" @change="chufas()" value-format="yyyy-MM-dd" placeholder="选择日期" size="small" clearable="false"> </el-date-picker> -->
                 <span style="color: #606266">{{ $t('message.period') }}</span>
-                <el-date-picker v-model="createDate" type="daterange" :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" @change="chufas()" value-format="yyyy-MM-dd" :placeholder="$t('optiondate')" size="small" clearable style="width:210px"></el-date-picker>
+                <el-date-picker v-model="createDate" type="daterange" :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" @change="chufas()" value-format="yyyy-MM-dd" :placeholder="$t('optiondate')" size="small" clearable style="width:250px"></el-date-picker>
             </div>
             <div>
               <el-button type="primary" size="small" style="margin-left:20px" @click="exportLeave()">{{ $t('dao-chu-qing-jia-dan') }}</el-button>
@@ -273,7 +273,7 @@
                     </el-popover>
                   </template>
                 </el-table-column>
-                <el-table-column :label="$t('operation')" min-width="180" fixed="right" v-if="isAuditList && !isDingding">
+                <el-table-column :label="$t('operation')" min-width="180" fixed="right" v-if="isAuditList && !isSyncData">
                     <template slot-scope="scope">
                       <div>
                         <el-button icon="el-icon-check" circle size="mini" @click.stop.native="approve(scope.row)"></el-button>
@@ -281,7 +281,7 @@
                       </div>
                     </template>
                 </el-table-column>
-                <el-table-column :label="$t('operation')" min-width="180" fixed="right" v-if="!isAuditList && !isDingding">
+                <el-table-column :label="$t('operation')" min-width="180" fixed="right" v-if="!isAuditList && !isSyncData">
                     <template slot-scope="scope">
                       <div v-if="(scope.row.status != 0 && scope.row.ownerId == user.id) || permissions.leaveAll">
                         <el-button icon="el-icon-delete" circle size="mini"  @click.stop.native="deletes(scope.row)" ></el-button>
@@ -855,7 +855,7 @@ export default {
       txselnum: 0,
 
       approverList: [],
-      isDingding: 0,
+      isSyncData: 0,
       vacationList: [],
       leaveTypeList: [],
       leaveTypeItem: '',
@@ -883,11 +883,11 @@ export default {
                 that.tableHeight = window.innerHeight - 195;
             };
     // console.log('user',this.user);
-    this.isDingding = this.user.timeType.syncDingding
+    this.isSyncData = this.user.timeType.syncDingding || this.user.timeType.syncFanwei;
   },
 
   mounted() {
-    if(this.isDingding){
+    if(this.isSyncData){
       this.bills(false,2)
       this.staffs(7,['7'])
       this.getUsers()

+ 16 - 11
fhKeeper/formulahousekeeper/timesheet/src/views/settings/timetype.vue

@@ -112,25 +112,18 @@
                <el-time-picker
                style="width:160px;"
                     v-model="startTime"
-                    :picker-options="{
-                        start: '08:30',
-                        end: '18:30'
-                    }"
                     format="HH:mm"
-                    :placeholder="$t('pointintime')">
+                    :placeholder="$t('pointintime')"
+                    @change="timePicker(0)">
                 </el-time-picker>
             </el-form-item>
             <el-form-item :label="$t('time.endTime')">
                <el-time-picker
                style="width:160px;"
                             v-model="endTime"
-                            :picker-options="{
-                                start: '08:30',
-                                end: '18:30',
-                                minTime: startTime
-                            }"
                             format="HH:mm"
-                            :placeholder="$t('pointintime')">
+                            :placeholder="$t('pointintime')"
+                            @change="timePicker(1)">
                         </el-time-picker>
             </el-form-item>
             </el-form>
@@ -548,6 +541,18 @@
             this.getRestList()
         },
          methods: {
+            timePicker(e){
+                // console.log('timePicker',this.startTime,this.endTime);
+                if(this.startTime && this.endTime){
+                    if(this.startTime > this.endTime){
+                        if(e){
+                            this.startTime = this.endTime
+                        }else{
+                            this.endTime = this.startTime
+                        }
+                    }
+                }
+            },
             timeAlldayChange(){
                 if(this.timeType.maxReportTime < this.timeType.allday || this.timeType.lockWorktime){
                     this.timeType.maxReportTime = this.timeType.allday

+ 11 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -485,7 +485,13 @@
 
         <el-dialog :title="$t('historicalpersonnelcost')" :visible.sync="userSalaryListDialog" width="550px" >
             <el-table :data="userSalaryList" highlight-current-row v-loading="listLoading" height="300px" style="width: 100%;">
-                <el-table-column prop="userName" :label="$t('lable.name')" ></el-table-column>
+                <el-table-column prop="userName" :label="$t('lable.name')" >
+                  <template slot-scope="scope">
+                    <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
+                    <span v-else>{{scope.row.userName}}</span>
+                  </template>
+                  
+                </el-table-column>
                 <el-table-column prop="indate" :label="$t('updatetime')" width="150px">
                 </el-table-column>
                 <el-table-column prop="salaryType" :label="$t('payway')" >
@@ -524,10 +530,11 @@
         <el-dialog :title="$t('permissiontotransfer')" :visible.sync="transferDialog" width="550px" >
             <el-form  label-width="200px">
                 <el-form-item :label="$t('administratorroleto')" >
-                    <el-select v-model="toUserId" style="width:300px" filterable clearable>
+                    <el-select v-model="toUserId" style="width:300px" filterable clearable v-if="user.userNameNeedTranslate != '1'">
                         <el-option v-for="item in allActiveUsers" :key="item.id" :value="item.id" :label="item.name">
                         </el-option>
                     </el-select>
+                    <selectCat :size="'medium'" :widthStr="'300'" v-if="user.userNameNeedTranslate == '1'" :subject="allActiveUsers" :subjectId="toUserId" :distinction="'12'" @selectCal="selectCal"></selectCat>
                 </el-form-item>
                 <el-form-item :label="$t('transferoftheirrole')" >
                     <el-select v-model="myRoleId" style="width:300px">
@@ -3312,6 +3319,8 @@ export default {
         this.depForm.managerId = obj.id
       } else if(obj.distinction == '5'){
         this.depForm.reportAuditUserid = obj.id
+      } else if(obj.distinction == '12'){
+        this.toUserId = obj.id
       }
     }
   },

+ 9 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -729,7 +729,7 @@
             </div>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
-                <span style="margin-right:20px">合计工时:{{totalReportHours}}小时</span>
+                <span style="margin-right:20px" @click="test()">合计工时:{{totalReportHours}}小时</span>
                 <el-button @click="deleteReport"  v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
                 <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
                 <el-button v-if="!isSubstitude" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">{{$t('btn.temporaryStorage')}}</el-button>
@@ -1948,7 +1948,13 @@
                                 }
                             }
                         }else{
-                            hours += domains[i].workingTime ? parseFloat(domains[i].workingTime) : 0
+                            if(this.user.timeType.type == 2){
+                                if(domains[i].startTime && domains[i].endTime){
+                                    hours += this.getHour(domains[i].startTime, domains[i].endTime)
+                                }
+                            }else{
+                                hours += domains[i].workingTime ? parseFloat(domains[i].workingTime) : 0
+                            }
                         }
                     }
                 }
@@ -1981,7 +1987,7 @@
         },
         methods: {
             test(){
-                // console.log('test',this.depData,this.data[0].membCount,this.reportList.length);
+                console.log('test',this.workForm.domains);
             },
             getHour(s1, s2) {
                 var reDate = /\d{4}-\d{1,2}-\d{1,2} /;

+ 17 - 10
fhKeeper/formulahousekeeper/timesheet_h5/src/views/expense/details.vue

@@ -82,7 +82,7 @@
             <!-- 发票 -->
             <van-field label="发票" readonly>
                 <template #input
-                    >总费用: ¥{{ totalCost | numtosum }}</template
+                    >总费用: ¥{{ totalCost }}</template
                 >
             </van-field>
             <div class="invoice" v-if="invoiceList.length != 0">
@@ -142,7 +142,6 @@
                         label="费用金额(含税):"
                         v-model="item.amount"
                         type="number"
-                        @input="costCount"
                         :readonly="!canEdit"
                         required
                     ></van-field>
@@ -284,7 +283,6 @@ export default {
             createDateShow: false,
             typeShow: false,
             typeList: ['一般','差旅','外包'],
-            totalCost: 0,
 
             invoiceIndex: 0,
             in_projectShow: false,
@@ -298,6 +296,15 @@ export default {
             uploader: [[]],
         }
     },
+    computed: {
+        totalCost(){
+            let costnum = 0
+            for(let i in this.invoiceList){
+                costnum += (this.invoiceList[i].amount ? parseFloat(this.invoiceList[i].amount) : 0)
+            }
+            return costnum.toFixed(2)
+        }
+    },
     filters: {
         numtosum(value) {
             if (value == undefined || !value) return '0.00'
@@ -342,13 +349,13 @@ export default {
             let amo = amount / (1 + per)*per
             return amo.toFixed(2)
         },
-        costCount(){
-            let costnum = 0
-            for(let i in this.invoiceList){
-                costnum += this.invoiceList[i].amount*1
-            }
-            this.totalCost = costnum
-        },
+        // costCount(){
+        //     let costnum = 0
+        //     for(let i in this.invoiceList){
+        //         costnum += this.invoiceList[i].amount*1
+        //     }
+        //     this.totalCost = costnum
+        // },
 
         ownerIdChange(value,key){
             this.editForm.ownerId = value.id