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