浏览代码

代码修正

quyx@nextosd.com 4 月之前
父节点
当前提交
97c4897ec4

+ 31 - 8
src/views/fcbi/customer/export.vue

@@ -6,13 +6,13 @@
       <PublicRange
           v-model="queryParams"
           :region-tree="regionTree"
-          :yamada-fc-brand="yamada_fc_brand"
-          :yamada-business-type="yamada_business_type"
+          :yamada-fc-brand="yamadaFcBrand"
+          :yamada-business-type="yamadaBusinessType"
           @check-change="handleCheckChange"
       />
       <div class="shop-name-section" style="padding-left: 58px;">
         <label for="shopName" class="shop-name-label">店铺名</label>
-        <input type="text" id="shopName" class="shop-name-input">
+        <input type="text" id="shopName" class="shop-name-input"  v-model="queryParams.storeName">
       </div>
       <div class="btn-section" style="padding-left: 78px; margin-top: 25px;">
         <button class="operate-btn" @click="handleExportCSV">CSV出力</button>
@@ -36,8 +36,8 @@ const surveyStore = useSurveyStore();
 /**
  * データ辞書から品牌と業務タイプのデータを取得します
  */
-const { yamada_fc_brand } = proxy.useDict('yamada_fc_brand');
-const { yamada_business_type } = proxy.useDict('yamada_business_type');
+const { yamada_fc_brand: yamadaFcBrand } = proxy.useDict('yamada_fc_brand');
+const { yamada_business_type: yamadaBusinessType } = proxy.useDict('yamada_business_type');
 
 /**
  * 地域ツリーデータと選択された地域コードの配列を保持します
@@ -53,7 +53,8 @@ const data = reactive({
   queryParams: {
     brandCode: [],
     businessTypeCode: [],
-    regions: []
+    regions: [],
+    storeName: ''
   }
 });
 const { queryParams} = toRefs(data);
@@ -159,6 +160,17 @@ const collectSelectedRegions = (nodes, isParent = false) => {
  * CSV形式でデータをエクスポートする関数です
  */
 function handleExportCSV() {
+
+  const params = {
+    // FC
+    brandCodes: queryParams.value.brandCode,
+    // 業種
+    businessTypeCodes: queryParams.value.businessTypeCode,
+    // エリア
+    regionCodes: queryParams.value.regions.map(region => region.region_code),
+    // 店铺名
+    storeName: queryParams.value.storeName
+  };
   ElMessageBox.confirm(
       'CSV出力を実行しますか?',
       '確認',
@@ -170,7 +182,7 @@ function handleExportCSV() {
   )
       .then(() => {
         // 用户点击"はい"(是)时执行导出
-        download('system/survey/exportCustomerCsv', {}, `ymdf_customer${new Date().getTime()}.csv`);
+        download('system/survey/exportCustomerCsv', params, `ymdf_customer${new Date().getTime()}.csv`);
       })
       .catch(() => {
         // 用户点击"いいえ"(否)时不执行操作,自动关闭弹窗
@@ -181,6 +193,17 @@ function handleExportCSV() {
  * DM宛名用のデータをエクスポートする関数です
  */
 function handleExportDM() {
+
+  const params = {
+    // FC
+    brandCodes: queryParams.value.brandCode,
+    // 業種
+    businessTypeCodes: queryParams.value.businessTypeCode,
+    // エリア
+    regionCodes: queryParams.value.regions.map(region => region.region_code),
+    // 店铺名
+    storeName: queryParams.value.storeName
+  };
   ElMessageBox.confirm(
       'DM宛名出力を実行しますか?',
       '確認',
@@ -192,7 +215,7 @@ function handleExportDM() {
   )
       .then(() => {
         // 用户点击"はい"(是)时执行导出
-        download('system/survey/exportCustomerDm', {}, `ymdf_customer${new Date().getTime()}.csv`);
+        download('system/survey/exportCustomerDm', params, `ymdf_customer${new Date().getTime()}.csv`);
       })
       .catch(() => {
         // 用户点击"いいえ"(否)时不执行操作,自动关闭弹窗

+ 1 - 1
src/views/fcbi/sales/sumResult.vue

@@ -97,7 +97,7 @@ const data = reactive({
   form: {},
   queryParams: {
     pageNum: 1,
-    pageSize: 100,
+    pageSize: 50,
     monthYear: '',
     startMonth: '',
     startYear: '',

+ 4 - 4
src/views/fcbi/sales/sumSettings.vue

@@ -67,8 +67,8 @@
       <PublicRange
           v-model="queryParams"
           :region-tree="regionTree"
-          :yamada-fc-brand="yamada_fc_brand"
-          :yamada-business-type="yamada_business_type"
+          :yamada-fc-brand="yamadaFcBrand "
+          :yamada-business-type="yamadaBusinessType"
           @check-change="handleCheckChange"
           :show-business-type="false"
       />
@@ -94,8 +94,8 @@ const router = useRouter();
 /**
  * データ辞書から品牌と業務タイプのデータを取得します
  */
-const { yamada_fc_brand } = proxy.useDict('yamada_fc_brand');
-const { yamada_business_type } = proxy.useDict('yamada_business_type');
+const { yamada_fc_brand: yamadaFcBrand } = proxy.useDict('yamada_fc_brand');
+const { yamada_business_type: yamadaBusinessType } = proxy.useDict('yamada_business_type');
 
 /**
  * 地域ツリーデータと選択された地域コードの配列を保持します

+ 5 - 1
src/views/fcbi/survey/answer.vue

@@ -85,6 +85,7 @@
 import { ref, onMounted } from 'vue'
 import { listSurveyAnswer } from "@/api/fcbi/survey.js"
 import { useRouter } from "vue-router";
+import { useRoute } from 'vue-router'
 import useTagsViewStore from '@/store/modules/tagsView'
 
 // アンケートデータと状態管理
@@ -94,13 +95,16 @@ const surveyCode = ref('')
 const surveyQuestions = ref([])
 const loading = ref(true)
 const router = useRouter();
+const route= useRoute()
 const tagsViewStore = useTagsViewStore()
 const currentRoute = router.currentRoute.value
+const surveyId = route.params.surveyId
+
 
 // アンケートデータをAPIから取得
 const loadSurveyData = async () => {
   try {
-    const response = await listSurveyAnswer()
+    const response = await listSurveyAnswer({ surveyId: surveyId })
     if (response.code === 200) {
       surveyData.value = { publicEndTime: response.rows[0].publicEndTime || '' }
       surveyCode.value = response.rows[0].surveyCode || ''

+ 6 - 6
src/views/fcbi/survey/form.vue

@@ -22,8 +22,8 @@
         <PublicRange
             v-model="queryParams"
             :region-tree="regionTree"
-            :yamada-fc-brand="yamada_fc_brand"
-            :yamada-business-type="yamada_business_type"
+            :yamada-fc-brand="yamadaFcBrand"
+            :yamada-business-type="yamadaBusinessType"
             @check-change="handleCheckChange"
         />
         <!-- 公開期間 -->
@@ -286,10 +286,10 @@ import {formatMsg} from "@/utils/yamada.js"
 const { proxy } = getCurrentInstance();
 const surveyStore = useSurveyStore()
 // アップロード対象を取得
-const { yamada_fc_brand } = proxy.useDict('yamada_fc_brand');
-surveyStore.setBrandCode(yamada_fc_brand)
-const { yamada_business_type } = proxy.useDict('yamada_business_type');
-surveyStore.setBusinessTypeCode(yamada_business_type)
+const { yamada_fc_brand: yamadaFcBrand } = proxy.useDict('yamada_fc_brand');
+surveyStore.setBrandCode(yamadaFcBrand)
+const { yamada_business_type: yamadaBusinessType } = proxy.useDict('yamada_business_type');
+surveyStore.setBusinessTypeCode(yamadaBusinessType)
 const error = ref('');
 
 const regionTree = ref([]);