Ver código fonte

充值渠道收入

ith5 6 meses atrás
pai
commit
46cebfc223

+ 0 - 2
src/components/sa-table/index.vue

@@ -910,8 +910,6 @@ const exportAction = () => {
   isExport.value = true;
   download(options.value.export.url)
     .then((res) => {
-      console.log("====>");
-      console.log(res);
       if (res && res.status == 200) {
         tool.download(res);
         Message.success("请求成功,文件开始下载");

+ 11 - 0
src/views/v1/api/common.js

@@ -87,4 +87,15 @@ export default {
       params,
     });
   },
+
+  /**
+   * 获取充值渠道
+   */
+  getPayChannelOptionsApi(params = {}) {
+    return request({
+      url: "/v1/common/getPayChannelOptions",
+      method: "get",
+      params,
+    });
+  },
 };

+ 18 - 0
src/views/v1/api/customer/reconciliation.js

@@ -0,0 +1,18 @@
+import { request } from "@/utils/request.js";
+
+/**
+ * 角色查询 API接口
+ */
+export default {
+  /**
+   * 数据列表
+   * @returns
+   */
+  getPageList(params = {}) {
+    return request({
+      url: "/v1/customer/Reconciliation/getChannelIncome",
+      method: "get",
+      params,
+    });
+  },
+};

+ 5 - 1
src/views/v1/center/game/edit.vue

@@ -96,7 +96,11 @@
           <div>格式:wxgamepro=PkgCBgAAoxxxx</div>
         </template>
       </a-form-item>
-      <a-form-item label="APPID" field="ios_appid" v-if="formData.os == '2'">
+      <a-form-item
+        label="ISO商店APPID"
+        field="ios_appid"
+        v-if="formData.os == '2'"
+      >
         <a-input v-model="formData.ios_appid" placeholder="请输入IOS APPID" />
       </a-form-item>
       <a-form-item

+ 167 - 0
src/views/v1/customer/reconciliation/payChannelIncome/index.vue

@@ -0,0 +1,167 @@
+<template>
+  <a-layout-content class="flex flex-col lg:h-full relative w-full">
+    <a-card :bordered="false">
+      <a-row>
+        <a-col :flex="1">
+          <a-form
+            :model="searchForm"
+            ref="searchFormRef"
+            :auto-label-width="true"
+          >
+            <a-row :gutter="10">
+              <a-col :sm="8" :xs="24">
+                <a-form-item label="游戏" field="game_id">
+                  <a-tree-select
+                    v-model="searchForm.game_id"
+                    :data="allGameOptions"
+                    placeholder="请选择游戏"
+                    allow-clear
+                    :field-names="{ title: 'name', key: 'id' }"
+                    allow-search
+                    tree-checked-strategy="child"
+                    :tree-checkable="true"
+                    :max-tag-count="1"
+                  />
+                </a-form-item>
+              </a-col>
+              <a-col :sm="8" :xs="24">
+                <a-form-item label="充值渠道" field="pay_channel_id">
+                  <a-select
+                    v-model="searchForm.pay_channel_id"
+                    :options="payChannelOptions"
+                    allow-clear
+                    placeholder="请选择充值渠道"
+                    multiple
+                  >
+                    <a-option
+                      v-for="item in payChannelOptions"
+                      :key="item.id"
+                      :value="item.id"
+                      >{{ item.name }}</a-option
+                    >
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <a-col :sm="8" :xs="24">
+                <a-form-item label="日期" field="pay_date">
+                  <a-range-picker
+                    v-model="searchForm.pay_date"
+                    type="date"
+                    format="YYYY-MM-DD"
+                    allow-clear
+                    :max-date="new Date()"
+                    :min-date="new Date('2025-01-01')"
+                    :allow-clear="false"
+                  />
+                </a-form-item>
+              </a-col>
+            </a-row>
+          </a-form>
+        </a-col>
+        <a-col
+          :xs="24"
+          :sm="8"
+          :style="{ textAlign: 'right', marginBottom: '15px' }"
+        >
+          <a-space direction="horizontal" :size="20">
+            <a-button type="primary" @click="getChannelIncome">
+              <template #icon>
+                <icon-search />
+              </template>
+              {{ "搜索" }}
+            </a-button>
+            <a-button @click="resetSearch">
+              <template #icon>
+                <icon-refresh />
+              </template>
+              {{ "重置" }}
+            </a-button>
+          </a-space>
+        </a-col>
+      </a-row>
+      <a-divider style="margin-top: 0; margin-bottom: 15px" />
+      <a-table border :columns="columns" :data="data" :pagination="false" />
+    </a-card>
+  </a-layout-content>
+</template>
+
+<script setup>
+import { onMounted, ref, reactive } from "vue";
+import api from "../../../api/customer/reconciliation";
+import commonApi from "../../../api/common";
+import dayjs from "dayjs";
+
+// 引用定义
+const crudRef = ref();
+const editRef = ref();
+const viewRef = ref();
+const data = ref([]);
+const allGameOptions = ref([]);
+const payChannelOptions = ref([]);
+
+// 搜索表单
+const searchForm = ref({
+  game_id: "",
+  pay_channel_id: "",
+});
+
+// SaTable 基础配置
+const options = reactive({
+  rowSelection: { showCheckedAll: false },
+});
+
+// SaTable 列配置
+const columns = ref([]);
+
+// 页面数据初始化
+const initPage = async () => {
+  // await getGameOptions();
+  await getGameListTree();
+  await getPayChannelOptions();
+  // 默认充值日期最近7天
+  searchForm.value.pay_date = [
+    dayjs().subtract(7, "day").format("YYYY-MM-DD"),
+    dayjs().format("YYYY-MM-DD"),
+  ];
+  await getChannelIncome();
+};
+
+// 获取子游戏options
+// const getGameOptions = async () => {
+//   const res = await commonApi.getGameOptionsApiNoAuth();
+//   allGameOptions.value = res.data;
+// };
+
+const getGameListTree = async () => {
+  const res = await commonApi.getGameListTreeNoAuthApi();
+  allGameOptions.value = res.data;
+};
+
+const getPayChannelOptions = async () => {
+  const res = await commonApi.getPayChannelOptionsApi();
+  payChannelOptions.value = res.data;
+};
+
+const getChannelIncome = async () => {
+  let params = {
+    ...searchForm.value,
+  };
+  if (params.pay_channel_id) {
+    params.pay_channel_id = params.pay_channel_id.join(",");
+  }
+  const res = await api.getPageList(params);
+  columns.value = res.data.columns;
+  data.value = res.data.data;
+};
+
+// SaTable 数据请求
+const refresh = async () => {
+  crudRef.value?.refresh();
+};
+
+// 页面加载完成执行
+onMounted(async () => {
+  initPage();
+  // refresh();
+});
+</script>

+ 7 - 0
src/views/v1/gameLog/sdkOrderSuccess/index.vue

@@ -111,6 +111,12 @@
       </template>
 
       <!-- Table 自定义渲染 -->
+
+      <template #first_payment="{ record }">
+        <span>
+          {{ record.first_payment === 1 ? "是" : "否" }}
+        </span>
+      </template>
     </sa-table>
 
     <!-- 编辑表单 -->
@@ -182,6 +188,7 @@ const columns = reactive([
 
   { title: "充值日期", dataIndex: "pay_date", width: 180 },
   { title: "注册日期", dataIndex: "reg_date", width: 180 },
+  { title: "是否首次充值", dataIndex: "first_payment", width: 180 },
 
   { title: "渠道名", dataIndex: "agent_name", width: 180 },
   { title: "负责人", dataIndex: "auth_name", width: 180 },