Ver Fonte

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

Min há 1 ano atrás
pai
commit
488dbc0387
18 ficheiros alterados com 350 adições e 74 exclusões
  1. 1 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/api.ts
  2. 42 7
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/component/relatedProducts.vue
  3. 47 19
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/index.vue
  4. 0 10
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/type.d.ts
  5. 1 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessOpportunityController.java
  6. 5 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/TaskController.java
  7. 2 2
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Task.java
  8. 1 1
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/SalesOrderMapper.java
  9. 2 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/TaskMapper.java
  10. 2 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/TaskService.java
  11. 175 14
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java
  12. 25 2
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskMapper.xml
  13. 6 6
      fhKeeper/formulahousekeeper/timesheet/src/components/cascader.vue
  14. 1 5
      fhKeeper/formulahousekeeper/timesheet/src/components/cascaderOption.vue
  15. 1 0
      fhKeeper/formulahousekeeper/timesheet/src/components/translationOpenDataText.vue
  16. 17 3
      fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue
  17. 21 5
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue
  18. 1 0
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/my/children/center.vue

+ 1 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/api.ts

@@ -4,6 +4,7 @@ export const GETSYSFILED = "/sys-dict/getListByCode";
 export const GETPERSONNEL = "/user/getSimpleActiveUserList";
 export const GETGENERATEFOEM = `/sys-form/getListByCode${MOD}`
 export const GETBUSINESSLIST = `/business-opportunity/list`
