hlp 1 anno fa
parent
commit
313e387bc1

+ 17 - 17
fhKeeper/formulahousekeeper/customerBuler-crm/src/components/TaskModal/api.ts

@@ -1,17 +1,17 @@
 export const defalutModalForm = {
   taskName: "", //任务名称
   priority: "", //优先级
-  taskType: "0", //  任务类型
+  taskType: 2, //  任务类型
   customerId: null, //  客户id 0
   businessId: null, //商机id 1
   orderId: null, //  订单id 2
   clueId: null, //线索id 3
   contactsId: null, //联系人id
   executorId: null, //执行人id
-  repeat: "0", //是否重复
-  repeatType: "0", //重复类型
-  endType: "1", //结束类型
-  repeatEndNever: "1",
+  repeat: 0, //是否重复
+  repeatType: 0, //重复类型
+  endType: 1, //结束类型
+  repeatEndNever: 1,
   repeatEndCount: null, //重复指定次数次数后结束
   repeatEndDate: null, //重复到指定日期后结束
   repeatDesignDay: null, //自定义日期
@@ -23,17 +23,17 @@ export const defalutModalForm = {
 };
 export const PRIORITY = [
   //优先级
-  { label: "高", value: "0" },
-  { label: "中", value: "1" },
-  { label: "低", value: "2" },
+  { label: "高", value: 0 },
+  { label: "中", value: 1 },
+  { label: "低", value: 2 },
 ];
 
 export const TASK_TYPE = [
   // 弹窗任务类型
-  { label: "客户", value: "0", show: true },
-  { label: "商机", value: "1", show: true },
-  { label: "销售订单", value: "2", show: true },
-  { label: "线索", value: "3", show: false },
+  { label: "客户", value: 0, show: true },
+  { label: "商机", value: 1, show: true },
+  { label: "销售订单", value: 2, show: true },
+  { label: "线索", value: 3, show: false },
 ];
 export const TASK_TYPE_FIELD = [
   {
@@ -55,11 +55,11 @@ export const TASK_TYPE_FIELD = [
 ];
 
 export const REPEAT_TYPE = [
-  { label: "每天", value: "0" },
-  { label: "每周", value: "1" },
-  { label: "每月", value: "2" },
-  { label: "自定义周期", value: "3" },
-  { label: "自定义日期", value: "4" },
+  { label: "每天", value: 0 },
+  { label: "每周", value: 1 },
+  { label: "每月", value: 2 },
+  { label: "自定义周期", value: 3 },
+  { label: "自定义日期", value: 4 },
 ];
 export const defaultGenerateFormData = {
   list: [],

+ 40 - 41
fhKeeper/formulahousekeeper/customerBuler-crm/src/components/TaskModal/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-dialog v-model="modalVisible" width="800px" :show-close="false" :close-on-click-modal="false" top="10vh">
+  <el-dialog v-model="props.visible" width="800px" :show-close="false" :close-on-click-modal="false" top="10vh">
     <template #header="{ titleId, titleClass }">
       <div class="flex justify-between items-center border-b pb-3">
         <h4 :id="titleId" :class="titleClass">{{ editForm ? '编辑任务' : '新增任务' }}</h4>
@@ -12,13 +12,13 @@
         </div>
       </div>
     </template>
-    <div class="h-[55vh] overflow-y-auto scroll-bar">
-      <el-form ref="formRef" :model="form" label-width="100px" :rules="rules" class="flex flex-wrap form">
-        <el-form-item label="任务名称" prop="taskName" required>
+    <div class="h-[55vh] overflow-y-auto scroll-bar mt-5">
+      <el-form ref="formRef" :model="form" label-width="7em" :rules="rules" class="flex flex-wrap form">
+        <el-form-item label="任务名称:" prop="taskName" required>
           <el-input v-model="form.taskName" type="textarea" placeholder="请输入任务名称" clearable maxlength="100"
             show-word-limit />
         </el-form-item>
-        <el-form-item prop="priority" label="优先级" required>
+        <el-form-item prop="priority" label="优先级:" required>
           <el-select v-model="form.priority" placeholder="请选择" clearable>
             <el-option v-for="item in PRIORITY " :key="item.value" :value="item.value" :label="item.label" />
           </el-select>
@@ -36,30 +36,30 @@
             </el-select>
           </template>
         </el-form-item>
-        <el-form-item label="联系人" v-if="TASK_TYPE.find(v => v.value === (form.taskType || '1'))?.show">
+        <el-form-item label="联系人:" v-if="TASK_TYPE.find(v => v.value === (form.taskType || '1'))?.show">
           <el-select v-model="form.contactsId" placeholder="请选择" clearable filterable>
             <el-option v-for="item in contactValueData" :key="item.value" :value="item.value" :label="item.label" />
           </el-select>
         </el-form-item>
-        <el-form-item label="执行人">
+        <el-form-item label="执行人:">
           <el-select v-model="form.executorId" placeholder="请选择" clearable multiple filterable>
             <el-option v-for="item in executorValueData" :key="item.value" :value="item.value" :label="item.label" />
           </el-select>
         </el-form-item>
-        <el-form-item label="重复提醒">
-          <el-switch v-model="form.repeat" active-value="1" inactive-value="0" @change="changeRepeat" />
+        <el-form-item label="重复提醒:">
+          <el-switch v-model="form.repeat" :active-value="1" :inactive-value="0" @change="changeRepeat" />
         </el-form-item>
-        <template v-if="form.repeat === '1'">
-          <el-form-item label="重复类型" label-width="7em">
+        <template v-if="form.repeat === 1">
+          <el-form-item label="重复类型:">
             <el-select v-model="form.repeatType" placeholder="请选择" @change="changeRepeatType">
               <el-option v-for="item in REPEAT_TYPE" :key="item.value" :value="item.value" :label="item.label" />
             </el-select>
           </el-form-item>
-          <template v-if="['0', '1', '2', '3'].includes(form.repeatType)">
-            <el-form-item label="每" label-width="7em" v-if="form.repeatType == 3">
+          <template v-if="[0,1,2,3].includes(form.repeatType)">
+            <el-form-item label="每:" v-if="form.repeatType == 3">
               <el-input-number v-model="form.repeatDesignSameday" controls-position="right" :min="1" />天
             </el-form-item>
-            <el-form-item label="结束" label-width="7em">
+            <el-form-item label="结束:">
               <el-radio-group v-model="form.endType" @change="changeEndType">
                 <el-radio label="1" class="w-full">永不</el-radio>
                 <el-radio label="2" class="w-full mb-3"><el-input-number v-model="form.repeatEndCount" :min="1"
@@ -74,7 +74,7 @@
               </el-radio-group>
             </el-form-item>
           </template>
-          <template v-if="['4'].includes(form.repeatType)">
+          <template v-if="[4].includes(form.repeatType)">
             <el-form-item v-for="(v, i) in customeDate" class="flex justify-between items-center customeDate">
               <div>
                 第{{ i + 1 }}次重复在
@@ -97,10 +97,10 @@
             </el-form-item>
           </template>
         </template>
-        <el-form-item label="开始时间" label-width="7em" class="w50">
+        <el-form-item label="开始时间:" class="w50">
           <el-date-picker v-model="form.startDate" type="date" placeholder="选择日期" value-format="YYYY-MM-DD" />
         </el-form-item>
-        <el-form-item label="截止时间" label-width="7em" class="w50">
+        <el-form-item label="截止时间:" class="w50">
           <el-date-picker v-model="form.endDate" type="date" placeholder="选择日期" value-format="YYYY-MM-DD" />
         </el-form-item>
       </el-form>
@@ -109,7 +109,7 @@
         <el-form-item label="操作记录" label-width="7em">
           <div class="w-full">
             <div v-for="item in form.taskLogs" class=" border-b-2 w-full pl-3">
-              {{ `${item.operateTime} ${item.operateUser} ${item.operateDesc}` }}
+              {{ `${item.modTime} ${item.userName} ${item.content}` }}
             </div>
           </div>
         </el-form-item>
@@ -126,7 +126,7 @@ import { get } from '@/utils/request';
 import { Delete, Plus } from "@element-plus/icons-vue"
 import { FormInstance } from 'element-plus';
 import { getFromValue } from '@/utils/tools';
-import { Props, Emits, TASK_VALUE_TYPE, REPEAT_VALUE_TYPE, } from './type';
+import { Props, Emits } from './type';
 const props = defineProps<Props>()
 const emits = defineEmits<Emits>();
 watch(() => props.saveLoading, (val) => {
@@ -137,7 +137,6 @@ watch(() => props.saveLoading, (val) => {
 })
 watch(() => props.visible, (val) => {
   formRef.value?.resetFields();
-  modalVisible.value = val
   if (val) {
     get(CUSTOMER_FORM_URL).then(res => {
       if (Array.isArray(res.data) && res.data.length > 0) {
@@ -150,17 +149,18 @@ watch(() => props.editForm, (val) => {
   if (!val) {
     //TODO 如果是新增
     form.value = { ...defalutModalForm };
-    taskTypeValueData.value = [{ label: '客户1', value: '1' }, { label: '客户2', value: '2' }];
-    contactValueData.value = [{ label: '联系人1', value: '1' }, { label: '联系人2', value: '2' }];
-    executorValueData.value = [{ label: '执行人1', value: '1' }, { label: '执行人2', value: '2' }];
+    taskTypeValueData.value = [{ label: '客户1', value: 1 }, { label: '客户2', value: 2 }];
+    contactValueData.value = [{ label: '联系人1', value: 1 }, { label: '联系人2', value: 2 }];
+    executorValueData.value = [{ label: '执行人1', value: 1 }, { label: '执行人2', value: 2 }];
     return
   }
   //TODO 如果是编辑
   form.value = { ...val };
-  customeDate.value = (form.value.repeatDesignSameday || "").split(',').filter(Boolean);
+  customeDate.value = (form.value.repeatDesignDay || "").split(',').filter(Boolean);
+  console.log("customeDate.value ", customeDate.value, form.value.repeatDesignDay);
   changeTaskType(form.value.taskType)
-  contactValueData.value = [{ label: '联系人1', value: '1' }, { label: '联系人2', value: '2' }];
-  executorValueData.value = [{ label: '执行人1', value: '1' }, { label: '执行人2', value: '2' }];
+  contactValueData.value = [{ label: '联系人1', value: 1 }, { label: '联系人2', value: 2 }];
+  executorValueData.value = [{ label: '执行人1', value: 1 }, { label: '执行人2', value: 2 }];
 
 })
 const rules = ref({
@@ -175,7 +175,6 @@ const form = ref<any>({});
 const formRef = ref<FormInstance>();
 const generateFormRef = ref<InstanceType<typeof GenerateForm>>();
 const generateFormData = ref<any>(defaultGenerateFormData);
-const modalVisible = ref(false);
 function closeVisible() {
   generateFormData.value = defaultGenerateFormData;
   emits('close')
@@ -212,28 +211,28 @@ function changeTaskType(value: TASK_VALUE_TYPE) {
     contactsId: null, //联系人id
   }
   switch (value) {
-    case "0":
+    case 0:
       taskTypeValueData.value = [];
       setTimeout(() => {
-        taskTypeValueData.value = [{ label: '客户1', value: '1' }, { label: '客户2', value: '2' }];
+        taskTypeValueData.value = [{ label: '客户1', value: 1 }, { label: '客户2', value: 2 }];
       }, 500)
       break;
-    case '1':
+    case 1:
       taskTypeValueData.value = [];
       setTimeout(() => {
-        taskTypeValueData.value = [{ label: "商机1", value: "1" }, { label: "商机2", value: "2" }]
+        taskTypeValueData.value = [{ label: "商机1", value: 1 }, { label: "商机2", value: 2 }]
       }, 500)
       break;
-    case '2':
+    case 2:
       taskTypeValueData.value = [];
       setTimeout(() => {
-        taskTypeValueData.value = [{ label: "订单1", value: "1" }, { label: "订单2", value: "2" }]
+        taskTypeValueData.value = [{ label: "订单1", value: 1 }, { label: "订单2", value: 2 }]
       }, 500)
       break;
-    case '3':
+    case 3:
       taskTypeValueData.value = [];
       setTimeout(() => {
-        taskTypeValueData.value = [{ label: "线索1", value: "1" }, { label: "线索2", value: "2" }]
+        taskTypeValueData.value = [{ label: "线索1", value: 1 }, { label: "线索2", value: 2}]
       }, 500)
       break;
     default:
@@ -250,9 +249,9 @@ function changeRepeat(value: string | number | boolean) {
   form.value = {
     ...form.value,
     repeat: value,
-    repeatType: "0", //重复类型
-    endType: "1", //结束类型
-    repeatEndNever: "1",
+    repeatType: 0, //重复类型
+    endType: 1, //结束类型
+    repeatEndNever: 1,
     repeatEndCount: null, //重复指定次数次数后结束
     repeatEndDate: null, //重复到指定日期后结束
     repeatDesignDay: null, //自定义日期
@@ -265,8 +264,8 @@ function changeRepeatType(value: REPEAT_VALUE_TYPE) {
   form.value = {
     ...form.value,
     repeatType: value, //重复类型
-    endType: "1", //结束类型
-    repeatEndNever: "1",
+    endType: 1, //结束类型
+    repeatEndNever: 1,
     repeatEndCount: null, //重复指定次数次数后结束
     repeatEndDate: null, //重复到指定日期后结束
     repeatDesignDay: null, //自定义日期
@@ -279,7 +278,7 @@ function changeEndType(value: string | number | boolean) {
   form.value = {
     ...form.value,
     endType: value, //重复类型
-    repeatEndNever: value == "1" ? "1" : null,//永不结束
+    repeatEndNever: value == 1 ? 1 : null,//永不结束
     repeatEndCount: null, //重复指定次数次数后结束
     repeatEndDate: null, //重复到指定日期后结束
     repeatDesignDay: null, //自定义日期

+ 0 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/components/TaskModal/type.d.ts

@@ -1,5 +1,3 @@
-type TASK_VALUE_TYPE = "0" | "1" | "2" | "3";
-type REPEAT_VALUE_TYPE = "0" | "1" | "2" | "3" | "4";
 export interface Props {
   /**
    *  弹窗是否显示

+ 77 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/tasks/ExportModal.vue

@@ -0,0 +1,77 @@
+<template>
+  <el-dialog v-model="props.visible" width="500px" :show-close="false" :close-on-click-modal="false" top="10vh"
+    class="exportModal">
+    <template #header="{ titleId, titleClass }">
+      <div class="flex justify-between items-center border-b pb-3">
+        <h4 :id="titleId" :class="titleClass">导出任务</h4>
+        <div>
+          <el-button type="primary" :loading="['2'].includes(props.saveLoading)" @click="submit()">
+            导出
+          </el-button>
+          <el-button @click="closeVisible()">取消</el-button>
+        </div>
+      </div>
+    </template>
+    <div class="mt-5">
+      <el-form ref="formRef" :model="form" label-width="6em" class="flex flex-wrap form">
+        <el-form-item label="优先级:">
+          <el-select v-model="form.priority" placeholder="请选择" clearable>
+            <el-option v-for="item in PRIORITY " :key="item.value" :value="item.value" :label="item.label" />
+          </el-select>
+        </el-form-item>
+          <el-form-item label="执行人:">
+          <el-select v-model="form.executorId" placeholder="请选择" clearable multiple filterable>
+            <el-option v-for="item in executorValueData" :key="item.value" :value="item.value" :label="item.label" />
+          </el-select>
+        </el-form-item>
+         <el-form-item label="开始时间:" class="w50">
+          <el-date-picker v-model="form.startDate" type="date" placeholder="选择日期" value-format="YYYY-MM-DD" />
+        </el-form-item>
+        <el-form-item label="截止时间:" class="w50">
+          <el-date-picker v-model="form.endDate" type="date" placeholder="选择日期" value-format="YYYY-MM-DD" />
+        </el-form-item>
+      </el-form>
+    </div>
+  </el-dialog>
+</template>
+
+<script lang="ts" setup>
+import { ref, watch } from 'vue';
+import { Props, Emits } from "./type"
+import { defalutExportForm,PRIORITY } from './api';
+const props = defineProps<Props>();
+const emits = defineEmits<Emits>();
+watch(() => props.visible, (val) => {
+  if (val) {
+    form.value = { ...defalutExportForm }
+    executorValueData.value = [{ label: '执行人1', value: '1' }, { label: '执行人2', value: '2' }];
+  }
+ })
+function closeVisible() {
+  emits("close")
+ }
+function submit() {
+  const { executorId, ...rest } = form.value;
+  const data = {
+    ...rest,
+    executorId: executorId.join(','),
+  }
+  emits("submit",data)
+ }
+
+const formRef = ref();
+const form = ref<any>({})
+const executorValueData = ref<any>([])
+</script>
+
+<style lang="scss">
+.el-form-item {
+  width: 100%;
+}
+
+.form {
+  .w50 {
+    @apply w-1/2;
+  }
+}
+</style>

+ 44 - 4
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/tasks/ImportModal.vue

@@ -1,9 +1,49 @@
 <template>
-<div>
-</div>
+  <el-dialog v-model="props.visible" width="500px" :show-close="false" :close-on-click-modal="false" top="10vh"
+    class="importModal">
+    <template #header="{ titleId, titleClass }">
+      <div class="flex justify-between items-center border-b pb-3">
+        <h4 :id="titleId" :class="titleClass">导入任务</h4>
+        <div>
+          <el-button type="primary" :loading="['2'].includes(props.saveLoading)" @click="submit()">
+            <input type="file" v-show="false" ref="fileInputRef" @change="changeFile" accept=".xls,.xlsx" />
+            导入
+          </el-button>
+          <el-button @click="closeVisible()">取消</el-button>
+        </div>
+      </div>
+    </template>
+    <div class="text-lg p-5">
+      <div class="pb-5">1. 点击下载 <a href="###" download class="text-[#79BBFF]">任务导入模板</a></div>
+      <div>2. 填写excel文件, 任务名称与优先级必填</div>
+    </div>
+  </el-dialog>
 </template>
 <script lang="ts" setup>
+import { ref, watch } from "vue";
+import { Props, Emits } from "./type"
 
+const props = defineProps<Props>();
+const emits = defineEmits<Emits>();
+
+watch(() => props.saveLoading, (newValue) => {
+  if (!fileInputRef.value) return
+  fileInputRef.value.value = ""
+  if (newValue == "3") {
+    emits("close")
+    return
+  }
+})
+
+const fileInputRef = ref<HTMLInputElement>();
+
+function submit() {
+  fileInputRef.value?.click()
+}
+function closeVisible() {
+  emits("close")
+}
+function changeFile(e: any) {
+  emits("submit", e.target.files[0])
+}
 </script>
-<style lang="scss" scoped>
-</style>

+ 26 - 12
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/tasks/api.ts

@@ -1,6 +1,6 @@
 import { EpPropMergeType } from "element-plus/es/utils";
 
-export const MDO = "/tasks";
+export const MOD = "/tasks";
 
 type StatusType = {
   label: "全部" | "未开始" | "进行中" | "已完成" | "已超时";
@@ -13,21 +13,26 @@ type StatusType = {
 };
 export const defaultSearchForm = {
   //默认搜索条件
-  taskName: "",
-  customerName: "",
-  tel: "",
-  priority: "",
-  status: "",
-  startDate: "",
-  endDate: "",
-  page: 1,
+  taskName: "", //任务名称
+  customName: "", //客户名称
+  contactsName: "", //联系人
+  executorName: "", //执行人
+  businessName: "", //商机明恒
+  orderName: "", //销售订单
+  phone: "", //电话
+  clueName: "", //线索名称
+  priority: "",//优先级
+  status: "",//任务状态
+  startDate: "",//开始时间
+  endDate: "",//截止时间
+  pageIndex: 1,
   pageSize: 10,
 };
 export const PRIORITY = [
   //优先级
-  { label: "高", value: "0" },
-  { label: "中", value: "1" },
-  { label: "低", value: "2" },
+  { label: "高", value: 0 },
+  { label: "中", value: 1 },
+  { label: "低", value: 2 },
 ];
 export const STATUS: StatusType[] = [
   //任务状态
@@ -36,3 +41,12 @@ export const STATUS: StatusType[] = [
   { label: "已完成", value: "2", type: "success" },
   { label: "已超时", value: "3", type: "danger" },
 ];
+
+export const defalutExportForm = {
+  priority: "", //优先级
+  executorId: null, //执行人id
+  startDate: "", //开始日期
+  endDate: "", //截止日期
+};
+
+export const PAGE_LIST = `/task/pageTask`;

+ 137 - 35
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/tasks/index.vue

@@ -51,22 +51,23 @@
         </div>
       </div>
     </div>
-    <div class="flex-1 p-5 overflow-auto">
+    <div class="flex-1 p-5 overflow-auto" v-loading="loading">
       <div class="bg-white w-full h-full p-3 shadow-md rounded-md flex flex-col">
         <div class="ml-auto p-3">
           <el-button type="primary" @click="createTasks()">创建任务</el-Button>
-          <el-button type="primary" @click="deleteTasks()">批量删除</el-Button>
-          <el-button type="primary" @click="importTasks()">导入</el-Button>
-          <el-button type="primary" @click="exportTasks()">导出</el-Button>
+          <el-button type="primary" :loading="btnLoading" @click="deleteTasks()">批量删除</el-Button>
+          <el-button type="primary" @click="openImportModal()">导入</el-Button>
+          <el-button type="primary" :loading="btnLoading" @click="exportTasks()">导出</el-Button>
         </div>
         <div class="flex-1">
-          <el-table :data="tableData" style="width: 100%;height: 100%;">
+          <el-table :data="tableData" style="width: 100%;height: 100%;" ref="tableRef">
+            <el-table-column type="selection" width="55" />
             <el-table-column prop="taskName" label="任务名称" header-align="center" align="center" show-overflow-tooltip
               width="200" />
             <el-table-column prop="priority" label="优先级" width="90" :sortable="true" header-align="center"
               align="center">
               <template #default="scope">
-                {{ PRIORITY[scope.row.priority]?.label }}
+                {{ PRIORITY.find(item => item.value == scope.row.priority)?.label }}
               </template>
             </el-table-column>
             <el-table-column prop="status" label="状态" width="100" header-align="center" align="center">
@@ -110,33 +111,54 @@
           </el-table>
         </div>
         <div class="ml-auto">
-          <el-pagination layout="total, prev, pager, next, sizes" :total="20" hide-on-single-page />
+          <el-pagination layout="total, prev, pager, next, sizes" :total="totalCount"
+            :current-page="searchForm.pageIndex" hide-on-single-page @size-change="sizeChage"
+            @current-change="currentChange" />
         </div>
       </div>
     </div>
-    <TaskModal :visible="taskModalVisible" :save-loading="taskLoading" :edit-form="taskForm" @close="closeModal"
+    <TaskModal :visible="taskModalVisible" :save-loading="taskLoading" :edit-form="taskForm" @close="closeTaskModal"
       @submit="submitForm" />
+    <ImportModal :visible="importVisible" :save-loading="importLoading" @close="closeImportModal"
+      @submit="importExcel" />
+    <ExportModal :visible="exportVisible" :save-loading="exportLoading" @close="closeExportModal"
+      @submit="exportExcel" />
   </div>
 </template>
 
 <script lang="ts" setup>
-import { onBeforeMount, ref } from 'vue';
+import { inject, onBeforeMount, onMounted, ref } from 'vue';
 import { useStore } from '@/store';
-import { MDO, PRIORITY, STATUS, defaultSearchForm } from './api';
-import { dayjs } from 'element-plus';
+import { MOD, PRIORITY, STATUS, defaultSearchForm, PAGE_LIST } from './api';
+import { dayjs, ElTable } from 'element-plus';
 import TaskModal from '@/components/TaskModal/index.vue';
+import ImportModal from './ImportModal.vue';
+import ExportModal from './ExportModal.vue';
+import { post, uploadFile } from '@/utils/request';
+import { getFromValue } from '@/utils/tools';
 const { getFunctionList } = useStore()
-
+const globalPopup = inject<GlobalPopup>('globalPopup')
 const pagePermission = ref<any[]>();
 const taskModalVisible = ref(false);
 const taskForm = ref<any>();
 const taskLoading = ref<saveLoadingType>("1");
-function closeModal() {
+function closeTaskModal() {
   taskModalVisible.value = false;
   taskForm.value = null;
 }
 function submitForm(data: any, isClose: boolean) {
-  console.log("提交的数据水水水水", data, isClose);
+  const { executorId } = data;
+  console.log("原有的数据", data, isClose);
+  let params = {
+    ...data
+  }
+  if (executorId) {
+    params = {
+      ...params,
+      executorId: executorId.join(',')
+    }
+  }
+  console.log("提交的数据水水水水", params, isClose);
   taskLoading.value = "2";
   setTimeout(() => {
     taskLoading.value = "3";
@@ -145,40 +167,46 @@ function submitForm(data: any, isClose: boolean) {
 
 }
 const searchForm = ref<any>();
+
+const tableRef = ref<InstanceType<typeof ElTable>>();
+const loading = ref<boolean>(false);
+const totalCount = ref<number>(0);
 const tableData = ref<any[]>([
   {
     taskName: '任务1111111111111111111111111',
     contactsTel: "15100111111",
     contactsName: "水水水水",
     customerName: '李四',
-    status: '0',
-    priority: '0',
+    status: 0,
+    priority: 0,
+    executorId: [1, 2], //执行人id
     startDate: dayjs().format('YYYY-MM-DD'),
     endDate: dayjs().format('YYYY-MM-DD'),
-    taskType: '1',
-    endType: '1',
+    repeat:1,
+    taskType: 1,
+    endType: 1,
     taskDesc: "任务秒数",
-    repeat_design_sameday: "1,4,3,4",
+    repeatType:4,
+    repeatDesignDay: "1,4,3,4",
     taskLogs: [
       {
         id: 3,
-        operateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
-        operateType: '3',
-        operateUser: '张三',
-        operateDesc: '删除任务'
+        modTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
+        userName: '张三',
+        content: '删除任务'
       },
       {
         id: 2,
-        operateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
+        modTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
         operateType: '2',
-        operateUser: '张三',
-        operateDesc: '修改任务'
+        userName: '张三',
+        content: '修改任务'
       }, {
         id: 1,
-        operateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
+        modTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
         operateType: '1',
-        operateUser: '张三',
-        operateDesc: '创建任务'
+        userName: '张三',
+        content: '创建任务'
       }
     ]
   },
@@ -235,11 +263,39 @@ const tableData = ref<any[]>([
   }
 ])
 function search() {
-  console.log("searchForm", searchForm.value);
+  loading.value = true;
+  post(PAGE_LIST, getFromValue(searchForm.value)).then(({ data }) => {
+    loading.value = false;
+    const { total, record } = data;
+    totalCount.value = total;
+    // tableData.value = record;
+  }).catch(err => {
+    console.log("err", err);
+    loading.value = false;
+  })
 }
 function reset() {
   searchForm.value = { ...defaultSearchForm };
 }
+function sizeChage(currentSize: number): void {
+  console.log("object", currentSize);
+  searchForm.value = {
+    ...searchForm.value,
+    pageSize: currentSize,
+    pageIndex: 1
+  }
+  search()
+}
+
+function currentChange(currentPage: number): void {
+  console.log("object", currentPage);
+  searchForm.value = {
+    ...searchForm.value,
+    pageIndex: currentPage
+  }
+  search()
+}
+
 function createTasks() {
   taskModalVisible.value = true;
   taskForm.value = null;
@@ -249,14 +305,57 @@ function deleteTasks() {
   console.log(dayjs().format('YYYY-MM-DD'));
 }
 
-function importTasks() {
-  console.log("importTasks", searchForm.value);
+
+const importVisible = ref(false);
+const importLoading = ref<saveLoadingType>("1");
+function openImportModal() {
+  importVisible.value = true;
+}
+function closeImportModal() {
+  importVisible.value = false;
+}
+function importExcel(data: any) {
+  console.log("需要提交的数据,importExcel", data);
+  return
+  const formData = new FormData();
+  formData.append("file", data);
+  formData.append("projectId", "32277");
+  importLoading.value = "2";
+  uploadFile("/document/uploadDocument", formData).then(_res => {
+    globalPopup?.showSuccess("导入成功")
+    importLoading.value = "3";
+  }).catch(err => {
+    globalPopup?.showError(err)
+    importLoading.value = "4";
+  })
 }
 
+const exportVisible = ref(false);
+const exportLoading = ref<saveLoadingType>("1");
+const btnLoading = ref(false);
 function exportTasks() {
-  console.log("exportTasks", searchForm.value);
+  const data = tableRef.value?.getSelectionRows()
+  if (data.length === 0) {
+    // TODO 
+    exportVisible.value = true;
+    return
+  }
+  btnLoading.value = true;
+  setTimeout(() => {
+    btnLoading.value = false;
+  }, 2000)
+}
+function closeExportModal() {
+  exportVisible.value = false;
+}
+function exportExcel(data: any) {
+  console.log("export", data);
+  exportLoading.value = "2";
+  setTimeout(() => {
+    exportLoading.value = "3";
+    exportVisible.value = false;
+  }, 2000)
 }
-
 function editRow(row: any) {
   taskModalVisible.value = true;
   taskForm.value = row;
@@ -271,9 +370,12 @@ function deleteRow(index: any) {
   console.log("deleteRow", index);
 }
 onBeforeMount(() => {
-  pagePermission.value = getFunctionList(MDO);
+  pagePermission.value = getFunctionList(MOD);
   searchForm.value = { ...defaultSearchForm };
 })
+onMounted(() => {
+  search()
+})
 </script>
 
 <style lang="scss" scoped></style>

+ 23 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/tasks/type.d.ts

@@ -0,0 +1,23 @@
+export interface Props {
+  /**
+   *  弹窗是否显示
+   */
+  visible: boolean;
+  /**
+   *  保存按钮loading
+   */
+  saveLoading: saveLoadingType;
+}
+
+export interface Emits {
+  /**
+   *  关闭弹窗事件
+   */
+  (event: "close"): void;
+  /**
+   * 提交表单事件
+   * @param submitData 表单数据
+   * @param isClose 是否关闭弹窗
+   */
+  (event: "submit", submitData: Object): void;
+}

+ 5 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/styles/global.scss

@@ -45,4 +45,9 @@ $modena: #6f4afe;
 .scroll-bar-hide::-webkit-scrollbar {
   width: 1px;
   height: 0px;
+}
+
+.el-dialog__header,.el-dialog__body{
+  margin: 0;
+  padding: 0;
 }

+ 3 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/type.d.ts

@@ -22,3 +22,6 @@ type ListByCodeType = (
 )[];
 
 type saveLoadingType = "1" | "2" | "3" | "4"; //1是没有保存, 2是正在保存, 3是保存成功, 4是保存失败
+
+type TASK_VALUE_TYPE = 0 | 1 | 2 | 3; //0是客户, 1是商机, 2是销售订单 ,3是线索
+type REPEAT_VALUE_TYPE = 0 | 1 | 2 | 3 | 4; //0是每天, 1是每周, 2是每月, 3是自定义周期, 4是自定义日期