|
@@ -22,8 +22,8 @@
|
|
|
<i class="mdi mdi-cart"></i>
|
|
<i class="mdi mdi-cart"></i>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="stat-info">
|
|
<div class="stat-info">
|
|
|
- <h3>{{ recentOrdersCount }}</h3>
|
|
|
|
|
- <p>최근 주문 (7일)</p>
|
|
|
|
|
|
|
+ <h3>{{ recentOrdersTotal }}</h3>
|
|
|
|
|
+ <p>신규 주문</p>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="stat-card">
|
|
<div class="stat-card">
|
|
@@ -35,7 +35,7 @@
|
|
|
<p>진행중인 공동구매</p>
|
|
<p>진행중인 공동구매</p>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="stat-card">
|
|
|
|
|
|
|
+ <!-- <div class="stat-card">
|
|
|
<div class="stat-icon sales">
|
|
<div class="stat-icon sales">
|
|
|
<i class="mdi mdi-trending-up"></i>
|
|
<i class="mdi mdi-trending-up"></i>
|
|
|
</div>
|
|
</div>
|
|
@@ -43,7 +43,7 @@
|
|
|
<h3>{{ totalSalesCount }}</h3>
|
|
<h3>{{ totalSalesCount }}</h3>
|
|
|
<p>총 주문 건수</p>
|
|
<p>총 주문 건수</p>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div> -->
|
|
|
<div class="stat-card">
|
|
<div class="stat-card">
|
|
|
<div class="stat-icon influencers">
|
|
<div class="stat-icon influencers">
|
|
|
<i class="mdi mdi-account-group"></i>
|
|
<i class="mdi mdi-account-group"></i>
|
|
@@ -62,7 +62,7 @@
|
|
|
<!-- 최근 주문 현황 카드 -->
|
|
<!-- 최근 주문 현황 카드 -->
|
|
|
<div class="dashboard-card recent-orders">
|
|
<div class="dashboard-card recent-orders">
|
|
|
<div class="card-header">
|
|
<div class="card-header">
|
|
|
- <h3>최근 들어온 주문</h3>
|
|
|
|
|
|
|
+ <h3>신규 주문 <span class="limit-badge">*최근 10건까지</span></h3>
|
|
|
<i class="mdi mdi-cart-outline"></i>
|
|
<i class="mdi mdi-cart-outline"></i>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="card-content">
|
|
<div class="card-content">
|
|
@@ -71,23 +71,25 @@
|
|
|
<div
|
|
<div
|
|
|
v-for="order in recentOrders"
|
|
v-for="order in recentOrders"
|
|
|
:key="order.SEQ"
|
|
:key="order.SEQ"
|
|
|
- class="order-item"
|
|
|
|
|
|
|
+ class="order-item recent-order"
|
|
|
@click="goToOrderDetail(order.ITEM_SEQ)"
|
|
@click="goToOrderDetail(order.ITEM_SEQ)"
|
|
|
>
|
|
>
|
|
|
- <div class="order-info">
|
|
|
|
|
- <h4>{{ order.ORDER_NUMB }}</h4>
|
|
|
|
|
- <p class="buyer-name">{{ order.BUYER_NAME }}</p>
|
|
|
|
|
- <p class="order-date">{{ formatDateTime(order.REGDATE) }}</p>
|
|
|
|
|
|
|
+ <div class="order-icon">
|
|
|
|
|
+ 🛒
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="order-details">
|
|
|
|
|
- <span class="quantity">{{ order.QTY }}개</span>
|
|
|
|
|
- <span class="status-badge active">신규</span>
|
|
|
|
|
|
|
+ <div class="item-info">
|
|
|
|
|
+ <h4>{{ order.ITEM_NAME }}</h4>
|
|
|
|
|
+ <div class="order-meta">
|
|
|
|
|
+ <span class="order-number">#{{ order.ORDER_NUMB }}</span>
|
|
|
|
|
+ <span class="influencer-name">{{ order.INF_NICK_NAME || order.INF_NAME }}</span>
|
|
|
|
|
+ <div class="order-date">{{ formatDateTime(order.UPDATE_DATE) }}</div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div v-else class="no-orders">
|
|
<div v-else class="no-orders">
|
|
|
<i class="mdi mdi-cart-off"></i>
|
|
<i class="mdi mdi-cart-off"></i>
|
|
|
- <p>최근 주문이 없습니다</p>
|
|
|
|
|
|
|
+ <p>신규 주문이 없습니다</p>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="view-all">
|
|
<div class="view-all">
|
|
@@ -99,7 +101,7 @@
|
|
|
<!-- 진행중인 공동구매 카드 -->
|
|
<!-- 진행중인 공동구매 카드 -->
|
|
|
<div class="dashboard-card active-items">
|
|
<div class="dashboard-card active-items">
|
|
|
<div class="card-header">
|
|
<div class="card-header">
|
|
|
- <h3>진행중인 공동구매</h3>
|
|
|
|
|
|
|
+ <h3>진행중인 공동구매<span class="limit-badge">*최근 5건까지</span></h3>
|
|
|
<i class="mdi mdi-package-variant-closed"></i>
|
|
<i class="mdi mdi-package-variant-closed"></i>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="card-content">
|
|
<div class="card-content">
|
|
@@ -108,19 +110,18 @@
|
|
|
<div
|
|
<div
|
|
|
v-for="item in activeItems"
|
|
v-for="item in activeItems"
|
|
|
:key="item.SEQ"
|
|
:key="item.SEQ"
|
|
|
- class="item-card"
|
|
|
|
|
|
|
+ class="item-card active-item"
|
|
|
@click="goToItemDetail(item.SEQ)"
|
|
@click="goToItemDetail(item.SEQ)"
|
|
|
>
|
|
>
|
|
|
|
|
+ <div class="item-header">
|
|
|
|
|
+ <div class="item-icon">📦</div>
|
|
|
|
|
+ </div>
|
|
|
<div class="item-info">
|
|
<div class="item-info">
|
|
|
<h4>{{ item.NAME }}</h4>
|
|
<h4>{{ item.NAME }}</h4>
|
|
|
- <p class="company-name">{{ item.COMPANY_NAME }}</p>
|
|
|
|
|
- <div class="item-dates">
|
|
|
|
|
- <span class="end-date">기간: {{ formatDate(item.ORDER_START_DATE) }} ~ {{ formatDate(item.ORDER_END_DATE) }}</span>
|
|
|
|
|
|
|
+ <div class="item-stats">
|
|
|
|
|
+ <span class="order-count">{{ formatDate(item.ORDER_START_DATE) }} ~ {{ formatDate(item.ORDER_END_DATE) }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="item-stats">
|
|
|
|
|
- <div class="order-count">주문: {{ item.ORDER_COUNT || 0 }}건</div>
|
|
|
|
|
- </div>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div v-else class="no-items">
|
|
<div v-else class="no-items">
|
|
@@ -137,115 +138,46 @@
|
|
|
<!-- 인플루언서별 판매 통계 카드 -->
|
|
<!-- 인플루언서별 판매 통계 카드 -->
|
|
|
<div class="dashboard-card influencer-stats">
|
|
<div class="dashboard-card influencer-stats">
|
|
|
<div class="card-header">
|
|
<div class="card-header">
|
|
|
- <h3>인플루언서별 주문 건수</h3>
|
|
|
|
|
|
|
+ <h3>인플루언서별 주문 건수<span class="limit-badge">*상위 6명까지</span></h3>
|
|
|
<i class="mdi mdi-account-star"></i>
|
|
<i class="mdi mdi-account-star"></i>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="card-content">
|
|
<div class="card-content">
|
|
|
<div class="influencer-list">
|
|
<div class="influencer-list">
|
|
|
- <div v-if="influencerStats.length > 0">
|
|
|
|
|
|
|
+ <div v-if="influencerStats.length > 0" class="influencer-cards">
|
|
|
<div
|
|
<div
|
|
|
v-for="(stat, index) in influencerStats"
|
|
v-for="(stat, index) in influencerStats"
|
|
|
:key="stat.INF_SEQ"
|
|
:key="stat.INF_SEQ"
|
|
|
- class="influencer-item"
|
|
|
|
|
|
|
+ class="influencer-card"
|
|
|
>
|
|
>
|
|
|
- <div class="rank">{{ index + 1 }}</div>
|
|
|
|
|
|
|
+ <div class="rank-badge">{{ index + 1 }}</div>
|
|
|
|
|
+ <div class="user-avatar">
|
|
|
|
|
+ 🤝
|
|
|
|
|
+ </div>
|
|
|
<div class="influencer-info">
|
|
<div class="influencer-info">
|
|
|
<h4>{{ stat.INF_NAME || '인플루언서' + stat.INF_SEQ }}</h4>
|
|
<h4>{{ stat.INF_NAME || '인플루언서' + stat.INF_SEQ }}</h4>
|
|
|
- <p>{{ stat.ORDER_COUNT }}건의 주문</p>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="order-count-badge">
|
|
|
|
|
- {{ stat.ORDER_COUNT }}
|
|
|
|
|
|
|
+ <div class="order-count white">
|
|
|
|
|
+ <span class="count">{{ stat.ORDER_COUNT }}</span>
|
|
|
|
|
+ <span class="label">건</span>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div v-else class="no-stats">
|
|
<div v-else class="no-stats">
|
|
|
<i class="mdi mdi-chart-line"></i>
|
|
<i class="mdi mdi-chart-line"></i>
|
|
|
- <p>통계 데이터가 없습니다</p>
|
|
|
|
|
|
|
+ <p>인플루언서 정보가 없습니다.</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="view-all">
|
|
|
|
|
+ <v-btn variant="text" class="custom-btn btn-white" @click="showComingSoon()">전체 보기</v-btn>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- <!-- 문의 등록 팝업 -->
|
|
|
|
|
- <v-dialog v-model="showInquiryModal" max-width="600px" persistent>
|
|
|
|
|
- <v-card class="inquiry-modal">
|
|
|
|
|
- <v-card-title class="modal-header">
|
|
|
|
|
- <h3>문의 등록</h3>
|
|
|
|
|
- <v-btn icon @click="closeModal" class="close-btn">
|
|
|
|
|
- <v-icon>mdi-close</v-icon>
|
|
|
|
|
- </v-btn>
|
|
|
|
|
- </v-card-title>
|
|
|
|
|
-
|
|
|
|
|
- <v-card-text class="modal-body">
|
|
|
|
|
- <form @submit.prevent="submitInquiry">
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label>문의 유형 <span class="required">*</span></label>
|
|
|
|
|
- <v-select
|
|
|
|
|
- v-model="inquiryForm.category"
|
|
|
|
|
- :items="categoryOptions"
|
|
|
|
|
- variant="outlined"
|
|
|
|
|
- placeholder="문의 유형을 선택하세요"
|
|
|
|
|
- class="custom-select"
|
|
|
|
|
- :rules="[v => !!v || '문의 유형을 선택해주세요']"
|
|
|
|
|
- ></v-select>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label>제목 <span class="required">*</span></label>
|
|
|
|
|
- <v-text-field
|
|
|
|
|
- v-model="inquiryForm.title"
|
|
|
|
|
- variant="outlined"
|
|
|
|
|
- placeholder="문의 제목을 입력하세요"
|
|
|
|
|
- class="custom-input"
|
|
|
|
|
- :rules="[v => !!v || '제목을 입력해주세요']"
|
|
|
|
|
- ></v-text-field>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label>내용 <span class="required">*</span></label>
|
|
|
|
|
- <v-textarea
|
|
|
|
|
- v-model="inquiryForm.content"
|
|
|
|
|
- variant="outlined"
|
|
|
|
|
- placeholder="문의 내용을 상세히 입력해주세요"
|
|
|
|
|
- rows="6"
|
|
|
|
|
- class="custom-textarea"
|
|
|
|
|
- :rules="[v => !!v || '내용을 입력해주세요']"
|
|
|
|
|
- ></v-textarea>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label>첨부파일</label>
|
|
|
|
|
- <v-file-input
|
|
|
|
|
- v-model="inquiryForm.attachments"
|
|
|
|
|
- variant="outlined"
|
|
|
|
|
- placeholder="파일을 선택하세요"
|
|
|
|
|
- hide-details=""
|
|
|
|
|
- prepend-icon=""
|
|
|
|
|
- append-inner-icon="mdi-paperclip"
|
|
|
|
|
- class="custom-file-input mb--30"
|
|
|
|
|
- accept="image/*,.pdf,.doc,.docx,.hwp"
|
|
|
|
|
- multiple
|
|
|
|
|
- show-size
|
|
|
|
|
- ></v-file-input>
|
|
|
|
|
- <p class="file-info">* 이미지, PDF, 문서 파일만 업로드 가능 (최대 10MB)</p>
|
|
|
|
|
- </div>
|
|
|
|
|
- </form>
|
|
|
|
|
- </v-card-text>
|
|
|
|
|
-
|
|
|
|
|
- <v-card-actions class="modal-footer">
|
|
|
|
|
- <v-btn @click="closeModal" class="cancel-btn">취소</v-btn>
|
|
|
|
|
- <v-btn @click="submitInquiry" class="submit-btn" :loading="isSubmitting">등록하기</v-btn>
|
|
|
|
|
- </v-card-actions>
|
|
|
|
|
- </v-card>
|
|
|
|
|
- </v-dialog>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import "@vuepic/vue-datepicker/dist/main.css";
|
|
|
|
|
-import dayjs from 'dayjs';
|
|
|
|
|
/************************************************************************
|
|
/************************************************************************
|
|
|
| 레이아웃
|
|
| 레이아웃
|
|
|
************************************************************************/
|
|
************************************************************************/
|
|
@@ -270,32 +202,12 @@ import dayjs from 'dayjs';
|
|
|
| 전역
|
|
| 전역
|
|
|
************************************************************************/
|
|
************************************************************************/
|
|
|
const memberType = useAtStore.auth.memberType;
|
|
const memberType = useAtStore.auth.memberType;
|
|
|
- const searchModel = ref("");
|
|
|
|
|
- const selectedRange = ref('all');
|
|
|
|
|
- const searchStartDate = ref("");
|
|
|
|
|
- const searchEndDate = ref("");
|
|
|
|
|
- const dateOptions = [
|
|
|
|
|
- { label: '오늘', value: 'today' },
|
|
|
|
|
- { label: '7일', value: '7d' },
|
|
|
|
|
- { label: '1개월', value: '1m' },
|
|
|
|
|
- { label: '3개월', value: '3m' },
|
|
|
|
|
- { label: '전체', value: 'all' },
|
|
|
|
|
- ]
|
|
|
|
|
- const datePickerFormat = "yyyy-MM-dd";
|
|
|
|
|
- const filter = ref("");
|
|
|
|
|
- const filderArr = ref([
|
|
|
|
|
- { title: "전체", value: "" },
|
|
|
|
|
- { title: "제목", value: "title" },
|
|
|
|
|
- { title: "내용", value: "content" },
|
|
|
|
|
- { title: "작성자", value: "writer" }
|
|
|
|
|
- ]);
|
|
|
|
|
const { $toast, $log, $dayjs, $eventBus } = useNuxtApp();
|
|
const { $toast, $log, $dayjs, $eventBus } = useNuxtApp();
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
- const pageId = computed(() => {
|
|
|
|
|
- return '대시보드';
|
|
|
|
|
- });
|
|
|
|
|
- const csList = ref([]);
|
|
|
|
|
|
|
+ const activeItemsCount = ref(0);
|
|
|
|
|
+ const activeInfluencersCount = ref(0);
|
|
|
const recentOrders = ref([]);
|
|
const recentOrders = ref([]);
|
|
|
|
|
+ const recentOrdersTotal = ref(0);
|
|
|
const activeItems = ref([]);
|
|
const activeItems = ref([]);
|
|
|
const influencerStats = ref([]);
|
|
const influencerStats = ref([]);
|
|
|
|
|
|
|
@@ -303,32 +215,12 @@ import dayjs from 'dayjs';
|
|
|
const completedInquiries = computed(() => {
|
|
const completedInquiries = computed(() => {
|
|
|
return csList.value.filter(item => item.STATUS === '1').length;
|
|
return csList.value.filter(item => item.STATUS === '1').length;
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
- const recentInquiries = computed(() => {
|
|
|
|
|
- return csList.value.slice(0, 3);
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- // 새로운 대시보드 통계
|
|
|
|
|
- const recentOrdersCount = computed(() => {
|
|
|
|
|
- const weekAgo = new Date();
|
|
|
|
|
- weekAgo.setDate(weekAgo.getDate() - 7);
|
|
|
|
|
- return recentOrders.value.filter(order =>
|
|
|
|
|
- new Date(order.REGDATE) >= weekAgo
|
|
|
|
|
- ).length;
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- const activeItemsCount = computed(() => {
|
|
|
|
|
- return activeItems.value.length;
|
|
|
|
|
- });
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
const totalSalesCount = computed(() => {
|
|
const totalSalesCount = computed(() => {
|
|
|
return recentOrders.value.length;
|
|
return recentOrders.value.length;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- const activeInfluencersCount = computed(() => {
|
|
|
|
|
- return influencerStats.value.filter(stat => stat.ORDER_COUNT > 0).length;
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
// 문의 등록 팝업 관련
|
|
// 문의 등록 팝업 관련
|
|
|
const showInquiryModal = ref(false);
|
|
const showInquiryModal = ref(false);
|
|
|
const isSubmitting = ref(false);
|
|
const isSubmitting = ref(false);
|
|
@@ -357,11 +249,12 @@ import dayjs from 'dayjs';
|
|
|
COMPANY_NUMBER: useAtStore.auth.companyNumber,
|
|
COMPANY_NUMBER: useAtStore.auth.companyNumber,
|
|
|
MEMBER_TYPE: useAtStore.auth.memberType,
|
|
MEMBER_TYPE: useAtStore.auth.memberType,
|
|
|
MEMBER_SEQ: useAtStore.auth.seq,
|
|
MEMBER_SEQ: useAtStore.auth.seq,
|
|
|
- LIMIT: 5
|
|
|
|
|
|
|
+ LIMIT: 10,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const response = await useAxios().post('/dashboard/recentOrders', _req);
|
|
const response = await useAxios().post('/dashboard/recentOrders', _req);
|
|
|
- recentOrders.value = response.data;
|
|
|
|
|
|
|
+ recentOrders.value = response.data.data || response.data; // 하위호환성
|
|
|
|
|
+ recentOrdersTotal.value = response.data.total || 0;
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('최근 주문 로드 실패:', error);
|
|
console.error('최근 주문 로드 실패:', error);
|
|
|
}
|
|
}
|
|
@@ -377,12 +270,11 @@ import dayjs from 'dayjs';
|
|
|
MEMBER_SEQ: useAtStore.auth.seq,
|
|
MEMBER_SEQ: useAtStore.auth.seq,
|
|
|
STATUS: 0,
|
|
STATUS: 0,
|
|
|
COMPANY_NUMBER: useAtStore.auth.companyNumber,
|
|
COMPANY_NUMBER: useAtStore.auth.companyNumber,
|
|
|
- COUNT: 5,
|
|
|
|
|
|
|
+ LIMIT: 5,
|
|
|
};
|
|
};
|
|
|
- console.warn(_req)
|
|
|
|
|
- const response = await useAxios().post('/item/list', _req);
|
|
|
|
|
- console.error(response)
|
|
|
|
|
- activeItems.value = response.data;
|
|
|
|
|
|
|
+ const response = await useAxios().post('/dashboard/activeItems', _req);
|
|
|
|
|
+ activeItems.value = response.data.data || response.data; // 하위호환성
|
|
|
|
|
+ activeItemsCount.value = response.data.total || activeItems.value.length;
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('진행중인 공동구매 로드 실패:', error);
|
|
console.error('진행중인 공동구매 로드 실패:', error);
|
|
|
}
|
|
}
|
|
@@ -394,13 +286,14 @@ import dayjs from 'dayjs';
|
|
|
COMPANY_NUMBER: useAtStore.auth.companyNumber,
|
|
COMPANY_NUMBER: useAtStore.auth.companyNumber,
|
|
|
MEMBER_TYPE: useAtStore.auth.memberType,
|
|
MEMBER_TYPE: useAtStore.auth.memberType,
|
|
|
MEMBER_SEQ: useAtStore.auth.seq,
|
|
MEMBER_SEQ: useAtStore.auth.seq,
|
|
|
- LIMIT: 5
|
|
|
|
|
|
|
+ LIMIT: 6,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const response = await useAxios().post('/dashboard/influencerStats', _req);
|
|
const response = await useAxios().post('/dashboard/influencerStats', _req);
|
|
|
- influencerStats.value = response.data;
|
|
|
|
|
|
|
+ influencerStats.value = response.data.data || response.data; // 하위호환성
|
|
|
|
|
+ activeInfluencersCount.value = response.data.total || 0;
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- console.error('인플루언서 통계 로드 실패:', error);
|
|
|
|
|
|
|
+ //console.error('인플루언서 통계 로드 실패:', error);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -409,62 +302,8 @@ import dayjs from 'dayjs';
|
|
|
loadRecentOrders(),
|
|
loadRecentOrders(),
|
|
|
loadActiveItems(),
|
|
loadActiveItems(),
|
|
|
loadInfluencerStats(),
|
|
loadInfluencerStats(),
|
|
|
- csListGet()
|
|
|
|
|
]);
|
|
]);
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
- const isRecentUpdate = (dateStr) => {
|
|
|
|
|
- const today = new Date();
|
|
|
|
|
- const updateDate = new Date(dateStr);
|
|
|
|
|
- const diffDays = (today - updateDate) / (1000 * 60 * 60 * 24);
|
|
|
|
|
- // 업데이트 날짜가 오늘 날짜 기준 최근 7일인지 확인
|
|
|
|
|
- return diffDays <= 7;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const paginatedItems = computed(() => {
|
|
|
|
|
- const start = (currentPage.value - 1) * itemsPerPage;
|
|
|
|
|
- return csList.value.slice(start, start + itemsPerPage);
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- const setDateRange = (range) => {
|
|
|
|
|
- const today = dayjs();
|
|
|
|
|
-
|
|
|
|
|
- switch(range) {
|
|
|
|
|
- case 'today' :
|
|
|
|
|
- searchStartDate.value = today.format('YYYY-MM-DD');
|
|
|
|
|
- searchEndDate.value = today.format('YYYY-MM-DD');
|
|
|
|
|
- selectedRange.value = 'today';
|
|
|
|
|
- break;
|
|
|
|
|
- case '7d':
|
|
|
|
|
- searchStartDate.value = today.subtract(7, 'day').format('YYYY-MM-DD');
|
|
|
|
|
- searchEndDate.value = today.format('YYYY-MM-DD');
|
|
|
|
|
- selectedRange.value = '7d';
|
|
|
|
|
- break;
|
|
|
|
|
- case '1m':
|
|
|
|
|
- searchStartDate.value = today.subtract(1, 'month').format('YYYY-MM-DD');
|
|
|
|
|
- searchEndDate.value = today.format('YYYY-MM-DD');
|
|
|
|
|
- selectedRange.value = '1m';
|
|
|
|
|
- break;
|
|
|
|
|
- case '3m':
|
|
|
|
|
- searchStartDate.value = today.subtract(3, 'month').format('YYYY-MM-DD');
|
|
|
|
|
- searchEndDate.value = today.format('YYYY-MM-DD');
|
|
|
|
|
- selectedRange.value = '3m';
|
|
|
|
|
- break;
|
|
|
|
|
- case 'all':
|
|
|
|
|
- searchStartDate.value = "";
|
|
|
|
|
- searchEndDate.value = today.format('YYYY-MM-DD');
|
|
|
|
|
- selectedRange.value = 'all';
|
|
|
|
|
- break
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const addLocated = () => {
|
|
|
|
|
- showInquiryModal.value = true;
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- const goToCS = () => {
|
|
|
|
|
- router.push('/view/common/cs');
|
|
|
|
|
- };
|
|
|
|
|
|
|
|
|
|
const goToItems = () => {
|
|
const goToItems = () => {
|
|
|
router.push('/view/common/item');
|
|
router.push('/view/common/item');
|
|
@@ -490,90 +329,6 @@ import dayjs from 'dayjs';
|
|
|
query: { itemId: itemSeq }
|
|
query: { itemId: itemSeq }
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
- const goToProfile = () => {
|
|
|
|
|
- $toast.info('프로필 수정 기능은 준비중입니다.');
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- const toItemDetail = (__EVENT) => {
|
|
|
|
|
- router.push({
|
|
|
|
|
- path: "/view/common/cs/detail",
|
|
|
|
|
- });
|
|
|
|
|
- useDtStore.boardInfo.seq = __EVENT;
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- const csListGet = async () => {
|
|
|
|
|
- let _req = {
|
|
|
|
|
- USER_SEQ : useAtStore.auth.seq,
|
|
|
|
|
- keyword: '',
|
|
|
|
|
- filter: '',
|
|
|
|
|
- startDate: '',
|
|
|
|
|
- endDate: ''
|
|
|
|
|
- };
|
|
|
|
|
- if(useAtStore.auth.seq == 2){
|
|
|
|
|
- _req.USER_SEQ = 0;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- await useAxios()
|
|
|
|
|
- .post("/cs/list", _req)
|
|
|
|
|
- .then((res) => {
|
|
|
|
|
- csList.value = res.data;
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- const fnSearch = (__KEYWORD, __FILTER) => {
|
|
|
|
|
- let _req = {
|
|
|
|
|
- USER_SEQ: useAtStore.auth.seq,
|
|
|
|
|
- filter: __FILTER,
|
|
|
|
|
- keyword: __KEYWORD,
|
|
|
|
|
- startDate: searchStartDate.value ? dayjs(searchStartDate.value).format('YYYY-MM-DD') : '',
|
|
|
|
|
- endDate: searchEndDate.value ? dayjs(searchEndDate.value).format('YYYY-MM-DD') : ''
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- // 관리자인 경우 모든 문의 조회
|
|
|
|
|
- if(useAtStore.auth.seq == 2){
|
|
|
|
|
- _req.USER_SEQ = 0;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- useAxios()
|
|
|
|
|
- .post("/cs/search", _req)
|
|
|
|
|
- .then((res) => {
|
|
|
|
|
- csList.value = res.data;
|
|
|
|
|
- currentPage.value = 1; // 검색 후 첫 페이지로 이동
|
|
|
|
|
- })
|
|
|
|
|
- .catch((error) => {
|
|
|
|
|
- console.error('검색 실패:', error);
|
|
|
|
|
- $toast.error('검색에 실패했습니다.');
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- const goToDeliveryDetail = (item) => {
|
|
|
|
|
- // 제품 정보를 스토어에 저장
|
|
|
|
|
- useDtStore.boardInfo.seq = item.SEQ;
|
|
|
|
|
- useDtStore.boardInfo.pageType = "D";
|
|
|
|
|
-
|
|
|
|
|
- // 배송 관리 페이지로 이동
|
|
|
|
|
- router.push({
|
|
|
|
|
- path: "/view/common/deli/detail",
|
|
|
|
|
- query: {
|
|
|
|
|
- itemId: item.SEQ,
|
|
|
|
|
- itemName: item.NAME,
|
|
|
|
|
- price1: item.PRICE1,
|
|
|
|
|
- price2: item.PRICE2 || item.PRICE1,
|
|
|
|
|
- thumbFile: item.THUMB_FILE || ''
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- const getStatusClass = (status) => {
|
|
|
|
|
- switch(status) {
|
|
|
|
|
- case '0':
|
|
|
|
|
- return 'status-waiting';
|
|
|
|
|
- case '1':
|
|
|
|
|
- return 'status-completed';
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
|
|
|
|
|
const formatDate = (dateStr) => {
|
|
const formatDate = (dateStr) => {
|
|
|
if (!dateStr) return '';
|
|
if (!dateStr) return '';
|
|
@@ -594,82 +349,16 @@ import dayjs from 'dayjs';
|
|
|
return `${month}.${day} ${hours}:${minutes}`;
|
|
return `${month}.${day} ${hours}:${minutes}`;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const getDaysRemaining = (endDate) => {
|
|
|
|
|
- if (!endDate) return 0;
|
|
|
|
|
- const end = new Date(endDate);
|
|
|
|
|
- const now = new Date();
|
|
|
|
|
- const diffTime = end - now;
|
|
|
|
|
- const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
|
|
|
|
- return Math.max(0, diffDays);
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- // 팝업 관련 함수들
|
|
|
|
|
- const closeModal = () => {
|
|
|
|
|
- showInquiryModal.value = false;
|
|
|
|
|
- resetForm();
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- const resetForm = () => {
|
|
|
|
|
- inquiryForm.value = {
|
|
|
|
|
- category: '',
|
|
|
|
|
- title: '',
|
|
|
|
|
- content: '',
|
|
|
|
|
- attachments: []
|
|
|
|
|
- };
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- const submitInquiry = async () => {
|
|
|
|
|
- // 폼 유효성 검사
|
|
|
|
|
- if (!inquiryForm.value.category) {
|
|
|
|
|
- $toast.error('문의 유형을 선택해주세요.');
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- if (!inquiryForm.value.title) {
|
|
|
|
|
- $toast.error('제목을 입력해주세요.');
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- if (!inquiryForm.value.content) {
|
|
|
|
|
- $toast.error('내용을 입력해주세요.');
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- isSubmitting.value = true;
|
|
|
|
|
-
|
|
|
|
|
- try {
|
|
|
|
|
- const formData = new FormData();
|
|
|
|
|
- formData.append('USER_SEQ', useAtStore.auth.seq);
|
|
|
|
|
- formData.append('CATEGORY', inquiryForm.value.category);
|
|
|
|
|
- formData.append('TITLE', inquiryForm.value.title);
|
|
|
|
|
- formData.append('CONTENT', inquiryForm.value.content);
|
|
|
|
|
-
|
|
|
|
|
- // 첨부파일 처리
|
|
|
|
|
- if (inquiryForm.value.attachments && inquiryForm.value.attachments.length > 0) {
|
|
|
|
|
- inquiryForm.value.attachments.forEach((file, index) => {
|
|
|
|
|
- formData.append(`files[${index}]`, file);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ const showComingSoon = () => {
|
|
|
|
|
+ $eventBus.emit('OPEN_CONFIRM_POP_UP', {
|
|
|
|
|
+ id: 'coming-soon',
|
|
|
|
|
+ title: '안내',
|
|
|
|
|
+ content: '준비중입니다.',
|
|
|
|
|
+ yes: {
|
|
|
|
|
+ text: '확인',
|
|
|
|
|
+ isProc: false
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- await useAxios()
|
|
|
|
|
- .post("/cs/reg", formData, {
|
|
|
|
|
- headers: {
|
|
|
|
|
- 'Content-Type': 'multipart/form-data'
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- .then((res) => {
|
|
|
|
|
- if (res.data.success) {
|
|
|
|
|
- $toast.success('문의가 성공적으로 등록되었습니다.');
|
|
|
|
|
- closeModal();
|
|
|
|
|
- csListGet(); // 목록 새로고침
|
|
|
|
|
- } else {
|
|
|
|
|
- $toast.error('문의 등록에 실패했습니다.');
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- $toast.error('문의 등록 중 오류가 발생했습니다.');
|
|
|
|
|
- console.error('Error submitting inquiry:', error);
|
|
|
|
|
- } finally {
|
|
|
|
|
- isSubmitting.value = false;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/************************************************************************
|
|
/************************************************************************
|
|
@@ -677,9 +366,5 @@ import dayjs from 'dayjs';
|
|
|
************************************************************************/
|
|
************************************************************************/
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
loadDashboardData();
|
|
loadDashboardData();
|
|
|
-
|
|
|
|
|
- // 날짜 초기화
|
|
|
|
|
- const today = dayjs();
|
|
|
|
|
- searchEndDate.value = today.format('YYYY-MM-DD');
|
|
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|