+export const UPDATEINSET = `/business-opportunity/insertAndUpdate`
 
 export const stageStatus = [
     { id: 1, name: "赢单", progress: "100%" },

+ 42 - 7
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/component/relatedProducts.vue

@@ -11,8 +11,9 @@
                 <template #default="scope">
                     <el-select v-model="productTable[scope.$index].productId" placeholder="请选择"
                         v-if="productTableIndex == scope.$index" clearable @clear="clearTableItem(scope.$index)"
-                        @change="selectChange(scope.$index, productTable[scope.$index].productName)">
-                        <el-option v-for="item in productArrar" :key="item.productId" :label="item.productName" :value="item.productId" />
+                        @change="selectChange(scope.$index, productTable[scope.$index].productId)">
+                        <el-option v-for="item in productArrar" :key="item.productId" :label="item.productName"
+                            :value="item.productId" />
                     </el-select>
                     <span v-else>{{ productTable[scope.$index].productName }}</span>
                 </template>
@@ -23,19 +24,25 @@
             <el-table-column prop="inventory" label="库存" width="80"></el-table-column>
             <el-table-column prop="sellingPrice" label="售价" width="180">
                 <template #default="scope">
-                    <el-input-number v-model="productTable[scope.$index].sellingPrice" class="mx-4" :min="0" :max="100000000" controls-position="right" v-if="productTableIndex == scope.$index" />
+                    <el-input-number @change="inputNumberChange('sellingPrice', productTable[scope.$index])"
+                        v-model="productTable[scope.$index].sellingPrice" class="mx-4" :min="0" :max="100000000"
+                        controls-position="right" v-if="productTableIndex == scope.$index" />
                     <span v-else>{{ productTable[scope.$index].sellingPrice }}</span>
                 </template>
             </el-table-column>
             <el-table-column prop="quantity" label="数量" width="180">
                 <template #default="scope">
-                    <el-input-number v-model="productTable[scope.$index].quantity" class="mx-4" :min="0" :max="100000000" controls-position="right" v-if="productTableIndex == scope.$index" />
+                    <el-input-number @change="inputNumberChange('quantity', productTable[scope.$index])"
+                        v-model="productTable[scope.$index].quantity" class="mx-4" :min="0" :max="100000000"
+                        controls-position="right" v-if="productTableIndex == scope.$index" />
                     <span v-else>{{ productTable[scope.$index].quantity }}</span>
                 </template>
             </el-table-column>
             <el-table-column prop="discount" label="折扣(%)" width="180">
                 <template #default="scope">
-                    <el-input-number v-model="productTable[scope.$index].discount" class="mx-4" :min="0" :max="100" controls-position="right" v-if="productTableIndex == scope.$index" />
+                    <el-input-number @change="inputNumberChange('discount', productTable[scope.$index])"
+                        v-model="productTable[scope.$index].discount" class="mx-4" :min="0" :max="100"
+                        controls-position="right" v-if="productTableIndex == scope.$index" />
                     <span v-else>{{ productTable[scope.$index].discount }}</span>
                 </template>
             </el-table-column>
@@ -62,9 +69,20 @@ const productTable: any = ref([{}])
 const productTableIndex = ref(0) // 可以编辑索引
 const productArrar: any = ref([])
 
+type ProductTableField = 'sellingPrice' | 'quantity' | 'discount'
+
+function inputNumberChange(field: ProductTableField, row: any) {
+    const { sellingPrice, quantity, discount, price } = row
+    row.discount = field == 'sellingPrice' ? Math.round(sellingPrice / price * 100) : row.discount
+    row.sellingPrice = field == 'discount' ? Math.round(price * discount / 100) : row.sellingPrice
+    if (sellingPrice && quantity && price && discount) {
+        row.totalPrice = Math.round(Math.round(price * discount / 100) * quantity)
+    }
+}
+
 function selectChange(index: number, val: number | string) {
-    let newObj = productArrar.value.find((item: any) => item.id == val)
-    productTable.value.splice(index, 1, newObj)
+    let newObj = productArrar.value.find((item: any) => item.productId == val)
+    productTable.value.splice(index, 1, { index, ...newObj })
 }
 
 function tableRowItem(row: any) {
@@ -77,7 +95,9 @@ function tableRowClassName({ row, rowIndex, }: { row: any, rowIndex: number }) {
 }
 
 function addTableItem(index: number) {
+    productTableIndex.value = -1
     productTable.value.splice(index + 1, 0, {})
+    console.log(productTable.value)
 }
 
 function clearTableItem(index: number) {
@@ -85,13 +105,28 @@ function clearTableItem(index: number) {
 }
 
 function deteleTableItem(index: number) {
+    productTableIndex.value = -1
     productTable.value.splice(index, 1)
 }
 
+function returnData() {
+    let jsonstr = JSON.stringify(productTable.value)
+    let json = '[{"index":0}]'
+    if(jsonstr == json) {
+        return false
+    }
+    return productTable.value
+}
+
 watchEffect(() => {
     const { productTableList } = props
     productArrar.value = productTableList || []
 });
+
+defineExpose({
+    returnData
+})
+
 </script>
   
 <style lang="scss" scoped></style>

+ 47 - 19
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/index.vue

@@ -39,7 +39,7 @@
           </el-form>
         </div>
         <div class="w-full flex p-3 shadow-[0_-3px_5px_0px_rgba(0,0,0,0.2)]">
-          <El-button class="w-full">重置</El-Button>
+          <El-button class="w-full" @click="resetForm()">重置</El-Button>
           <El-button type="primary" class="w-full" @click="getBusinessTableList()">搜索</El-Button>
         </div>
       </div>
@@ -102,16 +102,18 @@
         <div class="flex justify-between items-center border-b pb-3 dialog-header">
           <h4 :id="titleId">{{ allText.newBusinessisibleText }}</h4>
           <div>
-            <el-button type="primary">保存并新建</el-button>
-            <el-button type="primary" @click="editBusiness()">保存</el-button>
+            <el-button type="primary" :loading="allLoading.newBusinessSaveLading"
+              :disabled="allLoading.businessSaveLading" @click="editBusiness(true)">保存并新建</el-button>
+            <el-button type="primary" @click="editBusiness(false)" :loading="allLoading.businessSaveLading"
+              :disabled="allLoading.newBusinessSaveLading">保存</el-button>
             <el-button @click="closeVisible('newBusinessisible')">取消</el-button>
           </div>
         </div>
       </template>
-      <div class="h-[60vh] overflow-y-auto scroll-bar">
+      <div class="h-[60vh] overflow-y-auto scroll-bar pt-3">
         <GenerateForm ref="generateForm" :data="generateFormData" />
         <div>相关产品</div>
-        <RelatedProducts :productTableList="productTableList" />
+        <RelatedProducts ref="relatedProductsRef" :productTableList="productTableList" />
       </div>
     </el-dialog>
   </div>
@@ -121,7 +123,7 @@
 import { ref, reactive, onMounted, inject } from "vue";
 import type { FormInstance, FormRules } from 'element-plus'
 import { useRouter, useRoute } from "vue-router";
-import { GETSYSFILED, MOD, GETPERSONNEL, GETGENERATEFOEM, GETBUSINESSLIST } from './api'
+import { GETSYSFILED, MOD, GETPERSONNEL, GETGENERATEFOEM, GETBUSINESSLIST, UPDATEINSET } from './api'
 import { GETTABLELIST } from '@/pages/product/api'
 import { post, get } from "@/utils/request";
 import { getAllListByCode, getFromValue, resetFromValue, getFirstDayOfMonth, getLastDayOfMonth, formatDate } from '@/utils/tools'
@@ -133,17 +135,18 @@ const router = useRouter()
 const globalPopup = inject<GlobalPopup>('globalPopup')
 const businessTotalTable = ref(0)
 const generateForm = ref<typeof GenerateForm>() // 自定义表单dom
+const relatedProductsRef = ref<typeof RelatedProducts>()
 const generateFormData = ref({
   config: {},
   list: []
 }) // 自定义表单数据
-const businessTable = ref([
-  { name: '商机040101', phone: '张山' }
-])
-const allLoading = reactive<AllLoadingInterface>({
-  businessTableLading: false
+const businessTable = ref([])
+const allLoading = reactive({
+  businessTableLading: false,
+  businessSaveLading: false,
+  newBusinessSaveLading: false,
 })
-const allVisible = reactive<AllVisibleInterface>({
+const allVisible = reactive({
   newBusinessisible: false,
   recycleVisible: false,
 })
@@ -170,20 +173,33 @@ const fixedData = reactive({
 const productTableList = ref([])
 
 
-function editBusiness() {
+function editBusiness(visibles: boolean) {
   generateForm.value?.getData().then((res: any) => {
-    console.log('正确')
-    console.log(res)
+    let productTableListData = relatedProductsRef?.value?.returnData()
+    let newForm = {
+      ...res,
+      expectedTransactionDate: res.expectedTransactionDate ? formatDate(new Date(res.expectedTransactionDate)) : '',
+      businessItemProductList: productTableListData ? JSON.stringify(productTableListData) : []
+    }
+    allLoading.businessSaveLading = true
+    post(UPDATEINSET, { ...newForm }).then((_res) => {
+      allVisible.newBusinessisible = visibles
+      globalPopup?.showSuccess('保存成功')
+      getBusinessTableList()
+    }).finally(() => {
+      allLoading.businessSaveLading = false
+    })
   }).catch((_err: any) => {
+    console.log(_err)
     globalPopup?.showError('请填写完整')
   })
 }
 
-function showVisible(type: keyof AllVisibleInterface) { // 显示弹窗
+function showVisible(type: keyof typeof allVisible) { // 显示弹窗
   allVisible[type] = true
 }
 
-function closeVisible(type: keyof AllVisibleInterface) {
+function closeVisible(type: keyof typeof allVisible) {
   allVisible[type] = false
 }
 
@@ -193,14 +209,25 @@ function handleClose(done: () => void) {
 
 function getBusinessTableList() {
   const formValue = getFromValue(businessOpportunityForm)
-  post(GETBUSINESSLIST, {...formValue }).then((res) => {
-    console.log(res, '<==== 返回的数据')
+  post(GETBUSINESSLIST, { ...formValue }).then((res) => {
     const { data, total } = res.data
     businessTable.value = data
     businessTotalTable.value = total
   })
 }
 
+function resetForm() {
+  let reset = {
+    startTime: getFirstDayOfMonth(new Date()),
+    endTime: formatDate(new Date()),
+    pageIndex: 1,
+    pageFrom: 10
+  }
+  let newBusinessOpportunityForm = resetFromValue(businessOpportunityForm, { ...reset })
+  Object.assign(businessOpportunityForm, newBusinessOpportunityForm)
+  getBusinessTableList()
+}
+
 async function getSystemField() {
   const systemField = getAllListByCode(['商机阶段'])
   for (let i in systemField) {
@@ -239,6 +266,7 @@ function getProductTableList() {
       productTableList.value = record.map((item: any) => {
         const { id, productName, productCode, unit, unitName, typeName, type, price, inventory } = item
         return {
+          id,
           productId: id,
           productName,
           productCode,

+ 0 - 10
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/type.d.ts

@@ -26,13 +26,3 @@ interface personnelInterface {
   phone: string;
   jobNumber: string;
 }
-
-type AllLoadingInterface = {
-  businessTableLading: boolean;
-}
-
-type AllVisibleInterface = {
-  newBusinessisible: boolean;
-  recycleVisible: boolean;
-}
-

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

@@ -109,6 +109,7 @@ public class BusinessOpportunityController {
             bo.setCreatorId(user.getId());
             bo.setUserId(user.getId());
             bo.setCreateTime(new Date());
+            bo.setIsDelete(0);
             bOservice.insert(bo);
         }else {
             //修改

+ 5 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/TaskController.java

@@ -89,6 +89,11 @@ public class TaskController {
         return taskService.exportData(taskDto,request);
     }
 
+    @RequestMapping("exportDataByTaskIds")
+    public HttpRespMsg exportData(String taskIds) throws Exception {
+        return taskService.exportDataByTaskIds(taskIds,request);
+    }
+
     @RequestMapping("updateTaskStatus")
     public HttpRespMsg updateTaskStatus(TaskDto taskDto) throws Exception {
         System.out.println("===========>"+taskDto.getStatus());

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

@@ -133,8 +133,8 @@ public class Task extends Model<Task> {
     /**
      * 重复结束 在  ? 日期YYYY-MM-DD之后
      */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @TableField("repeat_end_date")
     private LocalDateTime repeatEndDate;
 

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/SalesOrderMapper.java

@@ -17,6 +17,6 @@ import java.util.List;
  */
 public interface SalesOrderMapper extends BaseMapper<SalesOrder> {
 
-    @Select("select * from `order` WHERE company_id = #{companyId} AND is_delete = 0 ")
+    @Select("select * from `sales_order` WHERE company_id = #{companyId} AND is_delete = 0 ")
     List<SalesOrder> getList(User user);
 }

+ 2 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/TaskMapper.java

@@ -66,4 +66,6 @@ public interface TaskMapper extends BaseMapper<Task> {
     void updateRepeatConfig(Task task);
     @Select("select * , (select `name` from `user` where id = executor_id) executorName from task where clue_id = #{id} ORDER BY id DESC")
     List<Task> selectByInfoList(Clue clue1);
+
+    List<TasKVo> getListByTaskIds(@Param("taskIdArray") String[] taskIdArray);
 }

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

@@ -35,4 +35,6 @@ public interface TaskService extends IService<Task> {
     HttpRespMsg exportData(TaskDto taskDto, HttpServletRequest request) throws Exception;
 
     HttpRespMsg updateTaskStatus(TaskDto taskDto, HttpServletRequest request);
+
+    HttpRespMsg exportDataByTaskIds(String taskIds, HttpServletRequest request) throws Exception;
 }

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

@@ -169,7 +169,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
         User user = userMapper.selectById(token);
         taskDto.setCompanyId(user.getCompanyId());
         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()));
+        List<TaskLog> taskLogList = taskLogMapper.selectList(new LambdaQueryWrapper<TaskLog>().eq(TaskLog::getCompanyId,user.getCompanyId()).orderByDesc(TaskLog::getModTime));
         taskDto.setPageIndex((taskDto.getPageIndex()-1)*taskDto.getPageSize());
         List<TasKVo> taskVoList =taskMapper.getPageListTask(taskDto);
         for (TasKVo tasKVo : taskVoList) {
@@ -249,6 +249,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
         taskLog.setContent("修改了任务");
         taskLog.setUserId(user.getId());
         taskLog.setUserName(user.getName());
+        taskLog.setCompanyId(user.getCompanyId());
         taskLogMapper.insert(taskLog);
 
         return msg;
@@ -343,7 +344,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                     JSONObject item = configObJSONArray.getJSONObject(i);
                     String modelName = item.getString("model");
                     HSSFCell cell = row.getCell(i);
-                    if(cell!=null){
+                    if(cell!=null&&StringUtils.isNotEmpty(cell.getStringCellValue())){
                         switch (item.getString("type")){
                             case "time":cell.setCellType(CellType.NUMERIC);
                                 System.out.println(cell.getNumericCellValue());
@@ -395,6 +396,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 task.setCompanyId(companyId);
                 task.setCreaterId(user.getId());
                 task.setCreateDate(LocalDateTime.now());
+                task.setStatus(0);
                 for (int i = 0; i < cellNum; i++) {
                     JSONObject item = configObJSONArray.getJSONObject(i);
                     String modelName = item.getString("model");
@@ -402,7 +404,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                     String getter="get"+className;
                     String setter="set"+className;
                     HSSFCell cell = row.getCell(i);
-                    if(cell!=null){
+                    if(cell!=null&&StringUtils.isNotEmpty(cell.getStringCellValue())){
                         switch (item.getString("type")){
                             case "time":cell.setCellType(CellType.NUMERIC);
                                 System.out.println(cell.getNumericCellValue());
@@ -412,10 +414,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                             default:cell.setCellType(CellType.STRING);
                         }
                     }
-                    Class<Task> taskClass = Task.class;
-                    Field field = taskClass.getDeclaredField(modelName);
-                    Class<?> type = field.getType();
-                    Method method = taskClass.getMethod(setter, type);
+//                    Class<Task> taskClass = Task.class;
+//                    Field field = taskClass.getDeclaredField(modelName);
+//                    Class<?> type = field.getType();
+//                    Method method = taskClass.getMethod(setter, type);
                     //校验当前列是否为必填
                     JSONObject options = item.getJSONObject("options");
                     JSONObject rules = options.getJSONObject("rules");
@@ -688,8 +690,14 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                         taskLog.setCompanyId(user.getCompanyId());
                         taskLogs.add(taskLog);
                     }
-                    boolean b1 = taskExecutorService.saveOrUpdateBatch(taskExecutors);
-                    boolean b2 = taskLogService.saveOrUpdateBatch(taskLogs);
+
+                    boolean b1 = true;
+                    boolean b2 = true;
+                    if (!taskExecutors.isEmpty()) {
+                        b1=taskExecutorService.saveOrUpdateBatch(taskExecutors);
+                    }if (!taskLogs.isEmpty()){
+                        b2=taskLogService.saveOrUpdateBatch(taskLogs);
+                    }
                     if (b1&&b2){
                         return msg;
                     }else {
@@ -770,7 +778,22 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                     value = String.valueOf(aClass.getMethod("getTaskName").invoke(tasKVo)).equals("null")?"":String.valueOf(aClass.getMethod("getTaskName").invoke(tasKVo));
                 }
                 else if(model.equals("priority")){
-                    value = String.valueOf(aClass.getMethod("getPriority").invoke(tasKVo)).equals("null")?"":String.valueOf(aClass.getMethod("getPriority").invoke(tasKVo));
+//                    0-低 1-中 2-高
+                    Integer priority = tasKVo.getPriority();
+                    switch (priority){
+                        case 0:
+                            value ="低";
+                            break;
+                        case 1:
+                            value="中";
+                            break;
+                        case 2:
+                            value="高";
+                            break;
+                        default:
+                            value="";
+
+                    }
                 }
                 else if(model.equals("executorId")){
                     StringJoiner stringJoiner = new StringJoiner(",");
@@ -785,15 +808,19 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 else if(model.equals("startDate")){
                     if (tasKVo.getStartDate()!=null){
                         LocalDateTime startDate = tasKVo.getStartDate();
-                        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
-                        value=format.format(startDate);
+                        // 定义日期时间格式
+                        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+                        // 格式化为字符串
+                        value= startDate.format(formatter);
                     }
                 }
                 else if(model.equals("endDate")){
                     if (tasKVo.getEndDate()!=null){
                         LocalDateTime endDate = tasKVo.getEndDate();
-                        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
-                        value=format.format(endDate);
+                        // 定义日期时间格式
+                        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+                        // 格式化为字符串
+                        value= endDate.format(formatter);
                     }
                 }
                 else if(model.equals("customId")){
@@ -840,6 +867,140 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
         return msg;
     }
 
+    @Override
+    public HttpRespMsg exportDataByTaskIds(String taskIds, HttpServletRequest request) throws Exception {
+        User user = userMapper.selectById(request.getHeader("token"));
+        SysForm sysForm = sysFormMapper.selectOne(new LambdaQueryWrapper<SysForm>().eq(SysForm::getCompanyId, user.getCompanyId()).eq(SysForm::getCode, "Task").eq(SysForm::getIsCurrent, 1));
+        WxCorpInfo wxCorpInfo = wxCorpInfoService.getOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, user.getCompanyId()));
+        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()));
+        String config = sysForm.getConfig();
+        JSONObject configOb = JSON.parseObject(config);
+        JSONArray configObJSONArray = configOb.getJSONArray("list");
+        List<List<String>> dataList=new ArrayList<>();
+        List<String> titleList=new ArrayList<>();
+        for (int i = 0; i < configObJSONArray.size(); i++) {
+            JSONObject item = configObJSONArray.getJSONObject(i);
+            titleList.add(item.getString("label"));
+        }
+        dataList.add(titleList);//设置表头
+
+        List<TasKVo> taskVoList=new ArrayList<>();
+        if (StringUtils.isNotEmpty(taskIds)){
+            String[] taskIdArray = taskIds.split(",");
+            taskVoList =taskMapper.getListByTaskIds(taskIdArray);
+        }
+        if (!taskVoList.isEmpty()){
+            for (TasKVo tasKVo : taskVoList) {
+                if (!taskExecutorList.isEmpty()){
+                    List<TaskExecutor> collect = taskExecutorList.stream().
+                            filter(taskExecutor -> taskExecutor.getTaskId().equals(tasKVo.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());
+                        tasKVo.setTaskExecutors(collect1);
+                    }
+                }
+            }
+        }
+
+        for (TasKVo tasKVo : taskVoList) {
+            List<String> item=new ArrayList<>();
+            for (int i = 0; i < configObJSONArray.size(); i++) {
+                JSONObject target = configObJSONArray.getJSONObject(i);
+                String model = target.getString("model");
+//                String targetName = model.substring(0, 1).toUpperCase() + model.substring(1);
+                Class<? extends TasKVo> aClass = tasKVo.getClass();
+                String value="";
+//                String value = String.valueOf(aClass.getMethod("get" + targetName).invoke(tasKVo)==null?"":aClass.getMethod("get" + targetName).invoke(tasKVo));
+                /*if(model.equals("inchargerId")){
+                    if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                        value = "$userName"+String.valueOf(aClass.getMethod("getInchargerName").invoke(product))+"$";
+                    }else {
+                        value = String.valueOf(aClass.getMethod("getInchargerName").invoke(product));
+                    }
+                }*/
+                /*if(model.equals("sex")){
+                    value = String.valueOf(aClass.getMethod("getSex").invoke(tasKVo)).equals("null") ?"":String.valueOf(aClass.getMethod("getSex").invoke(tasKVo));
+                }*/
+                if(model.equals("taskName")){
+                    value = String.valueOf(aClass.getMethod("getTaskName").invoke(tasKVo)).equals("null")?"":String.valueOf(aClass.getMethod("getTaskName").invoke(tasKVo));
+                }
+                else if(model.equals("priority")){
+//                    0-低 1-中 2-高
+                    Integer priority = tasKVo.getPriority();
+                    switch (priority){
+                        case 0:
+                            value ="低";
+                            break;
+                        case 1:
+                            value="中";
+                            break;
+                        case 2:
+                            value="高";
+                            break;
+                        default:
+                            value="";
+
+                    }
+                }
+                else if(model.equals("executorId")){
+                    StringJoiner stringJoiner = new StringJoiner(",");
+                    List<String> taskExecutors = tasKVo.getTaskExecutors();
+                    if (taskExecutors!=null&&!taskExecutors.isEmpty()){
+                        for (String taskExecutor : taskExecutors) {
+                            stringJoiner.add(taskExecutor);
+                        }
+                    }
+                    value =stringJoiner.length()==0?"":stringJoiner.toString();
+                }
+                else if(model.equals("startDate")){
+                    if (tasKVo.getStartDate()!=null){
+                        LocalDateTime startDate = tasKVo.getStartDate();
+                        // 定义日期时间格式
+                        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+                        // 格式化为字符串
+                        value= startDate.format(formatter);
+                    }
+                }
+                else if(model.equals("endDate")){
+                    if (tasKVo.getEndDate()!=null){
+                        LocalDateTime endDate = tasKVo.getEndDate();
+                        // 定义日期时间格式
+                        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+                        // 格式化为字符串
+                        value= endDate.format(formatter);
+                    }
+                }
+                else if(model.equals("customId")){
+                    value = String.valueOf(aClass.getMethod("getCustomName").invoke(tasKVo)).equals("null")?"":String.valueOf(aClass.getMethod("getCustomName").invoke(tasKVo));
+                }
+                else if(model.equals("businessOpportunityId")){
+                    value = String.valueOf(aClass.getMethod("getBusinessName").invoke(tasKVo)).equals("null")?"":String.valueOf(aClass.getMethod("getBusinessName").invoke(tasKVo));
+                }
+                else if(model.equals("orderId")){
+                    value = String.valueOf(aClass.getMethod("getOrderName").invoke(tasKVo)).equals("null")?"":String.valueOf(aClass.getMethod("getOrderName").invoke(tasKVo));
+                }
+                else if(model.equals("clueId")){
+                    value = String.valueOf(aClass.getMethod("getClueName").invoke(tasKVo)).equals("null")?"":String.valueOf(aClass.getMethod("getClueName").invoke(tasKVo));
+                }
+                else if(model.equals("contactsId")){
+                    value = String.valueOf(aClass.getMethod("getContactsName").invoke(tasKVo)).equals("null")?"":String.valueOf(aClass.getMethod("getContactsName").invoke(tasKVo));
+                }
+                else if(model.equals("phone")){
+                    value = String.valueOf(aClass.getMethod("getContactsPhone").invoke(tasKVo)).equals("null")?"":String.valueOf(aClass.getMethod("getContactsPhone").invoke(tasKVo));
+                }
+                item.add(value);
+            }
+            dataList.add(item);
+        }
+        String fileName="任务表导出_"+ System.currentTimeMillis();
+        return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName,dataList,path);
+
+
+    }
+
     public void updateTaskRepeatConfigure(Task task){
         task.setRepeatType(null).setRepeatEndNever(null).setRepeatEndCount(null)
                 .setRepeatEndDate(null).setRepeatDesignDay(null).setRepeatDesignSameday(null);

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

@@ -104,7 +104,9 @@
             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
-            inner join task_executor on task.id=task_executor.task_id
+            <if test=" executorName!= null and executorName != '' " >
+                inner join task_executor on task.id=task_executor.task_id
+            </if>
 
         <where>
             and 1=1 and task.is_delete=0
@@ -168,7 +170,10 @@
         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
-        inner join task_executor on task.id=task_executor.task_id
+        <if test=" executorName!= null and executorName != '' " >
+            inner join task_executor on task.id=task_executor.task_id
+        </if>
+
 
         <where>
             and 1=1 and task.is_delete=0
@@ -214,6 +219,24 @@
             </if>
         </where>
     </select>
+    <select id="getListByTaskIds" resultType="com.management.platform.entity.vo.TasKVo">
+        select task.* ,
+        custom.custom_name,
+        business_opportunity.name businessName,
+        `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  `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
+        WHERE  task.id IN
+        <foreach item="taskId" collection="taskIdArray" open="(" separator="," close=")">
+            #{taskId}
+        </foreach>
+    </select>
 
     <update id="updateRepeatConfig">
         update task

+ 6 - 6
fhKeeper/formulahousekeeper/timesheet/src/components/cascader.vue

@@ -232,11 +232,11 @@ export default {
         }
         if(this.subject) {
             this.options = JSON.parse(JSON.stringify(this.subject))
-            console.log(this.options, '我收到的数据')
+            // console.log(this.options, '我收到的数据')
         }
         if(this.subjectId) {
             this.optionsOId = JSON.parse(JSON.stringify(this.subjectId))
-            console.log(this.options, '过来的数据')
+            // console.log(this.options, '过来的数据')
             this.traverseArr(this.options, this.optionsOId)
             for(let i in this.options) {
                 if(this.options[i].id == this.optionsOId || this.options[i].auditorId == this.optionsOId) {
@@ -248,7 +248,7 @@ export default {
             }
         }
         this.dailyListIndex = this.idx
-        console.log(this.selectWidth, this.selectHeight)
+        // console.log(this.selectWidth, this.selectHeight)
         // this.moveIon = JSON.parse(JSON.stringify(this.clearable))
     },
     methods: {
@@ -262,7 +262,7 @@ export default {
             }
             if(arr) {
                 for(var i in arr) {
-                    console.log(arr[i].value, idd, id)
+                    // console.log(arr[i].value, idd, id)
                     if(arr[i].label != this.$t('lable.department') && arr[i].label != this.$t('designatedpersonnel')) {
                         if(arr[i].value == id) {
                             console.log('将要付给的值', arr[i])
@@ -295,7 +295,7 @@ export default {
                     that.show = !that.show
                     that.classDiv = false
                     that.move = false
-                }, 100)
+                }, 150)
             }
         },
         liMouseOver(index, item) {
@@ -348,7 +348,7 @@ export default {
             this.liClist(item)
         },
         moveIonDiv() {
-            console.log(this.selectName)
+            // console.log(this.selectName)
             if(this.clearable) {
                 if(this.selectName != this.$t('defaultText.pleaseChoose')) {
                     this.moveIon = true

+ 1 - 5
fhKeeper/formulahousekeeper/timesheet/src/components/cascaderOption.vue

@@ -126,11 +126,7 @@ export default {
         }
     },
     liClick(item) {
-        console.log('我是子组件')
-        if(!item.children) {
-            this.$emit("cascaderOptionClick", item);
-        }
-        if(this.radios) {
+        if(!item.children || this.radios) {
             this.$emit("cascaderOptionClick", item);
         }
     },

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

@@ -8,6 +8,7 @@
             <dt-open-data :open-type='dingdingOpenType[type]' :open-id='openIdValue'></dt-open-data>
         </span>
         <span v-else>{{ openIdValue }}</span>
+        <!-- <span>{{ openIdValue }}</span> -->
     </div>
 </template>
 

+ 17 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

@@ -231,7 +231,11 @@
                      </div>
                 </template>
             </el-table-column>
-            <el-table-column prop="departmentName" :label="$t('subordinatedepartments')" sortable="custom" width="200" v-if="user.timeType.projectWithDept"></el-table-column>
+            <el-table-column prop="departmentName" :label="$t('subordinatedepartments')" sortable="custom" width="200" v-if="user.timeType.projectWithDept">
+                <template slot-scope="scope">
+                    <TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText>
+                </template>
+            </el-table-column>
             <el-table-column prop="projectMainName" :label="$t('zhu-xiang-mu')" sortable="custom" min-width="250" v-if="user.timeType.mainProjectState == '1'">
             </el-table-column>
             <el-table-column prop="inchargerName" :label="$t('projectmanager')" sortable="custom" min-width="150">
@@ -5492,7 +5496,12 @@ a {
                         // }
                         if(this.user.timeType.projectWithDept) {
                             if(this.addForm.deptId != null && this.addForm.deptId != '') {
-                                formData.append("deptId", this.addForm.deptId[this.addForm.deptId.length - 1])
+                                // formData.append("deptId", this.addForm.deptId[this.addForm.deptId.length - 1])
+                                if(Array.isArray(this.addForm.deptId)) {
+                                    formData.append("deptId", this.addForm.deptId[this.addForm.deptId.length - 1])
+                                } else {
+                                    formData.append("deptId", this.addForm.deptId)
+                                }
                             }
                         }
                         formData.append("buId", this.addForm.bu ? this.addForm.bu : '');
@@ -5521,7 +5530,10 @@ a {
                          }
                         // formData.append("associateDegreeNames", listName)
                         //console.log("addform",this.addForm);
-                        //return
+                        // for (const key of formData.keys()) {
+                        //     console.log(key + ': ' + formData.get(key));
+                        // }
+                        // return
                         this.http.uploadFile(this.port.project.add,formData,
                         res => {
                             this.addLoading = false;
@@ -5739,6 +5751,7 @@ a {
                 }
             },
             vueCasader(obj) {
+                console.log(obj, '<-==== 接收的数据')
                 if(obj.distinction == '32') {
                     let arr = []
                     arr.push(obj.id)
@@ -5746,6 +5759,7 @@ a {
                 } else if(obj.distinction == '20') {
                     this.addForm.deptId = obj.id
                 }
+                console.log(this.addForm)
             },
             changSubStatus(subProject) {
                 this.http.post('/sub-project/updateStatus',{ 

+ 21 - 5
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -1387,8 +1387,8 @@
       :visible.sync="monthWorkTimeDialog"
       :close-on-click-modal="false"
       customClass="customWidth selectworktime"
-      width="1200px"
-      title=""
+      width="92%"
+      top="60px"
     >
       <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
       <el-tabs v-model="activeName" @tab-click="handleClick">
@@ -1442,6 +1442,7 @@
             style="width: 100%"
             v-loading="tbload"
             :lazy="true"
+            :cell-style="hasworkTblCellStyle"
           >
             <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
               <template slot-scope="scope">
@@ -1473,7 +1474,6 @@
             >
               <template slot-scope="scope">
                 <div
-                  style="color: red"
                   v-if="
                     scope.row.worktimeList.filter(
                       (w) =>
@@ -1491,7 +1491,6 @@
                   }}
                 </div>
                 <div
-                  style="color: #20a0ff"
                   v-if="
                     scope.row.worktimeList.filter(
                       (w) =>w.createDate==item.date
@@ -2545,6 +2544,23 @@
         },
         methods: {
             ...mapMutations(['upDataLoading']),
+            // 已填工时情况表设置背景色
+            hasworkTblCellStyle({ columnIndex, row, column }) {
+                if(columnIndex > 2) {
+                    const dateSingle = this.pickDateArray[columnIndex - 3].date
+                    const worktimeList = row.worktimeList || []
+                    const times = this.reportTimeType.allday
+                    const filterData = worktimeList.filter(item => item.createDate == dateSingle)
+
+                    const isWorkDate = filterData[0] && filterData[0].workingTime
+                    if(isWorkDate < times) {
+                        return "backgroundColor: #FC3D49"
+                    }
+                    if(isWorkDate > times) {
+                        return "backgroundColor: #20a0ff"
+                    }
+                }
+            },
             // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
             isCustomization(userInfo, permissionArray) {
                 const { companyId } = userInfo
@@ -5779,7 +5795,7 @@
                     if (res.code == "ok") {
                         var filePath = res.data;
                         const a = document.createElement('a'); // 创建a标签
-                        a.setAttribute('download', this.$t('projectexport') + '.xlsx');// download属性
+                        a.setAttribute('download','日报审核记录.xlsx');// download属性
                         a.setAttribute('href', filePath);// href链接
                         a.click(); //自执行点击事件
                         a.remove();

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/my/children/center.vue

@@ -20,6 +20,7 @@
                 <div style="height: 20px;background: #f4f4f4"></div>
                 <!-- </div> -->
                 <van-cell title="账号" v-if="userInfo.userNameNeedTranslate != '1'" :title-style="'flex: 0.5;'" :value="userInfo.phone"></van-cell>
+                <van-cell title="角色" :title-style="'flex: 0.5;'" :value="userInfo.roleName"></van-cell>
                 <van-cell title="工号" v-if="userInfo.jobNumber" :title-style="'flex: 0.5;'" :value="userInfo.jobNumber"></van-cell>
 
                 <div style="height: 20px;background: #f4f4f4"></div>