|
|
@@ -0,0 +1,191 @@
|
|
|
+<!-- 顧客一覧 -->
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <el-form ref="queryRef" :inline="true" :model="queryParams">
|
|
|
+ <el-form-item label="顧客名" prop="customerName">
|
|
|
+ <el-input v-model="queryParams.customerName"
|
|
|
+ clearable maxlength="255" @keyup.enter="handleQuery"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="顧客名(カナ)" prop="customerNameKana">
|
|
|
+ <el-input v-model="queryParams.customerNameKana"
|
|
|
+ clearable
|
|
|
+ maxlength="255" @keyup.enter="handleQuery"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-row v-show="initLoadingCompleted" :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-form-item label="店舗" prop="storeCode">
|
|
|
+ <el-select v-model="queryParams.storeCode" filterable style="width: 600px;margin-left: 13px;">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in fcStoreOptions"
|
|
|
+ :key="dict.key"
|
|
|
+ :label="dict.value"
|
|
|
+ :value="dict.key"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-form-item label="FC" prop="brandCode" >
|
|
|
+ <el-checkbox-group v-model="queryParams.brandNames ">
|
|
|
+ <el-checkbox v-for="dict in yamada_fc_brand" :key="dict.label" :label="dict.label">{{ dict.label }}</el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button icon="Search" type="primary" @click="handleQuery">検索</el-button>
|
|
|
+ <el-button icon="Refresh" type="primary" @click="resetQuery">クリア</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-table v-show="initLoadingCompleted" v-loading="listLoading" :border="true" :data="CustomerList">
|
|
|
+ <el-table-column :show-overflow-tooltip="true" align="center" header-align="left" label="顧客" min-width="60"
|
|
|
+ prop="customerName"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :show-overflow-tooltip="true" align="left" header-align="left" label="顧客名(カナ)" min-width="70"
|
|
|
+ prop="customerNameKana"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :show-overflow-tooltip="true" align="center" header-align="center" label="FC" min-width="80"
|
|
|
+ prop="brandName"
|
|
|
+ width=""/>
|
|
|
+ <el-table-column :show-overflow-tooltip="true" align="center" header-align="center" label="店舗名" min-width="60"
|
|
|
+ prop="storeName"
|
|
|
+ width=""/>
|
|
|
+ <el-table-column :show-overflow-tooltip="true" align="center" header-align="center" label="住所" min-width="90"
|
|
|
+ prop="address1"
|
|
|
+ width=""/>
|
|
|
+ <el-table-column :show-overflow-tooltip="true" align="left" header-align="center" label="郵便番号" min-width="70"
|
|
|
+ prop="postalCode"
|
|
|
+ width=""/>
|
|
|
+ <el-table-column :show-overflow-tooltip="true" align="center" header-align="center" label="お電話番号" min-width="60"
|
|
|
+ prop="mobilePhone"
|
|
|
+ width=""/>
|
|
|
+ <el-table-column :show-overflow-tooltip="true" align="center" header-align="left" label="生年月日" min-width="70"
|
|
|
+ prop="birthDate"
|
|
|
+ width=""/>
|
|
|
+ <el-table-column :show-overflow-tooltip="true" align="right" header-align="left" label="直近購入年月" min-width="70"
|
|
|
+ prop="lastPurchaseMonth"
|
|
|
+ width=""/>
|
|
|
+ <el-table-column align="center" class-name="small-padding fixed-width" label="操作" min-width="180" width="300">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button @click="CustomerDetail(scope.row)" v-hasPermi="['fcbi:customer:detail']" icon="Edit" link type="primary" >顧客詳細</el-button>
|
|
|
+ <el-button @click="Confirm(scope.row)" v-hasPermi="['fcbi:customer:history']" icon="Edit" link type="primary" >顧客購入履歴</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination v-show="listTotalCnt>0"
|
|
|
+ v-model:limit="queryParams.pageSize"
|
|
|
+ v-model:page="queryParams.pageNum"
|
|
|
+ :total="listTotalCnt"
|
|
|
+ @pagination="getSearchList"/>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script name="CustomerList" setup>
|
|
|
+
|
|
|
+import {customerSurvey, fcStoreSurvey} from "@/api/fcbi/customer.js"
|
|
|
+import {useRouter} from 'vue-router';
|
|
|
+
|
|
|
+// 認証項目のテーブルデータを格納するリアクティブ
|
|
|
+const CustomerList = ref([]);
|
|
|
+// データ読み込み中のローディング状態を管理するリアクティブ
|
|
|
+const listLoading = ref(false);
|
|
|
+// 検索結果の総件数を格納するリアクティブ
|
|
|
+const listTotalCnt = ref(0);
|
|
|
+// 初期ロードが完了したかどうかを示すリアクティブ
|
|
|
+const initLoadingCompleted = ref(false);
|
|
|
+const {proxy} = getCurrentInstance();
|
|
|
+const router = useRouter();
|
|
|
+// アップロード対象を取得
|
|
|
+const { yamada_fc_brand } = proxy.useDict('yamada_fc_brand');
|
|
|
+const fcStoreOptions = ref([]);
|
|
|
+
|
|
|
+/**
|
|
|
+ * コンポーネントの状態を管理するリアクティブオブジェクト
|
|
|
+ */
|
|
|
+const data = reactive({
|
|
|
+ form: {},
|
|
|
+ // 検索条件を格納するオブジェクト
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ customerName: '',
|
|
|
+ customerNameKana: '',
|
|
|
+ storeCode: '',
|
|
|
+ brandNames : [],
|
|
|
+ },
|
|
|
+});
|
|
|
+
|
|
|
+// リアクティブオブジェクトからプロパティを参照可能なオブジェクトに変換
|
|
|
+const {queryParams} = toRefs(data);
|
|
|
+
|
|
|
+/**
|
|
|
+ * 検索ボタンのクリックイベントハンドラー
|
|
|
+ * 検索条件を初期ページに設定して検索を実行する
|
|
|
+ */
|
|
|
+function handleQuery() {
|
|
|
+ queryParams.value.pageNum = 1;
|
|
|
+ getSearchList();
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 店舗の情報を取得する
|
|
|
+ */
|
|
|
+function getFcStoreOptions() {
|
|
|
+ fcStoreSurvey().then(response => {
|
|
|
+ fcStoreOptions.value = response.rows.map(store => {
|
|
|
+ return {
|
|
|
+ key: store.storeCode,
|
|
|
+ value: `${store.fcBrandName} ${store.storeName}`,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 発注リストを検索する関数
|
|
|
+ * APIを呼び出して検索条件に一致する発注データを取得する
|
|
|
+ */
|
|
|
+function getSearchList() {
|
|
|
+ listLoading.value = true;
|
|
|
+ let params = {
|
|
|
+ pageNum: queryParams.value.pageNum,
|
|
|
+ pageSize: queryParams.value.pageSize,
|
|
|
+ customerName: queryParams.value.customerName,
|
|
|
+ customerNameKana: queryParams.value.customerNameKana,
|
|
|
+ storeCode: queryParams.value.storeCode,
|
|
|
+ brandNames : queryParams.value.brandNames ,
|
|
|
+ };
|
|
|
+ customerSurvey(params).then(response => {
|
|
|
+ CustomerList.value = response.rows;
|
|
|
+ listTotalCnt.value = response.total;
|
|
|
+ listLoading.value = false;
|
|
|
+ initLoadingCompleted.value = true;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+const CustomerDetail = (row) => {
|
|
|
+ router.push({
|
|
|
+ name: 'customerDetail',
|
|
|
+ params: {
|
|
|
+ customerId: row.customerId
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+/**
|
|
|
+ * リセット ボタンアクション
|
|
|
+ */
|
|
|
+function resetQuery() {
|
|
|
+ proxy.resetForm("queryRef");
|
|
|
+ queryParams.value.brandNames = [];
|
|
|
+ handleQuery();
|
|
|
+}
|
|
|
+// コンポーネント初期化時に検索を実行
|
|
|
+getFcStoreOptions();
|
|
|
+getSearchList();
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+
|
|
|
+</style>
|