Lijy 4 місяців тому
батько
коміт
025001440d

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

@@ -6,7 +6,7 @@
         :show-title="false" :show-mark="false" :poppable="false" :show-confirm="false" :row-height="'3rem'"
         :min-date="minDate"
         :style="{ borderRadius: '0.3rem', height: expandAndCollapse ? (calendarHeight ? calendarHeight + 'px' : 'auto') : usePxToVwView(140) }"
-        :formatter="formatter" @select="calendarSelect">
+        :formatter="formatter" @select="calendarSelect" @panel-change="calendarPanelChangeSet">
         <template #month-title></template>
         <template #bottom-info="day">
           <div class="doT" v-if="day?.bottomInfo"></div>
@@ -42,7 +42,8 @@
                   <div class="w-2/3 text-[#505050]" style="width: 62%;">拜访时间: {{ item.visitTime }}</div>
                   <div class="w-1/3 text-[#505050] flex items-center" style="width: 38%;">
                     <van-icon name="phone-o" class="text-size-in mr-2" />
-                    {{ item.telPhone }}
+                    <!-- {{ item.telPhone }} -->
+                    {{ item?.companyPhone }}
                   </div>
                 </div>
               </div>
@@ -185,6 +186,11 @@ const commonExpressionsHaveBeenNodded = ref([])
 const areYouRequesting = ref(false)
 const displayFrequentlyUsedContacts = ref(false)
 
