浏览代码

提交相关代码

Lijy 5 月之前
父节点
当前提交
7d73cd492e

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/hooks/useApi.js

@@ -14,7 +14,7 @@ export const GET_TASK_LIST = '/tasks/pageTask' // 获取任务列表
 export const GET_PRODUCT_LIST = '/product/list' // 获取产品列表
 export const GET_CONTRACT_LIST = '/contract/getContractPage' // 获取合同列表
 export const GET_SALES_ORDER_LIST = '/order/list' // 获取销售订单列表
-export const GET_VISITOR_PLAN = `/visitPlan/getPageVisitPlan` // 获取访客计划
+export const GET_VISITOR_PLAN = `/visitPlan/getVisitPlan` // 获取访客计划
 export const GET_FREQUENTLY_USED_CONTACTS = `/contacts/getFrequentContacts` // 获取常用联系人
 export const GET_COMMONLY_USED_MODULES = `/userCommonModule/getCommonModules` // 常用模块
 

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

@@ -106,15 +106,17 @@
 </template>
 
 <script setup>
-import { ref } from 'vue';
+import { ref, onActivated } from 'vue';
 import { showConfirmDialog } from 'vant';
 import { useLifecycle } from '@hooks/useCommon.js';
 import { DELETE_VISITOR_PLAN, GET_VISITOR_PLAN, GET_FREQUENTLY_USED_CONTACTS, GET_COMMONLY_USED_MODULES } from "@hooks/useApi";
+import useToast from "@hooks/useToast"
 import dayjs from 'dayjs';
 import requests from "@common/requests";
 import useRouterStore from "@store/useRouterStore.js";
 
 const router = useRouterStore()
+const { toastText, toastSuccess, toastFail, toastLoading } = useToast()
 const dateConditions = ref(dayjs().format('YYYY-MM-DD'))
 const minDate = ref(new Date('2024-01-01'))
 const visitorProgramList = ref([])
