xia 4 rokov pred
rodič
commit
cfb310f5b6

+ 83 - 10
src/api/index.ts

@@ -15,7 +15,9 @@ import {
   deliveryPlanItem,
   IPlatform,
   adPlanLog,
-  adPlanCount
+  adPlanCount,
+  PlanBack,
+  RegisterData,
 } from "@/types/api";
 
 /**
@@ -36,7 +38,7 @@ export const getDeliveryBookList = (
     official_name: string;
     book_name: string;
     page: number;
-  }>   = { page: 1 }
+  }> = { page: 1 }
 ): AxiosPromise<IList<IDeliveryBook>> => {
   return axios("/getUserDeliveryBooks", {
     params: query,
@@ -102,7 +104,7 @@ export const getADPlanlist = (
     end_date: any;
     campaign_name: string;
     page: number;
-  }> = { page: 1,status:'AD_STATUS_DELIVERY_OK' }
+  }> = { page: 1, status: "AD_STATUS_DELIVERY_OK" }
 ): AxiosPromise<IList<ADPlanItem>> => {
   return axios("/ad/adData", { params: query });
 };
@@ -117,6 +119,7 @@ export const getDeliveryStatList = (
     official_name: string;
     book_name: string;
     page: number;
+    day_num:number;
   }> = { page: 1 }
 ): AxiosPromise<any> => {
   return axios("/delivery/stat", { params: query });
@@ -169,6 +172,7 @@ export const getCustomColumn = () => {
  */
 export const getDeliveryMoreStatList = (
   query: Partial<{
+    official_id: number;
     start_time: string;
     end_time: string;
     official_name: string;
@@ -206,7 +210,6 @@ export const adChangeCrem = (data: {
   return axios.post("/api/updateAdBid", data);
 };
 
-
 /* 修改广告状态
  * @param null
  */
@@ -225,7 +228,7 @@ export const opertaroLog = (
     begin_time: string;
     end_time: string;
     page: number;
-    ad_id:string;
+    ad_id: string;
   }> = { page: 1 }
 ): AxiosPromise<IList<adPlanLog>> => {
   return axios("/ad/adOptLogs", { params: query });
@@ -239,11 +242,81 @@ export const getAddStatus = (): AxiosPromise<any> => {
 };
 
 //广告计划字段
-export const getAdplanTable = (): AxiosPromise<Array<{desc:string;name:string}>> => {
-  return axios("/ad/adStatFields");
+export const getAdplanTable = (query: {
+  field: string;
+}): AxiosPromise<Array<{
+  desc: string;
+  name: string;
+}>> => {
+  return axios("/ad/adStatFields", { params: query });
 };
 
 //广告计划字段
-export const getAdplanData = (ids:string): AxiosPromise<any> => {
-  return axios("/ad/adStats", { params: {ad_ids: ids} });
-};
+export const getAdplanData = (query: {
+  field: string;
+  begin_date: string;
+  end_date: string;
+  ids: string;
+  page: number;
+}): AxiosPromise<any> => {
+  return axios("/ad/adStats", { params: query });
+};
+
+//获取计划的回传配置
+export const getAdBackPlan = (query: {
+  ad_lid: string;
+  back_platform: string;
+}): AxiosPromise<any> => {
+  return axios("/getReportConfig", { params: query });
+};
+
+//设置回传配置
+export const setBackConfig = (data: {
+  id: string | number;
+  back_on: number;
+  rate: number;
+  condition: string;
+  price: number;
+}) => {
+  return axios.post("/setReportConfig", data);
+};
+
+/**
+ * @description: 获取广告投放列表
+ */
+export const getRegisterData = (
+  query: Partial<{
+    ad_lid: number;
+    back_platform: string;
+    page: number;
+  }> = { page: 1 }
+): AxiosPromise<IList<RegisterData>> => {
+  return axios("/getAdMatchUsers", { params: query });
+};
+
+//强制回传
+export const setMustUpback = (data: {
+  uid: string | number;
+  platform: string;
+  report_type: string;
+}) => {
+  return axios.post("/forceReport", data);
+};
+
+//广告统计字段
+export const getAdStatus = (): AxiosPromise<Array<{
+  desc: string;
+  name: string;
+}>> => {
+  return axios("/ad/adStatOptFields");
+};
+
+//广告统计tab
+export const getDesignList = (query: {
+  day_num: number;
+}): AxiosPromise<Array<{
+  desc: string;
+  name: string;
+}>> => {
+  return axios("/delivery/getDeliveryStatFields", { params: query });
+};

+ 10 - 0
src/plugins/install.ts

@@ -12,8 +12,13 @@ import {
   Popover,
   Select,
   Table,
+  Popconfirm,
+  Tabs,
   Switch,
+  Dropdown,
   Drawer,
+  Tooltip,
+  InputNumber
 } from "ant-design-vue";
 
 import VueClipboard3 from "./vue-clipboard";
@@ -33,8 +38,13 @@ const install = (app: App<Element>) => {
     .use(VueQrCode)
     .use(ConfigProvider)
     .use(Layout)
+    .use(InputNumber)
+    .use(Dropdown)
     .use(Menu)
+    .use(Tooltip)
+    .use(Popconfirm)
     .use(Form)
+    .use(Tabs)
     .use(Input)
     .use(Button)
     .use(Select)

+ 29 - 1
src/types/api.d.ts

@@ -94,7 +94,7 @@ export interface ADPlanItem {
   avg_show_cost: number;
   convert: number;
   convert_cost: number;
-  convert_rate: number;
+  convert_rate: number; 
   campaign_name: string;
   email: string;
   account_name: string;
@@ -104,6 +104,7 @@ export interface ADPlanItem {
   aim: string;
   is_enable:number;
   enable: boolean;
+  popShow: boolean;
 }
 
 export interface deliveryPlanItem {
@@ -285,3 +286,30 @@ export interface adPlanCount {
   second_pay_num: number;
   [key:string]: string;
 }
+
+
+export interface PlanBack {
+  id?: string;
+  ad_lid?: string;
+  report_type?: string;
+  back_platform?: string;
+  back_on: number | boolean;
+  rate: number;
+  price? :number;
+  condition: number;
+  extra?:{
+    price?: number;
+  }
+}
+
+export interface RegisterData {
+  platform: string;
+  channel_id: number;
+  register_ip: string;
+  register_time: string;
+  ad_lid: number;
+  back_platform: string;
+  report_register_num: number;
+  report_recharge_num: number;
+  report_sactive_num: number;
+}

+ 145 - 15
src/views/_pageOptions/table-put.ts

@@ -134,13 +134,6 @@ export const TableColumnOfPutData = [
     dataIndex: "d30_recovery_rate",
     width: 120,
   },
-  {
-    fixed: "right",
-    title: "操作",
-    key: "operator",
-    width: 200,
-    slots: { customRender: "operator" },
-  },
 ];
 
 export const TableColumnOfPutLog = [
@@ -182,6 +175,83 @@ export const TableColumnOfPutLog = [
   }
 ]
 
+export const TableMoreStat = [
+  {
+    title: "公众号id",
+    dataIndex: "official_id",
+    width: 100,
+  },
+  {
+    title: "公众号名",
+    dataIndex: "official_name",
+    width: 100,
+  },
+  {
+    title: "书名",
+    dataIndex: "book_name",
+    width: 200,
+  },
+  {
+    title: "书籍bid",
+    dataIndex: "bid",
+    width: 200,
+  },
+  {
+    title: "日期",
+    dataIndex: "date",
+    width: 100,
+  },
+  {
+    title: "消耗(元)",
+    dataIndex: "cost",
+    width: 100,
+  },
+  {
+    title: "新增注册",
+    dataIndex: "register_num",
+    width: 100,
+  },
+  {
+    title: "流量平台",
+    dataIndex: "delivery_platform",
+    width: 100,
+  },
+  {
+    title: "注册成本",
+    dataIndex: "register_cost",
+    width: 100,
+  },
+  {
+    title: "支付粉价",
+    dataIndex: "pay_fans_cost",
+    width: 100,
+  },
+  {
+    title: "累计回本",
+    dataIndex: "recovery_rate",
+    width: 100,
+  },
+  {
+    title: "24小时回本率",
+    dataIndex: "d1_recovery_rate",
+    width: 100,
+  },
+  {
+    title: "3天回本率",
+    dataIndex: "d3_recovery_rate",
+    width: 100,
+  },
+  {
+    title: "7天回本率",
+    dataIndex: "d7_recovery_rate",
+    width: 100,
+  },
+  {
+    title: "30天回本率",
+    dataIndex: "d30_recovery_rate",
+    width: 100,
+  },
+]
 
 export const TableColumnOfMoreStat = [
   {
@@ -340,21 +410,21 @@ export const TableColumnOfPutAdPlan = [
   },
   {
     fixed: "left",
-    title: "账户名",
-    dataIndex: "account_name",
-    width: 100,
-  },
-  {
-    fixed: "left",
     title: "邮箱",
     dataIndex: "email",
-    width: 100,
+    slots: {
+      customRender: "email",
+    },
+    width: 180,
   },
   {
     fixed: "left",
     title: "广告名",
     dataIndex: "ad_name",
-    width: 100,
+    slots: {
+      customRender: "ad_name",
+    },
+    width: 180,
   },
 ];
 
@@ -465,3 +535,63 @@ export const ALLCloumnList = [
     width: 150,
   },
 ];
+
+
+export const MatchList = [
+  {
+    title: "uid",
+    dataIndex: "uid",
+    width: 100,
+  },
+  {
+    title: "用户平台",
+    dataIndex: "platform",
+    width: 150,
+  },
+  {
+    title: "站点ID",
+    dataIndex: "channel_id",
+    width: 100,
+  },
+  {
+    title: "注册IP",
+    dataIndex: "register_ip",
+    width: 150,
+  },
+  {
+    title: "注册时间",
+    dataIndex: "register_time",
+    width: 150,
+  },
+  {
+    title: "计划ID",
+    dataIndex: "ad_lid",
+    width: 100,
+  },
+  {
+    title: "计划平台",
+    dataIndex: "back_platform",
+    width: 150,
+  },
+  {
+    title: "注册上报",
+    dataIndex: "report_register_num",
+    width: 100,
+    slots: {
+      customRender: "report_register_num",
+    },
+  },
+  {
+    title: "付费上报",
+    dataIndex: "report_recharge_num",
+    width: 100,
+    slots: {
+      customRender: "report_recharge_num",
+    },
+  },
+/*   {
+    title: "次留上报",
+    dataIndex: "report_sactive_num",
+    width: 100,
+  }, */
+]

+ 51 - 26
src/views/put/put-ad-count.vue

@@ -4,15 +4,17 @@
       :columns="columns"
       :data-source="list"
       rowKey="id"
-      :pagination="false"
-      :scroll="{ x: 3000 }"
+      :pagination="tablePageOptions"
+      :loading="loading.value"
+      @change="handleTableChange"
+      :scroll="{ x: true }"
     >
     </a-table>
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, reactive, toRefs, ref } from "vue";
+import { defineComponent, reactive, toRefs, ref,watchEffect } from "vue";
 
 import ToolBar from "@/components/tool-bar/index.vue";
 import moment from "moment";
@@ -20,7 +22,7 @@ import moment from "moment";
 import { getAdplanData, getAdplanTable } from "@/api";
 import usePagination from "@/hooks/usePagination";
 
-import { adPlanCount } from "@/types/api";
+import { adPlanCount, PageOptions} from "@/types/api";
 import useApp from "@/hooks/useApp";
 
 const PutCount = defineComponent({
@@ -29,8 +31,12 @@ const PutCount = defineComponent({
   },
   props: {
     ids: String,
+    begin_date: String,
+    end_date: String,
+    field: String,
   },
   setup(props: any) {
+    let { loading, meta, tablePageOptions } = usePagination();
     const { router } = useApp();
     let list: any[] = [];
 
@@ -39,21 +45,44 @@ const PutCount = defineComponent({
       columns: list,
       picker: [],
       inSearching: false,
+      tablePageOptions,
+      loading,
     });
 
-    const onSearch = async (fields: Record<string, string>) => {
-      try {
-        const { picker } = state;
-        const { data } = await getAdplanData(props.ids);
-        state.list = data.list;
-      } catch (e) {
-      } finally {
-        state.inSearching = false;
+
+    const getData = (page=1) => {
+      let query = {
+        ids:props.ids,
+        begin_date:props.begin_date,
+        end_date:props.end_date,
+        field:props.field
       }
+
+      
+      let data = Object.assign(query,{ page});
+      console.log(data);
+      getAdplanData(data).then((res) => {
+        state.list = res.data.list;
+        meta.value = res.data.meta;
+      });
+    };
+    watchEffect(() => {
+      getData();
+    });
+    const handleTableChange = (pagination: PageOptions) => {
+      const { current, pageSize, total } = pagination;
+      getData(current);
     };
-    getAdplanTable().then((res) => {
+
+    getAdplanTable({field:props.field}).then((res) => {
       let columns: any[] = [];
-      let fixedList = ['ad_name','pay_num','recharge_amount','register_num','second_pay_num']
+      let fixedList = [
+        "ad_name",
+        "pay_num",
+        "recharge_amount",
+        "register_num",
+        "second_pay_num",
+      ];
       res.data.map((item: { desc: string; name: string }) => {
         let lolumnItem: {
           title: string;
@@ -66,26 +95,22 @@ const PutCount = defineComponent({
           dataIndex: item.name,
           width: 120,
         };
-        if(item.name == 'ad_id'){
-            lolumnItem.width = 200
+        if (item.name == "ad_id") {
+          lolumnItem.width = 200;
         }
-        if(fixedList.includes(item.name)){
-            lolumnItem.fixed = 'left';
+        if (fixedList.includes(item.name)) {
+          lolumnItem.fixed = "left";
         }
         columns.push(lolumnItem);
       });
       state.columns = [];
-     let columnSort = columns.sort((a,b)=>{
-          return ~!!a.fixed - ~!!b.fixed;
-      })
-      console.log(columnSort)
+      let columnSort = columns.sort((a, b) => {
+        return ~!!a.fixed - ~!!b.fixed;
+      });
       state.columns.push(...columnSort);
     });
-    getAdplanData(props.ids).then((res) => {
-      state.list = res.data;
-    });
 
-    return { ...toRefs(state), onSearch };
+    return { ...toRefs(state) ,handleTableChange};
   },
   methods: {
     moment,

+ 275 - 16
src/views/put/put-ad-plan.vue

@@ -21,7 +21,18 @@
 
     <div class="table-filter">
       <div class="item-right">
-        <span>筛选条件:</span>
+        <span class="label">数据类型</span>
+        <a-select class="full-width" v-model:value="currentStats">
+          <a-select-option
+            v-for="item in statsList"
+            :value="item.name"
+            :key="item.name"
+            >{{ item.desc }}</a-select-option
+          >
+        </a-select>
+      </div>
+      <div class="item-right">
+        <span class="label">筛选条件:</span>
         <a-range-picker
           v-model:value="pickerFilter"
           @change="switchDate"
@@ -40,7 +51,7 @@
       :loading="loading.value"
       @change="handleTableChange"
       rowKey="id"
-      :scroll="{ x: 1500 }"
+      :scroll="{ x: true }"
     >
       <template #switch="{ text, record }">
         <a-switch
@@ -52,6 +63,102 @@
         <p @click="onGo(record)"><a>前往落地页链接</a></p>
       </template>
 
+      <template #email="{ text, record }">
+        <p>{{ record.email }}</p>
+        <p>{{ record.account_name }}</p>
+      </template>
+
+      <template #ad_name="{ text, record }">
+        <p>广告名:{{ record.ad_name }}</p>
+        <p>广告ID:{{ record.ad_id }}</p>
+      </template>
+
+      <template #dayt="{ text, record }">
+        <a-popover title="回传配置" placement="left" trigger="click">
+          <template #content>
+            <div class="tab-list" style="width: 220px">
+              <a-tabs size="small" @change="tabChangeBack">
+                <a-tab-pane
+                  v-for="(d, i) in popForm"
+                  :key="i"
+                  :tab="`配置-${i + 1}`"
+                ></a-tab-pane>
+              </a-tabs>
+            </div>
+            <div class="hover-content">
+              <span class="label">回传条件</span
+              ><a-select
+                style="width: 150px"
+                size="small"
+                v-model:value="popForm[currentTbs].condition"
+              >
+                <a-select-option value="common">
+                  普通都回传
+                </a-select-option>
+                <a-select-option value="current_day_register">
+                  当日注册/当日付费
+                </a-select-option>
+              </a-select>
+            </div>
+            <div class="hover-content">
+              <span class="label">回传开关</span>
+              <a-switch
+                v-model:checked="popForm[currentTbs].back_on"
+                checked-children="开"
+                un-checked-children="关"
+              />
+            </div>
+            <div class="hover-content">
+              <span class="label">回传比例</span
+              ><a-input
+                v-model:value="popForm[currentTbs].rate"
+                size="small"
+                style="width: 150px"
+                type="number"
+                placeholder="回传比例"
+              >
+                <template #suffix>
+                  <a-tooltip title="比例0-100">
+                    <info-circle-outlined style="color: rgba(0,0,0,.45)" />
+                  </a-tooltip>
+                </template>
+              </a-input>
+            </div>
+            <div class="hover-content">
+              <span class="label">回传付费最低金额</span
+              ><a-input
+                v-model:value="popForm[currentTbs].price"
+                size="small"
+                style="width: 150px"
+                type="number"
+                placeholder="回传付费最低金额"
+              />
+            </div>
+            <div class="footer-slot">
+              <a-popconfirm
+                title="是否要修改回传配置?"
+                ok-text="是"
+                :visible="popconfirmShow"
+                cancel-text="否"
+                @confirm="confirmEdit"
+                @visibleChange="handleVisibleChange"
+              >
+                <a-button
+                  type="primary"
+                  size="small"
+                  :disabled="!hasPopFormData"
+                  @click="editBackConfig"
+                >
+                  修改
+                </a-button>
+              </a-popconfirm>
+            </div>
+          </template>
+          <p @click="getBackData(record)"><a>回传</a></p>
+        </a-popover>
+        <p @click="getregister(record)"><a>注册用户</a></p>
+      </template>
+
       <template #cpa_bid="{ text, record }">
         <editable-cell
           :text="text"
@@ -85,7 +192,15 @@
       :closable="false"
       v-model:visible="visible1"
     >
-      <put-count :ids="ids"></put-count>
+      <put-count :ids="backData.ids" :begin_date="backData.begin_date" :end_date="backData.end_date" :field="backData.field"></put-count>
+    </a-drawer>
+    <a-drawer
+      title="注册用户"
+      placement="right"
+      :closable="false"
+      v-model:visible="registerVisable"
+    >
+      <register-datad :ad_lid="register.ad_lid" :back_platform="register.back_platform"></register-datad>
     </a-drawer>
   </div>
 </template>
@@ -96,10 +211,11 @@ import moment from "moment";
 import ToolBar from "@/components/tool-bar/index.vue";
 import PutData from "@/views/put/put-log.vue";
 import PutCount from "@/views/put/put-ad-count.vue";
+import RegisterDatad from "@/views/put/register-data.vue";
 import EditableCell from "@/components/edit-cell/index.vue";
 import usePagination from "@/hooks/usePagination";
 import { picker } from "@/helper/config/range";
-
+import { InfoCircleOutlined } from "@ant-design/icons-vue";
 import {
   TableColumnOfPutAdPlan,
   ALLCloumnList,
@@ -112,9 +228,12 @@ import {
   adChangeCrem,
   statusChange,
   getAddStatus,
+  getAdBackPlan,
+  setBackConfig,
+  getAdStatus,
 } from "@/api";
 
-import { ADPlanItem, PageOptions } from "@/types/api";
+import { ADPlanItem, PageOptions, PlanBack } from "@/types/api";
 
 const PutAdPlan = defineComponent({
   components: {
@@ -122,11 +241,15 @@ const PutAdPlan = defineComponent({
     EditableCell,
     PutData,
     PutCount,
+    InfoCircleOutlined,
+    RegisterDatad,
   },
   setup() {
     let { loading, meta, tablePageOptions } = usePagination();
     let list: any[] = [],
-      opList: any[] = [];
+      opList: any[] = [],
+      stList :any = [];
+      
     const state = reactive({
       platform: "platform1",
       list: ref<ADPlanItem[]>([]),
@@ -134,14 +257,41 @@ const PutAdPlan = defineComponent({
       loading,
       currentSelect: "AD_STATUS_DELIVERY_OK",
       picker: [],
-      currentId:'',
+      currentId: "",
+
       visible: false,
+      popconfirmShow: false,
+      showPop: false,
       visible1: false,
+      registerVisable: false,
+      register: {
+        ad_lid: 0,
+        back_platform: "",
+      },
       pickerFilter: [moment(), moment()],
       tablePageOptions,
       columns: list,
-      ids: "",
+      backData:{
+        ids: "",
+        begin_date:'',
+        end_date:'',
+        field:''
+      },
+      
+      currentTbs: 0,
+      hasPopFormData: false,
+      popForm: [
+        {
+          id: 0,
+          back_on: false,
+          rate: 0,
+          condition: "",
+          price: 0,
+        },
+      ],
       optionList: opList,
+      statsList:stList,
+      currentStats:'paid_order_amount',
       defaultColumns: TableColumnOfPutAdPlan,
       fields: {},
       rangePick: picker,
@@ -182,10 +332,15 @@ const PutAdPlan = defineComponent({
       let [begin_dates, end_dates] = pickerFilter;
       let begin_date = moment(begin_dates).format("YYYY-MM-DD");
       let end_date = moment(end_dates).format("YYYY-MM-DD");
-      let data = Object.assign({ page: 1,status:'AD_STATUS_DELIVERY_OK',...state.fields},query || {}, {begin_date, end_date,status: state.currentSelect});
+      let data = Object.assign(
+        { page: 1, status: "AD_STATUS_DELIVERY_OK", ...state.fields },
+        query || {},
+        { begin_date, end_date, status: state.currentSelect }
+      );
       getADPlanlist(data).then((res) => {
         let newList: any[] = res.data.list.map((item) => {
           item.enable = item.is_enable == 1 ? true : false;
+          item.popShow = false;
           return item;
         });
         state.list = newList;
@@ -193,9 +348,18 @@ const PutAdPlan = defineComponent({
         state.inSearching = false;
       });
     };
-
+    getAdStatus().then(res=>{
+      state.statsList = res.data;
+    })
     getCustomColumn().then((res) => {
       let columns: any[] = [];
+      let blackList = [
+        "email",
+        "ad_name",
+        "account_name",
+        "ad_id",
+        "delivery_platform",
+      ];
       res.data.map((item: { desc: string; name: string }) => {
         let lolumnItem: {
           title: string;
@@ -207,25 +371,35 @@ const PutAdPlan = defineComponent({
           dataIndex: item.name,
           width: 150,
         };
+
         if (item.name == "external_url") {
           lolumnItem.slots = { customRender: "external_url" };
         }
         if (item.name == "cpa_bid" || item.name == "budget") {
           lolumnItem.slots = { customRender: item.name };
         }
-
         columns.push(lolumnItem);
       });
+      let newColunms = columns.filter(
+        (item) => !blackList.includes(item.dataIndex)
+      );
+
       state.columns = [];
       state.columns.push(...state.defaultColumns);
-      state.columns.push(...columns);
+      state.columns.push(...newColunms);
       state.columns.push({
-        title: "操作",
+        title: "操作记录",
         dataIndex: "opertate",
-        fixed: "right",
         slots: { customRender: "opertate" },
         width: 100,
       });
+      state.columns.push({
+        title: "日志",
+        dataIndex: "opertate",
+        fixed: "right",
+        slots: { customRender: "dayt" },
+        width: 100,
+      });
     });
 
     const handleTableChange = (pagination: PageOptions) => {
@@ -246,8 +420,34 @@ const PutAdPlan = defineComponent({
       this.visible = true;
       this.currentId = record.ad_id;
     },
+    handleVisibleChange(visibale: boolean) {
+      if (!visibale) {
+        this.popconfirmShow = false;
+        return;
+      }
+      if (!this.hasPopFormData) {
+        this.popconfirmShow = false;
+      } else {
+        this.popconfirmShow = true;
+      }
+    },
+    confirmEdit() {
+      console.log(this.currentTbs);
+      let { id, back_on, rate, condition, price } = this.popForm[
+        this.currentTbs
+      ];
+      let data = { id, back_on: Number(back_on), rate, condition, price };
+      setBackConfig(data).then((res) => {
+        this.$message.success("修改成功!");
+      });
+    },
+    getregister(record:any) {
+      console.log(record)
+      this.register.ad_lid = record.id;
+      this.register.back_platform =record.delivery_platform;
+      this.registerVisable = true;
+    },
     onCellChange(record: any, dataIndex: string, value: string) {
-      console.log(record);
       let ad_id = record.ad_id;
       if (dataIndex == "cpa_bid") {
         adChangeCrem({ ad_id, bid: value })
@@ -268,6 +468,10 @@ const PutAdPlan = defineComponent({
           });
       }
     },
+    tabChangeBack(key: number) {
+      this.currentTbs = key;
+    },
+    editBackConfig() {},
     switchMethod(record: any) {
       console.log(record);
       let ad_id = record.ad_id;
@@ -283,9 +487,35 @@ const PutAdPlan = defineComponent({
       this.list.map((item: ADPlanItem) => {
         ids = ids + `,${item.ad_id}`;
       });
-      this.ids = ids.substring(1);
+      let [begin_dates, end_dates] = this.pickerFilter;
+      let begin_date = moment(begin_dates).format("YYYY-MM-DD");
+      let end_date = moment(end_dates).format("YYYY-MM-DD");
+      this.backData.ids = ids.substring(1);
+      this.backData.begin_date = begin_date;
+      this.backData.end_date = end_date;
+      this.backData.field = this.currentStats;
       this.visible1 = true;
     },
+    handleClickChange() {
+      console.log(this.showPop);
+    },
+    backPost() {},
+    getBackData(record: any) {
+      getAdBackPlan({
+        ad_lid: record.id,
+        back_platform: record.delivery_platform,
+      }).then((res) => {
+        let list = res.data.map((r: PlanBack) => {
+          r.price = r.extra?.price;
+          r.back_on = !!Number(r.back_on);
+          return r;
+        });
+        list.length > 0
+          ? (this.hasPopFormData = true)
+          : (this.hasPopFormData = false);
+        this.popForm = list;
+      });
+    },
   },
 });
 
@@ -303,5 +533,34 @@ export default PutAdPlan;
 }
 .item-right {
   margin-right: 10px;
+  display: flex;
+  align-items: center;
+  .ant-select{
+    width: 100px;
+  }
+  .label{
+    display: inline-block;
+    min-width:80px;
+  }
+}
+.hover-content {
+  margin: 8px 0 5px;
+  display: flex;
+  align-items: center;
+  .label {
+    padding-right: 15px;
+    display: inline-block;
+    max-width: 72px;
+    width: 72px;
+  }
+  .ant-switch {
+    width: 50px;
+  }
+}
+.footer-slot {
+  margin-top: 10px;
+  button {
+    margin-right: 10px;
+  }
 }
 </style>

+ 1 - 1
src/views/put/put-data-more.vue

@@ -20,7 +20,7 @@ import { defineComponent, reactive, toRefs, ref } from "vue";
 
 import ToolBar from "@/components/tool-bar/index.vue";
 
-import { TableColumnOfMoreStat } from "../_pageOptions/table-put";
+import { TableColumnOfMoreStat,TableMoreStat } from "../_pageOptions/table-put";
 
 import { getDeliveryMoreStatList } from "@/api";
 import usePagination from "@/hooks/usePagination";

+ 144 - 76
src/views/put/put-data.vue

@@ -1,57 +1,55 @@
 <template>
   <div class="page-wrap page-wrap-put-books">
-    <tool-bar :text="['official_name', 'book_name']"
-              :label="['公众号名称', '书名']"
-              @confirm="onSearch"
-              v-model:loading="inSearching">
+    <tool-bar
+      :text="['official_name', 'book_name']"
+      :label="['公众号名称', '书名']"
+      @confirm="onSearch"
+      v-model:loading="inSearching"
+    >
       <template #picker>
         <p class="label">日期</p>
-        <a-range-picker />
+        <a-range-picker
+          :ranges="rangePick"
+          format="YYYY/MM/DD"
+          v-model:value="pickered"
+        />
       </template>
     </tool-bar>
-    <a-table :columns="columns"
-             :data-source="list"
-             :scroll="{x: true}">
-      <template #operator="data">
-        <div class="confirm-button">
-          <a-button type="link"
-                    @click="more(data.record)">更多</a-button>
-        </div>
-      </template>
+
+    <div class="table-filter">
+      <div class="item-right">
+        <span class="label">自定义天数</span>
+        <a-input-number
+          id="inputNumber"
+          v-model:value="filterNumber"
+          :min="1"
+          :max="120"
+        />
+      </div>
+      <a-button type="primary" @click="changeNumber">
+        修改天数
+      </a-button>
+    </div>
+    <a-table :columns="columns" :data-source="list" :scroll="{ x: 3000 }" @change="handleTableChange">
     </a-table>
-    <drawer-wrapper v-model:show="show"
-                    title="更多数据"
-                    :columns="drawercolumns"
-                    :source="drawerlist"
-                    :meta="meta"
-                    @page-change="onPageChange"
-                    :scroll="{x: true}"
-                    width="90%">
-      <template #tool-bar>
-        <tool-bar :text="['official_name', 'book_name']"
-                  :label="['公众号名称', '书名']"
-                  @confirm="draweronSearch"
-                  v-model:loading="drawerinSearching"></tool-bar>
-      </template>
-      <!-- <template #default="{ data }">
-        <p>{{ data.id }}</p>
-      </template>-->
-    </drawer-wrapper>
   </div>
 </template>
 
 <script lang="ts">
 import { defineComponent, reactive, toRefs, ref } from "vue";
-
+import { picker } from "@/helper/config/range";
 import ToolBar from "@/components/tool-bar/index.vue";
-import DrawerWrapper from "@/components/drawer-wrapper/index.vue";
-
+import moment from "moment";
 import {
   TableColumnOfPutData,
   TableColumnOfMoreStat,
 } from "../_pageOptions/table-put";
 
-import { getDeliveryStatList, getDeliveryMoreStatList } from "@/api";
+import {
+  getDeliveryStatList,
+  getDeliveryMoreStatList,
+  getDesignList,
+} from "@/api";
 import usePagination from "@/hooks/usePagination";
 
 import { deliveryPlanItem, PageOptions, moreStatPlanItem } from "@/types/api";
@@ -60,24 +58,34 @@ import useApp from "@/hooks/useApp";
 const PutData = defineComponent({
   components: {
     ToolBar,
-    DrawerWrapper,
   },
   setup() {
     const { router } = useApp();
     let { loading, meta, tablePageOptions } = usePagination();
+    let listed: any = [];
     const state = reactive({
       list: ref<any>([]),
+      fields: {},
       drawerlist: ref<moreStatPlanItem[]>([]),
-      columns: TableColumnOfPutData,
+      pickered: [],
+      columns: listed,
+      pickerFilter: [],
       drawercolumns: TableColumnOfMoreStat,
       inSearching: false,
+      rangePick: picker,
       drawerinSearching: false,
       drawermeta: {},
+      filterNumber: 120,
       show: false,
     });
     const onSearch = async (fields: Record<string, string>) => {
       try {
-        const { official_name, book_name, start_time, end_time } = fields;
+        const { official_name, book_name } = fields;
+        const { pickered } = state;
+        let [begin_dates, end_dates] = pickered;
+        let start_time = moment(begin_dates).format("YYYY-MM-DD");
+        let end_time = moment(end_dates).format("YYYY-MM-DD");
+        state.fields = Object.assign({ start_time, end_time }, fields);
         const { data } = await getDeliveryStatList({
           start_time,
           end_time,
@@ -94,58 +102,118 @@ const PutData = defineComponent({
         state.inSearching = false;
       }
     };
-    getDeliveryStatList().then((res) => {
+
+    const changeNumber = () => {
+      getCloums();
+      getDeliveryStatList(
+        Object.assign(state.fields, { page: 1, day_num: state.filterNumber })
+      ).then((res) => {
+        state.list = res.data.list;
+      });
+    };
+    const getCloums = () =>{
+      getDesignList({ day_num: state.filterNumber }).then((res) => {
+      let columns: any[] = [];
+      let whiteList = [
+        "official_name",
+        "book_name",
+        "register_num",
+        "delivery_platform",
+      ];
+      console.log(res)
+      res.data.map((item: { desc: string; name: string }) => {
+        let lolumnItem: {
+          title: string;
+          dataIndex: string;
+          slots?: any;
+          width?: string | number;
+          fixed?: string;
+        } = {
+          title: item.desc,
+          dataIndex: item.name,
+          width: 120,
+        };
+        /* if (whiteList.includes(item.name)) {
+          lolumnItem.fixed = "left";
+        } */
+        columns.push(lolumnItem);
+      });
+      state.columns = columns;
+    });
+    }
+    getCloums();
+    getDeliveryStatList(
+      Object.assign(state.fields, { page: 1, day_num: state.filterNumber })
+    ).then((res) => {
       state.list = res.data.list;
     });
     const handleTableChange = (pagination: PageOptions) => {
       const { current, pageSize, total } = pagination;
-      getDeliveryStatList({ page: current }).then((res) => {
+      let data = Object.assign(state.fields, {
+        page: current,
+        day_num: state.filterNumber,
+      });
+      getDeliveryStatList(data).then((res) => {
         state.list = res.data.list;
         meta.value = res.data.meta;
       });
     };
-    const more = (data: any) => {
-      // console.log(data.date);
-      // router.push({ path: "/put/datamore" });
-      state.show = true;
-      getDeliveryMoreStatList().then((r) => {
-        state.drawerlist = r.data.list;
-        state.drawermeta = r.data.meta;
-      });
-    };
-
-    const draweronSearch = async (fields: Record<string, string>) => {
-      try {
-        const { official_name, book_name, start_time, end_time } = fields;
-        const { data } = await getDeliveryMoreStatList({
-          start_time,
-          end_time,
-          official_name,
-          book_name,
-          page: 1,
-        });
-        state.drawerlist = data.list;
-        state.drawermeta = data.meta;
-      } catch (e) {
-        console.log(e);
-      } finally {
-        console.log(state.drawerinSearching);
-        state.drawerinSearching = false;
-      }
-    };
-    const onPageChange = (page: Number) => {};
 
     return {
       ...toRefs(state),
       onSearch,
-      handleTableChange,
       meta,
-      more,
-      onPageChange,
-      draweronSearch,
+      handleTableChange,
+      changeNumber,
     };
   },
+  methods: {
+    moment,
+  },
 });
 
 export default PutData;
-</script>
+</script>
+<style lang="scss">
+.table-filter {
+  display: flex;
+  justify-content: flex-end;
+  padding: 5px 0 15px;
+  align-items: center;
+}
+.ant-drawer-content-wrapper {
+  width: 80vw !important;
+}
+.item-right {
+  margin-right: 10px;
+  display: flex;
+  align-items: center;
+  .ant-select {
+    width: 100px;
+  }
+  .label {
+    display: inline-block;
+    min-width: 80px;
+  }
+}
+.hover-content {
+  margin: 8px 0 5px;
+  display: flex;
+  align-items: center;
+  .label {
+    padding-right: 15px;
+    display: inline-block;
+    max-width: 72px;
+    width: 72px;
+  }
+  .ant-switch {
+    width: 50px;
+  }
+}
+.footer-slot {
+  margin-top: 10px;
+  button {
+    margin-right: 10px;
+  }
+}
+</style>

+ 18 - 8
src/views/put/put-log.vue

@@ -33,7 +33,11 @@
       :pagination="false"
     >
       <template #log="{ text, record }">
-        <p v-for="(log, index) in record.content_log" :key="log" class="table-p">
+        <p
+          v-for="(log, index) in record.content_log"
+          :key="log"
+          class="table-p"
+        >
           {{ log }}
         </p>
       </template>
@@ -42,7 +46,7 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, reactive, toRefs, ref } from "vue";
+import { defineComponent, reactive, toRefs, ref, watchEffect } from "vue";
 
 import ToolBar from "@/components/tool-bar/index.vue";
 import moment from "moment";
@@ -70,6 +74,7 @@ const PutData = defineComponent({
       picker: [],
       inSearching: false,
     });
+
     const onSearch = async (fields: Record<string, string>) => {
       try {
         const { picker } = state;
@@ -91,8 +96,14 @@ const PutData = defineComponent({
         state.inSearching = false;
       }
     };
-    opertaroLog({ ad_id: props.id }).then((res) => {
-      state.list = res.data.list;
+    const getData = (id = props.id) => {
+      opertaroLog({ ad_id: props.id }).then((res) => {
+        state.list = res.data.list;
+      });
+    };
+
+    watchEffect(() => {
+      getData(props.id);
     });
     const handleTableChange = (pagination: PageOptions) => {
       const { current, pageSize, total } = pagination;
@@ -102,7 +113,6 @@ const PutData = defineComponent({
       });
     };
     const more = (data: any) => {
-      console.log(data.date);
       router.push({ path: "/put/datamore" });
     };
     return { ...toRefs(state), onSearch, handleTableChange, meta, more };
@@ -115,10 +125,10 @@ const PutData = defineComponent({
 export default PutData;
 </script>
 <style lang="scss" scoped>
-.table-p{
+.table-p {
   max-width: 500px;
-  white-space:normal;
+  white-space: normal;
   word-break: break-all;
   line-height: 200%;
 }
-</style>
+</style>

+ 174 - 0
src/views/put/register-data.vue

@@ -0,0 +1,174 @@
+<template>
+  <div class="page-wrap page-wrap-put-books">
+    <a-table
+      :columns="columns"
+      :data-source="list"
+      rowKey="id"
+      :pagination="tablePageOptions"
+      :loading="loading.value"
+      @change="handleTableChange"
+      :scroll="{ x: true }"
+    >
+      <template #report_register_num="{ text, record }">
+        <p v-if="record.report_register_num >= 1">
+          已上报
+        </p>
+        <a-popconfirm
+          title="是否要继续强制回传?"
+          ok-text="是"
+          cancel-text="否"
+          @confirm="confirmEdit"
+        >
+          <p
+            @click="mustUp(record, 'register','report_register_num')"
+            v-if="record.report_register_num <= 0"
+          >
+            <a>强制回传</a>
+          </p>
+        </a-popconfirm>
+      </template>
+      <template #report_recharge_num="{ text, record }">
+        <p v-if="record.report_recharge_num >= 1">
+          已上报
+        </p>
+        <a-popconfirm
+          title="是否要继续强制回传?"
+          ok-text="是"
+          cancel-text="否"
+          @confirm="confirmEdit"
+        >
+          <p
+            @click="mustUp(record, 'recharge','report_recharge_num')"
+             v-if="record.report_recharge_num <= 0"
+          >
+            <a>强制回传</a>
+          </p>
+        </a-popconfirm>
+      </template>
+    </a-table>
+  </div>
+</template>
+
+<script lang="ts">
+import { defineComponent, reactive, toRefs, ref, watchEffect } from "vue";
+
+import { MatchList } from "../_pageOptions/table-put";
+
+import { getRegisterData, setMustUpback } from "@/api";
+import usePagination from "@/hooks/usePagination";
+
+import { RegisterData, PageOptions } from "@/types/api";
+import useApp from "@/hooks/useApp";
+
+const RegisterDatad = defineComponent({
+  props: {
+    ad_lid: Number,
+    back_platform: String,
+  },
+  setup(props) {
+    const { router } = useApp();
+    let { loading, meta, tablePageOptions } = usePagination();
+    const state = reactive({
+      list: ref<RegisterData[]>([]),
+      columns: MatchList,
+      loading,
+      tablePageOptions,
+      tableIndex: 0,
+      form: {
+        report_type: "",
+        uid: 0,
+        platform: "",
+        val:''
+      },
+    });
+
+    const getData = (
+      ad_lid = props.ad_lid,
+      back_platform = props.back_platform
+    ) => {
+      getRegisterData({
+        ad_lid,
+        back_platform,
+        page: state.tablePageOptions.current,
+      }).then((res) => {
+        state.list = res.data.list;
+        meta.value = res.data.meta;
+      });
+    };
+    watchEffect(() => {
+      
+      getData(props.ad_lid, props.back_platform);
+    });
+    const handleTableChange = (pagination: PageOptions) => {
+      const { current, pageSize, total } = pagination;
+      console.log(current)
+      meta.value.current_page = current;
+      getRegisterData({
+        ad_lid: props.ad_lid,
+        back_platform: props.back_platform,
+        page: current,
+      }).then((res) => {
+        state.list = res.data.list;
+        meta.value = res.data.meta;
+      });
+    };
+    return { ...toRefs(state), handleTableChange, meta };
+  },
+  methods: {
+    confirmEdit() {
+      setMustUpback(this.form).then((res) => {
+        this.$message.success("修改成功!");
+         let list =  this.list.map((d:any,i:number)=>{
+             if(i==this.tableIndex){
+                 d[this.form.val] = 1;
+             }
+             return d;
+         });
+        this.list = list; 
+      });
+    },
+    mustUp(record: any, type: string,val:string) {
+      let { uid, platform } = record;
+      console.log(uid)
+      this.form.uid = uid;
+      this.form.platform = platform;
+      this.form.val = val;
+      this.form.report_type = type;
+      this.tableIndex = this.list.findIndex((r: any) => (r.uid == uid));
+    },
+  },
+});
+
+export default RegisterDatad;
+</script>
+<style lang="scss" scoped>
+.table-p {
+  max-width: 500px;
+  white-space: normal;
+  word-break: break-all;
+  line-height: 200%;
+}
+.item-right {
+  margin-right: 10px;
+}
+.hover-content {
+  margin: 8px 0 5px;
+  display: flex;
+  align-items: center;
+  .label {
+    padding-right: 15px;
+    display: inline-block;
+    max-width: 72px;
+    width: 72px;
+  }
+  .ant-switch {
+    width: 50px;
+  }
+}
+.footer-slot {
+  margin-top: 10px;
+  button {
+    margin-right: 10px;
+  }
+}
+</style>