Parcourir la source

feat: KAM Mapping功能超出隐藏

Jack Zhou il y a 1 mois
Parent
commit
9c342fdf22

+ 15 - 7
src/views/DestinationDelivery/src/components/CalendarView.vue

@@ -4,7 +4,7 @@ import type { Dayjs } from 'dayjs'
 import dayjs from 'dayjs'
 import CalendarTagDetailDialog from './CalendarTagDetailDialog.vue'
 import { useUserStore } from '@/stores/modules/user'
-import { cloneDeep, debounce } from 'lodash'
+import { debounce } from 'lodash'
 import axios from 'axios'
 
 const userStore = useUserStore()
@@ -31,7 +31,9 @@ const consignessList = ref([])
 const getDataByDate = (date: Dayjs, key: string) => {
   return calendarData.value?.[date.format('YYYY-MM-DD')]?.[key] ?? 0
 }
-
+const clearConsigneeList = () => {
+  consignessList.value = []
+}
 const remoteMethod = (query: string) => {
   currentController.value?.abort()
 
@@ -69,6 +71,7 @@ const remoteMethod = (query: string) => {
 const debouncedRemoteMethod = debounce(remoteMethod, 200)
 const handleVisibleChange = (visible) => {
   !visible && (consignessList.value = [])
+  getPageData()
 }
 
 const currentController = ref<AbortController | null>(null)
@@ -82,7 +85,10 @@ const handleAddClick = (date) => {
 const getPageData = () => {
   calendarLoading.value = true
   $api
-    .getDeliveryCalendarData({ month: displayMonth.value.format('MM/YYYY') })
+    .getDeliveryCalendarData({
+      month: displayMonth.value.format('MM/YYYY'),
+      consignee: consigneeValue.value
+    })
     .then((res) => {
       if (res.code === 200) {
         calendarData.value = res.data
@@ -210,16 +216,17 @@ const test = () => {
           <div class="grid-lines"></div>
 
           <el-select
-            :model-value="consigneeValue"
-            multiple
+            v-model="consigneeValue"
             filterable
             reserve-keyword
+            clearable
             placeholder="Consignee"
             :loading="consigneeLoading"
             style="width: 240px"
             popper-class="part-id-select-popper"
             :filter-method="debouncedRemoteMethod"
-            @visible-change="handleVisibleChange"
+            @change="handleVisibleChange"
+            @blur="clearConsigneeList"
           >
             <el-option
               v-for="item in consignessList"
@@ -292,7 +299,7 @@ const test = () => {
           <div
             class="add-icon"
             @click.stop="handleAddClick(current)"
-            v-if="userStore.userInfo.user_type.toLowerCase() !== 'employee'"
+            v-if="userStore.userInfo.user_type?.toLowerCase() !== 'employee'"
           >
             <span class="font_family icon-icon_add_b"></span>
           </div>
@@ -314,6 +321,7 @@ const test = () => {
   justify-content: flex-end;
   align-items: center;
   padding: 2px 0;
+  padding-right: 1px;
   :deep(.ant-select-selection-item) {
     margin-right: 4px;
     font-size: 24px;

+ 1 - 0
src/views/Layout/src/components/Header/components/KAMMapping.vue

@@ -235,6 +235,7 @@ watch(
 }
 .select-customer-list {
   height: 160px;
+  overflow: auto;
   .customer-item {
     height: 40px;
     padding: 0 8px;