@@ -122,10 +124,10 @@ const topContactsList = ref([])
 const commonModulesList = ref([])
 
 function deleteVisitor(row) {
-  const { id } = row
+  const { id, planName } = row
   showConfirmDialog({
     title: `删除访客`,
-    message: `确定删除【访客名称】访客吗?`,
+    message: `确定删除【${planName}】访客计划吗?`,
   }).then(() => {
     requests.post(DELETE_VISITOR_PLAN, { planId: id }).then((res) => {
       toastSuccess('删除成功')
@@ -165,7 +167,7 @@ function jumpToAddNewVisitors(row) {
 
 function getVisitorPlan() {
   requests.post(GET_VISITOR_PLAN, { calenderDate: dateConditions.value }).then((res) => {
-    visitorProgramList.value = res.data.records || []
+    visitorProgramList.value = res.data || []
   })
 }
 
@@ -189,6 +191,10 @@ useLifecycle({
     getFrequentlyUsedContacts()
   }
 });
+
+onActivated(() => {
+
+})
 </script>
 
 <style lang='scss' scoped>

+ 34 - 10
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/visitorProgram/addEditorVisitor.vue

@@ -72,7 +72,6 @@
             name="visitTime"
             label="拜访时间"
             placeholder="请选择"
-            :disabled="addOrEdit"
             :rules="[{ required: true, message: '' }]"
             @click="showPickerClick('visitTime')"
           >
@@ -139,6 +138,15 @@
           @cancel="showPicker = false"
         />
       </van-popup>
+      <!-- 时间选择器 -->
+      <van-popup
+        v-model:show="timeShowPicker"
+        destroy-on-close
+        position="bottom"
+        :style="{ height: '50%' }"
+      >
+        <van-time-picker v-model="currentTime" title="选择时间" @confirm="timeConfirm" />
+      </van-popup>
       <!-- 客户选择 -->
       <van-popup
         v-model:show="customerShowPicker"
@@ -195,18 +203,21 @@
 import { ref } from "vue";
 import { useLifecycle } from "@hooks/useCommon.js";
 import dayjs from "dayjs";
-import { GET_ALL_CUSTOMERS, RETRIEVE_DICTIONARY_ENTRIES } from "@hooks/useApi";
+import { GET_ALL_CUSTOMERS, RETRIEVE_DICTIONARY_ENTRIES, PLAN_TO_ADD_EDITORS } from "@hooks/useApi";
+import useToast from "@hooks/useToast"
 import requests from "@common/requests";
 import useRouterStore from "@store/useRouterStore.js";
 import useFixedData from "@store/useFixedData.js";
 import PullDownSelector from "@components/common/pullDownSelector.vue";
 
 const router = useRouterStore();
+const { toastText, toastSuccess, toastFail, toastLoading } = useToast()
 const fixedData = useFixedData();
 const form = ref({});
 const addEditFormRef = ref()
 const submitLoading = ref(false);
 const showPicker = ref(false);
+const timeShowPicker = ref(false);
 const customerShowPicker = ref(false);
 const personnelShowPicker = ref(false);
 const visitShowPicker = ref(false);
@@ -214,21 +225,26 @@ const remindShowPicker = ref(false);
 const customerAllList = ref([]);
 const purposeOfVisitList = ref([]); // 拜访目的
 const reminderTimeList = ref([]); // 提醒时间
-const dateSelectionValue = dayjs(new Date()).format("YYYY-MM-DD").split("-");
+const dateSelectionValue = ref(dayjs(new Date()).format("YYYY-MM-DD").split("-"));
+const currentTime = ref(dayjs(new Date()).format("HH:mm").split(":"));
 const dateSelectionFiled = ref("");
 const addOrEdit = ref(true); // true 编辑,false 新增
+const addOrEditRow = ref({})
 
 function onSubmit() {
   addEditFormRef.value.validate().then((res) => {
     const data = addEditFormRef.value.getValues()
+    if(addOrEdit.value) {
+      data.planId = addOrEditRow.value.id
+    }
     submitLoading.value = true
-    requests.post(PLAN_TO_ADD_EDITORS, { ...data }).then(() => {
+    requests.post(PLAN_TO_ADD_EDITORS, { ...data }).then((res) => {
       toastSuccess("保存成功")
       setTimeout(() => {
         history.back();
       }, 2000)
     }).catch(err => {
-      toastFail(`保存失败:${err.message}`)
+      toastFail(`保存失败:${err.msg}`)
     }).finally(() => {
       submitLoading.value = false
     })
@@ -264,21 +280,29 @@ function remindSelectChange(value, label) {
 }
 
 function showPickerConfirm({ selectedValues }) {
-  form.value[dateSelectionFiled.value] = selectedValues.join("-");
+  form.value[dateSelectionFiled.value] = `${selectedValues.join("-")} ${currentTime.value.join(":")}`
   showPicker.value = false;
+  timeShowPicker.value = true;
+}
+
+function timeConfirm({ selectedValues }) {
+  form.value[dateSelectionFiled.value] = `${dateSelectionValue.value.join("-")} ${selectedValues.join(":")}`
+  timeShowPicker.value = false;
 }
 
 function showPickerClick(filed) {
-  (dateSelectionValue.value = form.value[filed]
-    ? form.value[filed]
-    : dayjs(new Date()).format("YYYY-MM-DD").split("-")),
-    (dateSelectionFiled.value = filed);
+  const dateTimeVal = form.value[filed] ? form.value[filed] : new Date()
+  dateSelectionValue.value = dayjs(dateTimeVal).format("YYYY-MM-DD").split("-")
+  currentTime.value = dayjs(dateTimeVal).format("HH:mm").split(":")
+  dateSelectionFiled.value = filed;
   showPicker.value = true;
 }
 
 function processingDataSource(data) {
   const row = JSON.parse(data.row);
   addOrEdit.value = Object.keys(row).length > 0 ? true : false;
+  addOrEditRow.value = row
+  form.value = row
   obtainThePurposeOfTheVisit();
   getReminderTime();
   getAllCustomers();

+ 38 - 16
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/visitorProgram/visitorDetails.vue

@@ -4,29 +4,29 @@
       <!-- 头部 -->
       <div class="planDetailsHead">
         <div class="w-full flex items-center justify-between">
-          <div class="text-size-in font-bold text-[#474A56]">535计划</div>
-          <div :class="`labelTag completed`">待完成</div>
+          <div class="text-size-in font-bold text-[#474A56]">{{ detailedData.planName }}</div>
+          <div :class="`labelTag ${detailedData.finishState == 0 ? 'toBeCompleted' : 'completed'}`">{{ ['未完成', '已完成'][detailedData.finishState] }}</div>
         </div>
-        <div class="w-full mt-4">拜访目的:建立客情</div>
-        <div class="w-full mt-4">拜访时间:2021-08-05 14:00</div>
+        <div class="w-full mt-4">拜访目的:{{ detailedData.visitGoalName }}</div>
+        <div class="w-full mt-4">拜访时间: {{ detailedData.visitTime }}</div>
         <div class="line"></div>
         <div class="w-full flex items-center">
           <van-icon name="user-circle-o" class="text-size-in mr-2" />
           客户:
-          <div class="ml-2 themeTextColor decoration-auto underline">苹果集团</div>
+          <div class="ml-2 themeTextColor decoration-auto underline">{{ detailedData.customName }}</div>
         </div>
       </div>
 
       <!-- 主体 -->
       <van-cell-group>
-        <van-cell title="计划名称" value="内容" />
-        <van-cell title="客户姓名" value="内容" />
-        <van-cell title="负责人" value="内容" />
-        <van-cell title="拜访目的" value="内容" />
-        <van-cell title="拜访时间" value="内容" />
-        <van-cell title="提醒" value="内容" />
-        <van-cell title="提醒时间" value="内容" />
-        <van-cell title="备注" value="内容" />
+        <van-cell title="计划名称" :value="detailedData.planName" />
+        <van-cell title="客户姓名" :value="detailedData.customName" />
+        <van-cell title="负责人" :value="detailedData.inchargerName" />
+        <van-cell title="拜访目的" :value="detailedData.visitGoalName" />
+        <van-cell title="拜访时间" :value="detailedData.visitTime" />
+        <van-cell title="提醒" :value="detailedData.remindTypeName" />
+        <van-cell title="提醒时间" :value="detailedData.remindTime" v-if="detailedData.remindType == -1" />
+        <van-cell title="备注" :value="detailedData.remark" />
       </van-cell-group>
       <div class="h-10"></div>
     </template>
@@ -54,10 +54,25 @@
 <script setup>
 import { ref } from "vue";
 import { useLifecycle } from "@hooks/useCommon.js";
+import useToast from "@hooks/useToast"
+import requests from "@common/requests";
+import useRouterStore from "@store/useRouterStore.js";
+import useFixedData from "@store/useFixedData.js";
+import PullDownSelector from "@components/common/pullDownSelector.vue";
+
+const router = useRouterStore();
+const detailedData = ref({});
+
+function processingDataSource(data) {
+  const row = JSON.parse(data.row);
+  detailedData.value = row || {}
+}
 
 useLifecycle({
   load: () => {
-    // 添加加载逻辑
+    router.on("visitorDetailsParameter", (data) => {
+      processingDataSource(data);
+    });
   },
 });
 </script>
@@ -94,9 +109,11 @@ useLifecycle({
     margin: 14px 0;
   }
 }
+
 .layout {
   height: 90px;
   position: relative;
+
   .layouts {
     width: 40%;
     height: 100%;
@@ -110,6 +127,7 @@ useLifecycle({
 
   .footerBtnLeft {
     border-top-right-radius: 25px;
+
     .imgClss {
       width: 30px;
       height: 30px;
@@ -117,8 +135,10 @@ useLifecycle({
       margin-bottom: 6px;
     }
   }
+
   .footerBtnRight {
     border-top-left-radius: 25px;
+
     .imgClss {
       width: 26px;
       height: 24px;
@@ -138,9 +158,10 @@ useLifecycle({
     z-index: 1;
   }
 
-  .bigCircle{
+  .bigCircle {
     width: 80px;
-    height: 80px;;
+    height: 80px;
+    ;
     border-radius: 50%;
     background: $themeColor;
     box-shadow: 0px -2px 30px 0px #00000014;
@@ -154,6 +175,7 @@ useLifecycle({
     align-items: center;
     justify-content: center;
     flex-direction: column;
+
     .imgClss {
       width: 25.5px;
       height: 25.5px;

+ 1 - 0
fhKeeper/formulahousekeeper/customerBuler-crm-h5/vite.config.js

@@ -6,6 +6,7 @@ import { VantResolver } from "unplugin-vue-components/resolvers";
 import { postcssConfig } from "./postcss.config.js";
 
 const target = 'http://192.168.2.7:10010';
+// const target = 'http://192.168.2.3:10010';
 // const target = 'http://192.168.2.17:10010';
 // const target = 'http://47.101.180.183:10010';