Jelajahi Sumber

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

Min 1 tahun lalu
induk
melakukan
58f03f0d1b
14 mengubah file dengan 248 tambahan dan 87 penghapusan
  1. 14 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessOpportunityController.java
  2. 14 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ClueController.java
  3. 7 7
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ContactsController.java
  4. 38 16
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/CustomController.java
  5. 5 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/ContactsDocument.java
  6. 5 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/ContactsLog.java
  7. 23 15
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Task.java
  8. 4 2
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ContactsServiceImpl.java
  9. 1 1
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/SysFormServiceImpl.java
  10. 29 11
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java
  11. 5 5
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskMapper.xml
  12. 87 0
      fhKeeper/formulahousekeeper/timesheet/src/components/translationOpenDataText.vue
  13. 2 0
      fhKeeper/formulahousekeeper/timesheet/src/main.js
  14. 14 30
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

+ 14 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessOpportunityController.java

@@ -45,6 +45,19 @@ public class BusinessOpportunityController {
 
     @Resource
     private BusinessOpportunityService bOservice;
+    @Resource
+    private BusinessOpportunityMapper businessOpportunityMapper;
+
+    @RequestMapping("getAll")
+    public Object getAll(HttpServletRequest request) {
+        User user = userMapper.selectById(request.getHeader("Token"));
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.setMsg("操作成功");
+        msg.setData(
+                businessOpportunityMapper.selectList(new QueryWrapper<BusinessOpportunity>().eq("company_id", user.getCompanyId()))
+        );
+        return msg;
+    }
 
 
     @RequestMapping("exportData")
@@ -219,6 +232,7 @@ public class BusinessOpportunityController {
         return bOservice.uploadFile(bo, request, file);
     }
 
+
     //下载
     @RequestMapping("downFile")
     public Object downFile(UploadFile file, HttpServletRequest request, HttpServletResponse response) throws Exception {

+ 14 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ClueController.java

@@ -6,6 +6,7 @@ import com.management.platform.entity.Clue;
 import com.management.platform.entity.SysDict;
 import com.management.platform.entity.UploadFile;
 import com.management.platform.entity.User;
+import com.management.platform.mapper.ClueMapper;
 import com.management.platform.mapper.SysDictMapper;
 import com.management.platform.mapper.SysFunctionMapper;
 import com.management.platform.mapper.UserMapper;
@@ -47,9 +48,22 @@ public class ClueController {
     @Resource
     private SysFunctionService sysFunctionService;
 
+    @Resource
+    private ClueMapper clueMapper;
+
     @Resource
     private SysDictMapper sysDictMapper;
 
+    @RequestMapping("getAll")
+    public Object getAll(HttpServletRequest request) {
+        User user = userMapper.selectById(request.getHeader("Token"));
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.setMsg("操作成功");
+        msg.setData(
+                clueMapper.selectList(new QueryWrapper<Clue>().eq("company_id", user.getCompanyId()))
+        );
+        return msg;
+    }
 
     // 详情
     @RequestMapping("getDetail")

+ 7 - 7
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ContactsController.java

@@ -41,7 +41,7 @@ public class ContactsController {
      * @return
      */
     @RequestMapping("/addContacts")
-    public HttpRespMsg addContacts(@RequestBody Contacts contacts){
+    public HttpRespMsg addContacts(Contacts contacts){
         return contactsService.addContacts(contacts, request);
     }
     @RequestMapping("/getAllContacts")
@@ -70,7 +70,7 @@ public class ContactsController {
      * @return
      */
     @RequestMapping("selectContactsByCustomId")
-    public HttpRespMsg selectContactsByCustomId(@RequestBody Custom custom){
+    public HttpRespMsg selectContactsByCustomId(Custom custom){
         return contactsService.selectContactsByCustomId(custom,request);
     }
 
@@ -80,7 +80,7 @@ public class ContactsController {
      * @return
      */
     @RequestMapping("updateContacts")
-    public HttpRespMsg updateContacts(@RequestBody Contacts contacts){
+    public HttpRespMsg updateContacts( Contacts contacts){
         return contactsService.updateContacts(contacts,request);
     }
 
@@ -90,7 +90,7 @@ public class ContactsController {
      * @return
      */
     @RequestMapping("deleteContacts")
-    public HttpRespMsg deleteContacts(@RequestBody List<Integer> ids){
+    public HttpRespMsg deleteContacts( List<Integer> ids){
         return contactsService.deleteContacts(ids,request);
     }
 
@@ -109,7 +109,7 @@ public class ContactsController {
      * 批量删除回收站中的联系人
      */
     @RequestMapping("confirmDeleteContacts")
-    public HttpRespMsg confirmDeleteContacts(@RequestBody List<Integer> ids){
+    public HttpRespMsg confirmDeleteContacts(List<Integer> ids){
         return contactsService.confirmDeleteContacts(ids);
     }
 
@@ -119,12 +119,12 @@ public class ContactsController {
      * @return
      */
     @RequestMapping("returnContacts")
-    public HttpRespMsg returnContacts(@RequestBody List<Integer> ids){
+    public HttpRespMsg returnContacts(List<Integer> ids){
         return contactsService.returnContacts(ids);
     }
 
     @RequestMapping("getContactsDetail")
-    public HttpRespMsg getContactsDetail(@RequestBody Contacts contacts ){
+    public HttpRespMsg getContactsDetail(Contacts contacts ){
         return contactsService.getContactsDetail(contacts,request);
     }
 

+ 38 - 16
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/CustomController.java

@@ -1,10 +1,12 @@
 package com.management.platform.controller;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.management.platform.entity.Clue;
 import com.management.platform.entity.Custom;
 import com.management.platform.entity.UploadFile;
 import com.management.platform.entity.User;
+import com.management.platform.mapper.CustomMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.CustomService;
 import com.management.platform.util.HttpRespMsg;
@@ -22,7 +24,7 @@ import java.util.List;
 
 /**
  * <p>
- *  前端控制器
+ * 前端控制器
  * </p>
  *
  * @author Seyason
@@ -36,32 +38,39 @@ public class CustomController {
     @Autowired
     private CustomService customService;
     @Autowired
+    private CustomMapper customMapper;
+    @Autowired
     private UserMapper userMapper;
 
     @RequestMapping("list")
-    public HttpRespMsg list(Custom custom , HttpServletRequest request){
-        return customService.getList(custom,request);
+    public HttpRespMsg list(Custom custom, HttpServletRequest request) {
+        return customService.getList(custom, request);
     }
+
     @RequestMapping("getAllCustom")
-    public HttpRespMsg getAllCustom( HttpServletRequest request){
+    public HttpRespMsg getAllCustom(HttpServletRequest request) {
         return customService.getAllCustom(request);
     }
+
     @RequestMapping("deleteList")
-    public HttpRespMsg deleteList(Custom custom , HttpServletRequest request){
-        return customService.getDeleteList(custom,request);
+    public HttpRespMsg deleteList(Custom custom, HttpServletRequest request) {
+        return customService.getDeleteList(custom, request);
     }
 
 
     @RequestMapping("insertAndUpdate")
-    public HttpRespMsg insertAndUpdate(Custom custom , HttpServletRequest request){
-        return customService.insertAndUpdate(custom,request);
+    public HttpRespMsg insertAndUpdate(Custom custom, HttpServletRequest request) {
+        return customService.insertAndUpdate(custom, request);
     }
+
     @RequestMapping("getInfo")
-    public HttpRespMsg getInfo(Custom custom , HttpServletRequest request){
-        return customService.getInfo(custom,request);
-    } @RequestMapping("getLog")
-    public HttpRespMsg getLog(Custom custom , HttpServletRequest request){
-        return customService.getInfo(custom,request);
+    public HttpRespMsg getInfo(Custom custom, HttpServletRequest request) {
+        return customService.getInfo(custom, request);
+    }
+
+    @RequestMapping("getLog")
+    public HttpRespMsg getLog(Custom custom, HttpServletRequest request) {
+        return customService.getInfo(custom, request);
     }
 
 
@@ -77,12 +86,13 @@ public class CustomController {
             }
             customService.isDelete(ids);
             msg.setMsg("操作成功");
-        }else {
+        } else {
             msg.setError("请选择客户");
 
         }
         return msg;
     }
+
     // 批量恢复
     @RequestMapping("rollback")
     public Object rollback(Custom custom) {
@@ -95,12 +105,13 @@ public class CustomController {
             }
             customService.isRollback(ids);
             msg.setMsg("操作成功");
-        }else {
+        } else {
             msg.setError("请选择客户");
 
         }
         return msg;
     }
+
     //彻底删除
     @RequestMapping("reallyDelete")
     public Object reallyDelete(Custom custom) {
@@ -113,7 +124,7 @@ public class CustomController {
             }
             customService.isReallyDelete(ids);
             msg.setMsg("操作成功");
-        }else {
+        } else {
             msg.setError("请选择客户");
 
         }
@@ -130,6 +141,17 @@ public class CustomController {
         return msg;
     }
 
+    @RequestMapping("getAll")
+    public Object getAll(HttpServletRequest request) {
+        User user = userMapper.selectById(request.getHeader("Token"));
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.setMsg("操作成功");
+        msg.setData(
+                customMapper.selectList(new QueryWrapper<Custom>().eq("company_id", user.getCompanyId()))
+        );
+        return msg;
+    }
+
     // 上传
     @RequestMapping("uploadFile")
     public Object uploadFile(Custom custom, HttpServletRequest request, MultipartFile file) throws Exception {

+ 5 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/ContactsDocument.java

@@ -6,9 +6,12 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
 
 /**
  * <p>
@@ -62,6 +65,8 @@ public class ContactsDocument extends Model<ContactsDocument> {
      * 创建时间
      */
     @TableField("indate")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
     private LocalDateTime indate;
 
     /**

+ 5 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/ContactsLog.java

@@ -6,9 +6,12 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
 
 /**
  * <p>
@@ -38,6 +41,8 @@ public class ContactsLog extends Model<ContactsLog> {
      * 操作时间
      */
     @TableField("operate_date")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
     private LocalDateTime operateDate;
 
     /**

+ 23 - 15
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Task.java

@@ -2,34 +2,32 @@ package com.management.platform.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-
-import java.time.LocalDate;
-
 import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
-
 import java.io.Serializable;
-import java.util.Date;
 import java.util.List;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
 
 /**
  * <p>
- *
+ * 
  * </p>
  *
  * @author Seyason
- * @since 2024-03-14
+ * @since 2024-04-10
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
 public class Task extends Model<Task> {
 
-    private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID=1L;
 
     @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
@@ -121,7 +119,7 @@ public class Task extends Model<Task> {
     private Integer repeatType;
 
     /**
-     * 重复永不结束   1:勾选
+     * 重复永不结束   1:勾选  
      */
     @TableField("repeat_end_never")
     private Integer repeatEndNever;
@@ -135,11 +133,13 @@ public class Task extends Model<Task> {
     /**
      * 重复结束 在  ? 日期YYYY-MM-DD之后
      */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
     @TableField("repeat_end_date")
-    private Date repeatEndDate;
+    private LocalDateTime repeatEndDate;
 
     /**
-     * 自定义期: 每 ? 天一次,保存为 x1,x2,x3,x4
+     * 自定义期: 每 ? 天一次,保存为 x1,x2,x3,x4
      */
     @TableField("repeat_design_day")
     private String repeatDesignDay;
@@ -171,26 +171,34 @@ public class Task extends Model<Task> {
     /**
      * 创建时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @TableField("create_date")
-    private Date createDate;
+    private LocalDateTime createDate;
 
     /**
      * 截止时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @TableField("end_date")
-    private Date endDate;
+    private LocalDateTime endDate;
 
     /**
      * 开始日期
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @TableField("start_date")
-    private Date startDate;
+    private LocalDateTime startDate;
 
     /**
      * 完成日期
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @TableField("finish_date")
-    private Date finishDate;
+    private LocalDateTime finishDate;
 
     /**
      * 是否被删除: 0否,1是

+ 4 - 2
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ContactsServiceImpl.java

@@ -274,10 +274,12 @@ public class ContactsServiceImpl extends ServiceImpl<ContactsMapper, Contacts> i
                 if (StringUtils.isNotEmpty(task.getExecutorId())) {
                     String executorIdString = task.getExecutorId();
                     String[] executorIds = executorIdString.split(",");
+                    ArrayList<String> list = new ArrayList<>();
                     for (int index = 0; index < executorIds.length; index++) {
-                        User userSelect = userMapper.selectById(executorIds);
-                        task.getExecutorNames().add(userSelect.getName());
+                        User userSelect = userMapper.selectById(executorIds[index]);
+                        list.add(userSelect.getName());
                     }
+                    task.setExecutorNames(list);
                 }
             });
 

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/SysFormServiceImpl.java

@@ -163,7 +163,7 @@ public class SysFormServiceImpl extends ServiceImpl<SysFormMapper, SysForm> impl
             cellStyle.setBorderLeft(BorderStyle.THIN);//左边框
             cellStyle.setBorderTop(BorderStyle.THIN);//上边框
             cellStyle.setBorderRight(BorderStyle.THIN);//右边框
-
+            cellStyle.setDataFormat(workBook.createDataFormat().getFormat("yyyy-MM-dd HH:mm:ss"));
             if(allList.size() > 0) {
                 int start = 0;
                 for(List<String> rowList : allList) {

+ 29 - 11
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java

@@ -29,6 +29,8 @@ import java.io.*;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -111,9 +113,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
         }
         Task task = new Task();
         BeanUtils.copyProperties(taskDto,task);
-        task.setCreateDate(new Date());//任务的创建时间
+        task.setCreateDate(LocalDateTime.now());//任务的创建时间
         //根据任务的开始时间与当下时间判断任务的状态
-        if (taskDto.getStartDate()==null||taskDto.getStartDate().after(new Date())){
+        if (taskDto.getStartDate()==null||taskDto.getStartDate().isAfter(LocalDateTime.now())){
             task.setStatus(0);
         }else {
             task.setStatus(1);
@@ -387,7 +389,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 Task task=new Task();
                 task.setCompanyId(companyId);
                 task.setCreaterId(user.getId());
-                task.setCreateDate(new Date());
+                task.setCreateDate(LocalDateTime.now());
                 for (int i = 0; i < cellNum; i++) {
                     JSONObject item = configObJSONArray.getJSONObject(i);
                     String modelName = item.getString("model");
@@ -489,18 +491,34 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                     if(modelName.equals("startDate")){
                         if(cell != null && cell.getCellTypeEnum() != CellType.BLANK){
                             if (cell.getCellTypeEnum() == CellType.NUMERIC){
-                                double numericCellValue = cell.getNumericCellValue();
-                                long daysSince1900 = (long) numericCellValue - 2;
-                                task.setStartDate(new Date(daysSince1900));
+                                Date dateCellValue = cell.getDateCellValue();
+                                if (dateCellValue.before(new Date(-2208988800L))){
+                                    continue;
+                                }else {
+                                    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                                    String string = format.format(dateCellValue);
+                                    System.out.println(string);
+                                    DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+                                    LocalDateTime time = LocalDateTime.parse(string, dateTimeFormatter);
+                                    task.setStartDate(time);
+                                }
                             }
                         }
                     }
                     if(modelName.equals("endDate")){
                         if(cell != null && cell.getCellTypeEnum() != CellType.BLANK){
                             if (cell.getCellTypeEnum() == CellType.NUMERIC){
-                                double numericCellValue = cell.getNumericCellValue();
-                                long daysSince1900 = (long) numericCellValue - 2;
-                                task.setEndDate(new Date(daysSince1900));
+                                Date dateCellValue = cell.getDateCellValue();
+                                if (dateCellValue.before(new Date(-2208988800L))){
+                                    continue;
+                                }else {
+                                    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                                    String string = format.format(dateCellValue);
+                                    System.out.println(string);
+                                    DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+                                    LocalDateTime time = LocalDateTime.parse(string, dateTimeFormatter);
+                                    task.setEndDate(time);
+                                }
                             }
                         }
                     }
@@ -761,14 +779,14 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 }
                 else if(model.equals("startDate")){
                     if (tasKVo.getStartDate()!=null){
-                        Date startDate = tasKVo.getStartDate();
+                        LocalDateTime startDate = tasKVo.getStartDate();
                         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
                         value=format.format(startDate);
                     }
                 }
                 else if(model.equals("endDate")){
                     if (tasKVo.getEndDate()!=null){
-                        Date endDate = tasKVo.getEndDate();
+                        LocalDateTime endDate = tasKVo.getEndDate();
                         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
                         value=format.format(endDate);
                     }

+ 5 - 5
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskMapper.xml

@@ -91,13 +91,13 @@
         select task.* ,
                custom.custom_name,
                business_opportunity.name businessName,
-              `order`.order_name ,
+              `sales_order`.order_name ,
                clue.clue_name,
                contacts.name contacts_name ,contacts.phone
         from task
             left join  custom on task.custom_id=custom.id
             left join  business_opportunity on task.business_opportunity_id=business_opportunity.id
-            left join  `order` on task.order_id=`order`.id
+            left join  `sales_order` on task.order_id=`sales_order`.id
             left join  clue on task.clue_id=clue.id
             left join  contacts on task.contacts_id=contacts.id
 
@@ -120,7 +120,7 @@
                 AND business_opportunity.name LIKE CONCAT('%', #{businessName}, '%')
             </if>
             <if test=" orderName!= null and orderName != ''">
-                AND `order`.order_name LIKE CONCAT('%', #{orderName}, '%')
+                AND `sales_order`.order_name LIKE CONCAT('%', #{orderName}, '%')
             </if>
             <if test=" clueName!= null and clueName != ''">
                 AND clue.clue_name LIKE CONCAT('%', #{clueName}, '%')
@@ -158,7 +158,7 @@
         from task
         left join  custom on task.custom_id=custom.id
         left join  business_opportunity on task.business_opportunity_id=business_opportunity.id
-        left join  `order` on task.order_id=`order`.id
+        left join  `sales_order` on task.order_id=`sales_order`.id
         left join  clue on task.clue_id=clue.id
         left join  contacts on task.contacts_id=contacts.id
 
@@ -181,7 +181,7 @@
                 AND business_opportunity.name LIKE CONCAT('%', #{businessName}, '%')
             </if>
             <if test=" orderName!= null and orderName != ''">
-                AND `order`.order_name LIKE CONCAT('%', #{orderName}, '%')
+                AND `sales_order`.order_name LIKE CONCAT('%', #{orderName}, '%')
             </if>
             <if test=" clueName!= null and clueName != ''">
                 AND clue.clue_name LIKE CONCAT('%', #{clueName}, '%')

+ 87 - 0
fhKeeper/formulahousekeeper/timesheet/src/components/translationOpenDataText.vue

@@ -0,0 +1,87 @@
+<template>
+    <div class="translation">
+        <!-- 文本 -->
+            <span v-if="corporateWeChat">
+                <ww-open-data :type='type' :openid='openIdValue'></ww-open-data>
+            </span>
+            <span v-else-if="dingdingPlatform">
+                <dt-open-data :open-type='type' :open-id='openIdValue'></dt-open-data>
+            </span>
+            <span v-else>{{ openIdValue }}</span>
+    </div>
+</template>
+
+<script>
+export default {
+    name: '',
+    components: {},
+    props: {
+        type: {
+            type: String,
+            default: 'userName'
+        },
+        openid: {
+            type: [String, Number],
+            default: ''
+        }
+    },
+    data() {
+        return {
+            user: JSON.parse(sessionStorage.getItem("user")),
+            corporateWeChat: false, // 企业微信转译
+            dingdingPlatform: false, // 钉钉转译
+
+            openIdValue: ''
+        }
+    },
+    computed: {},
+    watch: {
+        openid: {
+            handler(newVal, oldVal) {
+                this.assignmentValue(newVal)
+            },
+        }
+    },
+    created() { },
+    mounted() {
+        this.dealWith()
+    },
+    methods: {
+        dealWith() {
+            console.log(this.user)
+            const { userNameNeedTranslate, dingdingUserid } = this.user
+            if (userNameNeedTranslate) {
+                this.corporateWeChat = true
+                if (dingdingUserid) {
+                    this.dingdingPlatform = true
+                    this.corporateWeChat = false
+                } else {
+                    this.dingdingPlatform = false
+                }
+            } else {
+                this.corporateWeChat = false
+                this.dingdingPlatform = false
+            }
+            // console.log(this.corporateWeChat, this.dingdingPlatform, this.configurationItems)
+            // console.log(this.corporateWeChat, '<=== 企业微信转译')
+            // console.log(this.dingdingPlatform, '<=== 钉钉转译')
+            this.assignmentValue(this.openid)
+        },
+        assignmentValue(value) {
+            this.openIdValue = value
+            if (this.user.dingdingUserid) {
+                this.viewConfiguration()
+            }
+        },
+        viewConfiguration() {
+            window.DTOpenData.update(document.querySelectorAll('dt-open-data'));
+        }
+    },
+}
+</script>
+<style scoped lang='scss'>
+.translation {
+    width: auto;
+    display: inline-block;
+}
+</style>

+ 2 - 0
fhKeeper/formulahousekeeper/timesheet/src/main.js

@@ -77,6 +77,8 @@ Vue.use(Print)
 // 全局转译组件
 import TranslationOpenData from '@/components/translationOpenData.vue'
 Vue.component('TranslationOpenData', TranslationOpenData)
+import TranslationOpenDataText from '@/components/TranslationOpenDataText.vue'
+Vue.component('TranslationOpenDataText', TranslationOpenDataText)
 
 var addRouFlag = false; 
 //角色权限对应关系

+ 14 - 30
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -48,22 +48,10 @@
                                 </el-select>
                             </div>
                             <div>
-                                <!-- <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChange" @node-expand="nodeChange" node-key="id" :default-expanded-keys="expandDate" v-loading="dataLoading"> -->
                                 <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
                                     <span class="custom-tree-node"  style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
-                                        <!-- <span>{{ node.label }}</span> -->
                                         <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
-                                            <span v-if="user.userNameNeedTranslate == '1'">
-                                                <span v-if="node.data.children">
-                                                    <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
-                                                </span>
-                                                <span v-else>
-                                                    <ww-open-data type='userName' :openid='node.label'></ww-open-data>
-                                                </span>
-                                            </span>
-                                            <span v-if="user.userNameNeedTranslate != '1'">
-                                                {{ node.label }}
-                                            </span>
+                                            <TranslationOpenData :configurationItems="{ openType: node.data.children ? 'departmentName' : 'userName', openId: node.label, renderIndex: 0 }"/>
                                             
                                             <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
                                         </span>
@@ -118,8 +106,12 @@
                                     <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> | 
                                         <!-- {{depData != null ?depData.label:""}} -->
                                         <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
-                                        <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
-                                        <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
+                                        <span v-if="translation == '2' && user.userNameNeedTranslate == '1'">
+                                            <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: depData.label, renderIndex: 0 }" />
+                                        </span>
+                                        <span v-if="translation == '3' && user.userNameNeedTranslate == '1'">
+                                            <TranslationOpenData :configurationItems="{ openType: 'userName', openId: depData.label, renderIndex: 0 }" />
+                                        </span>
                                         <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
                                     <span v-if="targetUid == null">
                                     <!-- - 已提交 -->
@@ -158,7 +150,7 @@
                                     <i class="fa fa-circle"></i>
                                     <!-- {{item1.name}} -->
                                     <span v-if="user.userNameNeedTranslate == '1'">
-                                        <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
+                                        <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
                                     </span>
                                     <span v-if="user.userNameNeedTranslate != '1'">
                                         {{item1.name}}
@@ -202,10 +194,7 @@
                                                                 <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
                                                                 <span v-if="item2.projectAuditorName != null">(
                                                                     <!-- {{item2.projectAuditorName}} -->
-                                                                    <span v-if="user.userNameNeedTranslate == '1'">
-                                                                        <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
-                                                                    </span>
-                                                                    <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
+                                                                    <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
                                                                     )</span> 
                                                                 <!-- 审核 --> {{$t('other.audit')}}
                                                             </span>
@@ -213,10 +202,7 @@
                                                                 <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
                                                                 <span v-if="item2.projectAuditorName != null">(
                                                                     <!-- {{item2.projectAuditorName}} -->
-                                                                    <span v-if="user.userNameNeedTranslate == '1'">
-                                                                        <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
-                                                                    </span>
-                                                                    <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
+                                                                    <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
                                                                     )</span>
                                                                 <!-- 审核通过 --> {{$t('state.approved')}}
                                                             </span>
@@ -224,10 +210,7 @@
                                                         <span v-else-if="item2.isDeptAudit==1">
                                                             <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
                                                             ({{$t('other.await')}}
-                                                            <span v-if="user.userNameNeedTranslate == '1'">
-                                                                <ww-open-data type='departmentName'   :openid='user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName'></ww-open-data>
-                                                            </span>
-                                                            <span v-if="user.userNameNeedTranslate != '1'">{{user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName}}</span>
+                                                            <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
                                                             {{$t('other.audit')}})
                                                         </span>
                                                         ]</span> 
@@ -246,12 +229,13 @@
                                                         <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
                                                         <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
                                                             (
-                                                                <span v-if="user.userNameNeedTranslate != 1">
+                                                                <!-- <span v-if="user.userNameNeedTranslate != 1">
                                                                     {{item2.projectAuditorName}}
                                                                 </span>
                                                                 <span v-if="user.userNameNeedTranslate == 1">
                                                                     <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
-                                                                </span>
+                                                                </span> -->
+                                                                <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
                                                             )
                                                         </span>{{$t('other.audit')}} ]</span>
                                                         <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>