+function calendarPanelChangeSet(data) {
+  dateConditions.value = dayjs(data.date).format('YYYY-MM-DD')
+  getVisitorPlan()
+}
+
 function toContactDetails(item) {
   router.navigateTo({
     pathName: 'details',
@@ -266,7 +272,8 @@ function jumpToAddNewVisitors(row) {
     pathName: 'addEditorVisitor',
     success: () => {
       router.emit('addEditorVisitorParameter', {
-        row: JSON.stringify(row || {})
+        row: JSON.stringify(row || {}),
+        date: JSON.stringify(dateConditions.value || {})
       })
     }
   })

+ 7 - 2
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/visitorProgram/addEditorVisitor.vue

@@ -2,6 +2,9 @@
   <Page :title="`${addOrEdit ? '编辑' : '新增'}访客计划`">
     <template v-slot:body>
       <div class="w-full h-full flex flex-col">
+        <div class="bg-[#EAEAEA] py-4 px-5" v-if="headDate">
+          {{ headDate }}
+        </div>
         <van-form
           ref="addEditFormRef"
           show-error
@@ -98,7 +101,6 @@
             name="remindTime"
             label="提醒时间"
             placeholder="请选择"
-            :disabled="addOrEdit"
             :rules="[{ required: true, message: '' }]"
             @click="showPickerClick('remindTime')"
           >
@@ -230,6 +232,7 @@ const currentTime = ref(dayjs(new Date()).format("HH:mm").split(":"));
 const dateSelectionFiled = ref("");
 const addOrEdit = ref(true); // true 编辑,false 新增
 const addOrEditRow = ref({})
+const headDate = ref('')
 
 function onSubmit() {
   addEditFormRef.value.validate().then((res) => {
@@ -291,7 +294,7 @@ function timeConfirm({ selectedValues }) {
 }
 
 function showPickerClick(filed) {
-  const dateTimeVal = form.value[filed] ? form.value[filed] : new Date()
+  const dateTimeVal = form.value[filed] ? form.value[filed] : headDate.value ? new Date(headDate.value) : new Date()
   dateSelectionValue.value = dayjs(dateTimeVal).format("YYYY-MM-DD").split("-")
   currentTime.value = dayjs(dateTimeVal).format("HH:mm").split(":")
   dateSelectionFiled.value = filed;
@@ -301,8 +304,10 @@ function showPickerClick(filed) {
 function processingDataSource(data) {
   const row = JSON.parse(data.row);
   addOrEdit.value = Object.keys(row).length > 0 ? true : false;
+  headDate.value = JSON.parse(data.date)
   addOrEditRow.value = row
   form.value = row
+  addEditFormRef.value?.resetValidation()
   obtainThePurposeOfTheVisit();
   getReminderTime();
   getAllCustomers();

+ 45 - 9
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/visitorProgram/visitorDetails.vue

@@ -1,5 +1,8 @@
 <template>
   <Page title="访客计划详情">
+    <template v-slot:headerRight>
+      <div class="themeTextColor" v-if="detailedData.finishState == 0" @click="visitorEditor">编辑</div>
+    </template>
     <template v-slot:body>
       <!-- 头部 -->
       <div class="planDetailsHead">
@@ -14,7 +17,8 @@
         <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">{{ detailedData.customName }}</div>
+          <div class="ml-2 themeTextColor decoration-auto underline" @click="jumpToCustomerDetails()">{{
+            detailedData.customName }}</div>
         </div>
       </div>
 
@@ -71,19 +75,14 @@
         <van-date-picker v-model="showDatePickerVal" @confirm="showPickerConfirm" @cancel="showDatePicker = false" />
       </van-popup>
 
-      <van-popup
-        v-model:show="timeShowPicker"
-        destroy-on-close
-        position="bottom"
-        :style="{ height: '50%' }"
-      >
+      <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>
     </template>
 
     <template v-slot:footer v-if="detailedData.finishState == 0">
       <div class="w-full flex justify-between layout">
-        <div class="footerBtnLeft layouts" @click="showContacts = true">
+        <div class="footerBtnLeft layouts" @click="showContactsCli()">
           <div class="imgClss"></div>
           联系人
         </div>
@@ -105,11 +104,12 @@
 import { ref } from "vue";
 import { showConfirmDialog } from 'vant';
 import { useLifecycle } from "@hooks/useCommon.js";
-import { OBTAIN_DETAILS_OF_THE_VISIT_PLAN, POSTPONE_THE_VISIT_PLAN, COMPLETE_THE_VISIT_PLAN } from "@hooks/useApi"
+import { OBTAIN_DETAILS_OF_THE_VISIT_PLAN, POSTPONE_THE_VISIT_PLAN, COMPLETE_THE_VISIT_PLAN, OBTAIN_CUSTOMER_DETAILS } from "@hooks/useApi"
 import useToast from "@hooks/useToast"
 import requests from "@common/requests";
 import useRouterStore from "@store/useRouterStore.js";
 import dayjs from "dayjs";
+import { routingInfos } from "@utility/generalVariables.js";
 import useFixedData from "@store/useFixedData.js";
 import PullDownSelector from "@components/common/pullDownSelector.vue";
 
@@ -125,6 +125,41 @@ const showDelayData = ref('')
 const currentTime = ref('')
 const contactList = ref([]);
 
+function visitorEditor() {
+  router.navigateTo({
+    pathName: 'addEditorVisitor',
+    success: () => {
+      router.emit('addEditorVisitorParameter', {
+        row: JSON.stringify(detailedData.value || {}),
+        date: JSON.stringify(detailedData.value.visitTime || {})
+      })
+    }
+  })
+}
+
+function jumpToCustomerDetails() {
+  const routerInfo = routingInfos['customer']
+  requests.post(OBTAIN_CUSTOMER_DETAILS, { id: detailedData.value.customId }).then(res => {
+    router.navigateTo({
+      pathName: 'details',
+      success: () => {
+        router.emit('detailParameter', {
+          routerInfo: JSON.stringify(routerInfo || {}),
+          parameter: JSON.stringify(res.data || {})
+        })
+      }
+    })
+  })
+}
+
+function showContactsCli() {
+  if(!((contactList.value || []).length)) {
+    toastText('该联系人无号码')
+    return
+  }
+  showContacts.value = true
+}
+
 function completeThePlan() {
   showConfirmDialog({
     title: `完成访客计划`,
@@ -141,6 +176,7 @@ function delayTimeEvent() {
   requests.post(POSTPONE_THE_VISIT_PLAN, { planId: detailedData.value.id, visitTime: showDelayData.value }).then(() => {
     toastSuccess(`操作成功`)
     getDetailData(detailedData.value)
+    showDelay.value = false
   })
 }