Browse Source

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

zhouyy 3 months ago
parent
commit
1596a95d61

+ 22 - 9
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/tasks/addEditor.vue

@@ -258,14 +258,22 @@ const contactDisabled = computed(() => {
 
 function onSubmit() {
   formFormRef.value.getJsonData().then((res) => {
-    const formValue = {
+    let formValue = {
       ...formVal.value,
       ...vantFormVal.value,
       ...res.data,
       repeatDesignDay: customeDate.value.map(item => item.value).join(','),
       executorId: vantFormVal.value.executorId,
-      isRepeat: vantFormVal.value.isRepeat ? 1 : 0
+      isRepeat: vantFormVal.value.isRepeat ? 1 : 0,
     }
+    delete formValue.taskLogs
+    delete formValue.contactsName
+    delete formValue.orderIdName
+    delete formValue.priorityName
+    delete formValue.taskTypeName
+    delete formValue.repeatTypeName
+    delete formValue.executorIdName
+    delete formValue.taskExecutors
     console.log('formValue', formValue)
     toastLoading('保存中')
     const url = formValue.id ? MODIFY_TASK : TASK_ADD_EDIT
@@ -288,9 +296,13 @@ function showPickerConfirm({ selectedValues }) {
 
   // vantFormVal.value[showDatePickerFiled.value] = selectedValues.join('-')
   // showDatePicker.value = false
-
-  showDatePicker.value = false
-  showDateTimePicker.value = true
+  if(showDatePickerFiled.value == 'repeatEndDate') {
+    vantFormVal.value[showDatePickerFiled.value] = selectedValues.join('-')
+    showDatePicker.value = false
+  } else {
+    showDatePicker.value = false
+    showDateTimePicker.value = true
+  }
 }
 
 function showPickerTimeConfirm({ selectedValues }) {
@@ -450,22 +462,23 @@ function initializeData() {
     return
   }
 
-  const { id, taskName, priority, taskType, customId, customName, businessOpportunityId, businessOpportunityName, orderId, orderName, clueId, clueNme, contactsId, contactsName
+  const { id, taskName, priority, taskType, customId, customName, businessOpportunityId, businessName, orderId, orderName, clueId, clueName, contactsId, contactsName
     , taskExecutors, isRepeat, repeatType, repeatDesignSameday, endType, repeatEndCount, repeatEndDate, repeatDesignDay, executorId, startDate, endDate } = row
   vantFormVal.value = {
     id, taskName, priority, taskType, customId, businessOpportunityId, orderId, clueId, contactsId, executorId, repeatType, repeatDesignSameday, endType, repeatEndCount, repeatEndDate, startDate, endDate,
     isRepeat: isRepeat == 1 ? true : false,
     executorIdName: taskExecutors || [],
     contactsIdName: contactsName,
-    clueIdNme: clueNme,
+    clueIdName: clueName,
     orderIdName: orderName,
     customIdName: customName,
-    businessOpportunityIdName: businessOpportunityName,
+    businessOpportunityIdName: businessName,
     priorityName: fixedFieldPriority.find(item => item.value == priority)?.label || '',
     taskTypeName: fixedFieldTaskType.find(item => item.value == taskType)?.label || '',
     repeatTypeName: fixedFieldRepetitiveType.find(item => item.value == repeatType)?.label || ''
   }
-
+  console.log(vantFormVal.value, '<========= vantFormVal.value')
+  console.log(row, '<========= vantFormVal.value')
   const list = repeatDesignDay && repeatDesignDay.split(',') || []
   customeDate.value = (list || []).map(item => {
     return {

+ 5 - 2
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/tabbar/home/component/workbench.vue

@@ -66,10 +66,10 @@
                     <div class="text-[#505050]" style="width: 100%;">优先级: {{ ['低','中','高'][item.priority] }}</div>
                   </div>
                   <div class="w-full flex items-center justify-between mt-4">
-                    <div class="text-[#505050]" style="width: 100%;">任务开始时间: {{ item.endDate }}</div>
+                    <div class="text-[#505050]" style="width: 100%;">任务开始时间: {{ item.startDate }}</div>
                   </div>
                   <div class="w-full flex items-center justify-between mt-4">
-                    <div class="text-[#505050]" style="width: 100%;">任务截至时间: {{ item.startDate }}</div>
+                    <div class="text-[#505050]" style="width: 100%;">任务截至时间: {{ item.endDate }}</div>
                   </div>
                 </div>
               </template>
@@ -254,6 +254,9 @@ function addTaskClick() {
 
 function toEditTask(row) {
   const jumpTo = routingInfos['tasks']
+  let newRow = row
+  delete newRow.taskLogs
+  delete newRow.createDate
   router.navigateTo({
     pathName: 'addEditor',
     success: () => {

+ 14 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/biReport/addEdit/index.vue

@@ -110,6 +110,10 @@ function dragAndDropEditing() {
     globalPopup?.showWarning('请先选择业务对象')
     return
   }
+  if (mapData?.selectNodes.length > 10) {
+    globalPopup?.showWarning('最多只能选择10个业务对象')
+    return
+  }
 
   sessionStorage.setItem('reportJson', JSON.stringify({
     addFormVal: {
@@ -205,9 +209,16 @@ onMounted(() => {
                 <div class="absolute left-[-10px] top-[2px] text-[red]">*</div>
               </div>
             </template>
-            <el-select v-model="formVal.businessObject" placeholder="请选择" @change="businessObjectSelectChange">
-              <el-option v-for="item in businessTableList" :key="item.value" :label="item.label" :value="item.value" />
-            </el-select>
+            <div class="flex w-full items-center">
+              <el-select v-model="formVal.businessObject" placeholder="请选择" @change="businessObjectSelectChange">
+                <el-option v-for="item in businessTableList" :key="item.value" :label="item.label" :value="item.value" />
+              </el-select>
+              <div class="ml-4">
+                <el-tooltip class="box-item" effect="dark" content="最多只能选择10个业务对象" placement="top">
+                  <el-icon><QuestionFilled /></el-icon>
+                </el-tooltip>
+              </div>
+            </div>
           </el-form-item>
         </el-form>
 

+ 1 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/tasks/index.vue

@@ -269,6 +269,7 @@ function submitForm(data: any, isClose: boolean) {
       taskLogs: []
     }
   }
+  delete params.taskLogs
   taskLoading.value = "2";
   let url = isEdit.value ? UPDATE_TASK : ADD_TASK
   let msg = isEdit.value ? "修改成功" : "新建成功"

+ 11 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/dto/TaskDto.java

@@ -2,10 +2,13 @@ package com.management.platform.entity.dto;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.management.platform.entity.Task;
+import com.management.platform.entity.TaskLog;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
+import java.util.List;
+
 @EqualsAndHashCode(callSuper = true)
 @Data
 @Accessors(chain = true)
@@ -28,4 +31,12 @@ public class TaskDto extends Task {
     private String departmentIdByMyselfOrNull;
 
 
+    private List<TaskLog> taskLogs;
+
+    private String contactsPhone;
+
+
+    private List<String> taskExecutors;
+
+
 }

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

@@ -6,10 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.entity.*;
 import com.management.platform.entity.dto.QueryVisitPlanDTO;
 import com.management.platform.entity.dto.TaskDto;
-import com.management.platform.entity.vo.DailyTaskVO;
-import com.management.platform.entity.vo.MonthActivePlanVO;
-import com.management.platform.entity.vo.VisitPlanDetailVO;
-import com.management.platform.entity.vo.VisitPlanVO;
+import com.management.platform.entity.vo.*;
 import com.management.platform.mapper.*;
 import com.management.platform.service.SysFunctionService;
 import com.management.platform.service.VisitPlanService;
@@ -56,6 +53,11 @@ public class VisitPlanServiceImpl extends ServiceImpl<VisitPlanMapper, VisitPlan
     @Resource
     private TaskMapper taskMapper;
 
+    @Resource
+    private TaskLogMapper taskLogMapper;
+    @Resource
+    private TaskExecutorMapper taskExecutorMapper;
+
     @Override
     public HttpRespMsg addOrUpdateVisitPlan(VisitPlan visitPlan, HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
@@ -379,6 +381,28 @@ public class VisitPlanServiceImpl extends ServiceImpl<VisitPlanMapper, VisitPlan
         LocalDateTime startDateParse = LocalDateTime.parse(calenderDate + " 00:00", formatter);
         LocalDateTime endDateParse = startDateParse.plusDays(1L);
         List<TaskDto> taskList = taskMapper.getTaskListByStartAndEnd(startDateParse, endDateParse, departmentId, executor, companyId);
+        List<TaskExecutor> taskExecutorList = taskExecutorMapper.selectList(new LambdaQueryWrapper<TaskExecutor>().eq(TaskExecutor::getCompanyId,user.getCompanyId()));
+        List<TaskLog> taskLogList = taskLogMapper.selectList(new LambdaQueryWrapper<TaskLog>().eq(TaskLog::getCompanyId,user.getCompanyId()).orderByDesc(TaskLog::getModTime));
+
+        for (TaskDto taskDto : taskList) {
+            if (!taskExecutorList.isEmpty()){
+                List<TaskExecutor> collect = taskExecutorList.stream().
+                        filter(taskExecutor -> taskExecutor.getTaskId().equals(taskDto.getId())).
+                        filter(taskExecutor -> taskExecutor.getCompanyId().equals(user.getCompanyId()))
+                        .collect(Collectors.toList());
+                if (!collect.isEmpty()){
+                    List<String> collect1 = collect.stream().map(TaskExecutor::getExecutorName).collect(Collectors.toList());
+                    taskDto.setTaskExecutors(collect1);
+                }
+            }
+            if (!taskLogList.isEmpty()){
+                List<TaskLog> collect = taskLogList.stream().filter(taskLog -> taskLog.getTaskId().equals(taskDto.getId()))
+                        .filter(taskLog -> taskLog.getCompanyId().equals(user.getCompanyId())).collect(Collectors.toList());
+                if (!collect.isEmpty()){
+                    taskDto.setTaskLogs(collect);
+                }
+            }
+        }
 
         HashMap<String, Object> map = new HashMap<>();
         map.put("planList",resPage);
@@ -438,6 +462,28 @@ public class VisitPlanServiceImpl extends ServiceImpl<VisitPlanMapper, VisitPlan
         LocalDateTime parseStartDate = startDate.atStartOfDay(); // 获取开始时间
         LocalDateTime parseEndDate = parseStartDate.plusMonths(1L);// 获取结束时间
         List<TaskDto> taskList = taskMapper.getTaskListByStartAndEnd(parseStartDate, parseEndDate, departmentId, executor, companyId);
+        List<TaskExecutor> taskExecutorList = taskExecutorMapper.selectList(new LambdaQueryWrapper<TaskExecutor>().eq(TaskExecutor::getCompanyId,user.getCompanyId()));
+        List<TaskLog> taskLogList = taskLogMapper.selectList(new LambdaQueryWrapper<TaskLog>().eq(TaskLog::getCompanyId,user.getCompanyId()).orderByDesc(TaskLog::getModTime));
+
+        for (TaskDto taskDto : taskList) {
+            if (!taskExecutorList.isEmpty()){
+                List<TaskExecutor> collect = taskExecutorList.stream().
+                        filter(taskExecutor -> taskExecutor.getTaskId().equals(taskDto.getId())).
+                        filter(taskExecutor -> taskExecutor.getCompanyId().equals(user.getCompanyId()))
+                        .collect(Collectors.toList());
+                if (!collect.isEmpty()){
+                    List<String> collect1 = collect.stream().map(TaskExecutor::getExecutorName).collect(Collectors.toList());
+                    taskDto.setTaskExecutors(collect1);
+                }
+            }
+            if (!taskLogList.isEmpty()){
+                List<TaskLog> collect = taskLogList.stream().filter(taskLog -> taskLog.getTaskId().equals(taskDto.getId()))
+                        .filter(taskLog -> taskLog.getCompanyId().equals(user.getCompanyId())).collect(Collectors.toList());
+                if (!collect.isEmpty()){
+                    taskDto.setTaskLogs(collect);
+                }
+            }
+        }
 
         Map<LocalDate, List<TaskDto>> dailyTasks = new LinkedHashMap<>();
 

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

@@ -473,7 +473,12 @@
 
     </select>
     <select id="getTaskListByStartAndEnd" resultType="com.management.platform.entity.dto.TaskDto">
-        select DISTINCT task.id,task.task_name,task.start_date,task.end_date,task.status,task.priority
+        select DISTINCT task.* ,
+        custom.custom_name,
+        business_opportunity.name businessName,
+        `sales_order`.order_name ,
+        clue.clue_name,
+        contacts.name contacts_name ,contacts.phone 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

+ 78 - 7
fhKeeper/formulahousekeeper/timesheet/src/views/project/gantt.vue

@@ -1,9 +1,16 @@
 {{ src/components/Gantt.vue }}
 <template>
-    
-  <div ref="gantt">
-
+  <div ref="ganttContainer">
   </div>
+    <!-- 任务详情信息弹出框 -->
+    <!-- <el-dialog :class="addForm.id==null?'':'jm'" :title="title" v-if="taskFormVisible" :visible.sync="taskFormVisible" 
+      :close-on-click-modal="false" customClass="customWidth" width="840px" :top="'6vh'">
+          <taskComponent ref="thskComponents" :integrationTask="integrationTask" :showOrNot="showOrNot" @closeBounced="closeBounced"></taskComponent>
+          <div slot="title" v-if="addForm.parentTid != null">
+              <el-page-header  @back="backToParentTask" :title="$t('parenttask')" :content="addForm.parentTname"></el-page-header>
+          </div>
+      </el-dialog> -->
+  
 </template>
 
 <script>
@@ -22,7 +29,20 @@ export default {
       }
     },
     stafforpro: '',
-    valueDate:[]
+    valueDate:[],
+  },
+  data() {
+    return {
+      containerRect:null,
+      taskFormVisible: false,
+      addForm:null,
+      addLoading: false,
+      title: this.$t('createtask '),
+      commentList:[],
+      showOrNot: false,
+      integrationTask:null,
+      taskComponentFlg: false,
+    };
   },
   created:function(){
     // gantt.clearAll()
@@ -30,7 +50,38 @@ export default {
   },
  
   methods: {
-      
+    handleEmptyClick(event) {
+      const x = event.clientX - this.containerRect.left;
+      const y = event.clientY - this.containerRect.top;
+
+      // 获取点击位置对应的时间轴日期
+      const date = gantt.dateFromPos(x);
+      console.log(date);
+
+      // this.addTask();
+    },
+    addTask() {
+        this.taskFormVisible = true;
+        // this.addForm = {projectId: stage.projectId, groupId: stage.groupId, stagesId: stage.id, taskLevel:0, planHours: 8, taskType: 0};
+        this.addForm = {projectId: '', groupId: '', stagesId: '', taskLevel:0, planHours: 8, taskType: 0};
+        this.addLoading = false;
+        this.title=this.$t('createtask ');
+        this.commentList = [];
+        this.showOrNot = true
+
+        let obj = {
+            create: true,
+            addForm: this.addForm,
+            executorListFront: [{executorId:null, planHours:8}],
+            stage: this.addForm,
+            integrationTaskNingwai: this.integrationTaskNingwai,
+            taskVue: true,         
+            meetingId: this.addForm.meetingId
+        }
+        this.integrationTask = obj
+
+        this.taskComponentFlg = true
+    },
   },
   mounted: function () {
     gantt.clearAll()
@@ -87,7 +138,7 @@ export default {
     // gantt.config.autosize = true;
     // gantt.config.duration_unit = "hour";
     gantt.config.fit_tasks = true;
-      gantt.config.drag_move = false;
+    gantt.config.drag_move = false;
     gantt.config.xml_date = "%Y-%m-%d";
     gantt.config.columns=[
         {name:"text",label:(this.stafforpro == this.$t('anRenYuanChaKan') ? this.$t('lable.name') : this.$t('headerTop.projectName')), align: "left", tree:true},
@@ -188,6 +239,15 @@ export default {
     //   },
 
     // }
+    // 给每行增加双击事件 ,亲测事件会重复注册,用这个方法拦截一下
+    if (this.onTaskDblClick) gantt.detachEvent(this.onTaskDblClick);
+    // 双击bar任务事件(单击会有问题,点击展开时也会触发)
+    this.onTaskDblClick = gantt.attachEvent("onTaskDblClick", (id, e) => {
+      console.log('=====在这里,开始显示任务弹窗编辑任务===id=='+id+", e="+e);
+        this.$emit('rowDbClick',id)
+        return true;
+    }, { id: 'onTaskDblClick' })
+
     gantt.ext.tooltips.attach({
       selector: '.gantt_grid [' + gantt.config.task_attribute + ']',
       onmouseenter: (event,node) => {
@@ -212,8 +272,18 @@ export default {
       // },
       global: true
     })
+
+    // 绑定空白点击事件
+    gantt.attachEvent("onEmptyClick", (event) => {
+      this.handleEmptyClick(event);
+      return true; // 阻止默认行为
+    });
+    
     
-    gantt.init(this.$refs.gantt);
+    gantt.init(this.$refs.ganttContainer);
+    console.log('===初始化Init gantt===');
+    console.log(this.$refs.ganttContainer)
+    this.containerRect = this.$refs.ganttContainer.getBoundingClientRect();
     // this.$props.tasks.data[31].render = "split"
     gantt.parse(this.$props.tasks);
     
@@ -226,6 +296,7 @@ export default {
     // console.log("props",gantt);
   }
 }
+
 </script>
  
 <style>

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

@@ -1823,7 +1823,7 @@
             </div>
             <div style="float: right; vertical-align: middle;height:32px">
               <el-link
-              type="primary"
+              type="primary" v-loading="remindering"
               @click="changeReminder()"
               >{{ $t('bianGengTiXing') }}</el-link
               >
@@ -2303,6 +2303,7 @@
         },
         data() {
             return {
+                remindering: false,
                 onlyHaveAttendance: false,
                 notFullData:[],
                 notFullOriginList:[],
@@ -8903,7 +8904,9 @@
                     parameter.createDate=item.createDate,
                     parameter.userId=item.userId
                 }
+                this.remindering = true;
                 this.http.post('/report/changeReminder',parameter,res => {
+                    this.remindering = false;
                     if(res.code == 'ok'){
                         this.$message({
                             message: res.msg,