Ver código fonte

快手回传BUG修复

XiaBx 3 anos atrás
pai
commit
3cf1bf1df8

+ 3 - 0
src/api/index.ts

@@ -97,6 +97,8 @@ export const getOfficialAccounts = (query: {
   page: number;
   report_module: any;
   report_status: any;
+  report_platform?: string;
+  
 }): AxiosPromise<IList<IOfficials>> => {
   return axios("/userOfficialAccounts", { params: query });
 };
@@ -313,6 +315,7 @@ export const setMustUpback = (data: {
   uid: string | number;
   platform: string;
   report_type: string;
+  report_platform?:string;
 }) => {
   return axios.post("/forceReport", data);
 };

+ 2 - 1
src/views/_pageOptions/table-account.ts

@@ -105,13 +105,14 @@ export const TableColumnOfLog = [
     title: "回传状态",
     width: 140,
     dataIndex: "report_status",
+    
   },
   {
     title: "操作",
     dataIndex: "action",
     width: 250,
     slots: {
-      customRender: "action",
+      customRender: "report_status",
     },
   },
 ];

+ 1 - 0
src/views/account/kuaishou.vue

@@ -316,6 +316,7 @@ const Account = defineComponent({
     const onLoadOfficials = (query?: { current: number }) => {
       let params = JSON.parse(JSON.stringify(state.query));
       if (query) params.page = query.current;
+      params.report_platform = 'kuaishou';
       loading.value = true;
       // if (state.query.report_status === -1) delete params.report_status;
       if (state.query.report_module === "") delete params.report_module;

+ 96 - 18
src/views/account/log.vue

@@ -1,28 +1,42 @@
 <template>
   <div>
+    <tool-bar
+      :text="['uid']"
+      :label="['uid']"
+      v-model:loading="searching"
+      @confirm="onSearch"
+      @cancel="onCancel"
+    >
+      <template #picker>
+        <p class="label">充值日期</p>
+        <a-range-picker
+          v-model:value="pickered"
+          :ranges="rangePick"
+          format="YYYY/MM/DD"
+          @change="changeTime"
+        />
+      </template>
+    </tool-bar>
     <a-table
       bordered
       :data-source="list"
       :columns="columns"
       @change="getList"
-      rowKey="id"
+      rowKey="order_no"
       :loading="loading"
       :pagination="tablePageOptions"
     >
-     <template #report_recharge_num="{ text, record }">
-        <p v-if="record.report_recharge_num >= 1">
+      <template #report_status="{ text, record }">
+        <p v-if="record.report_status == 'success'">
           已上报
         </p>
         <a-popconfirm
           title="是否要继续强制回传?"
           ok-text="是"
           cancel-text="否"
-          @confirm="confirmEdit"
+          @confirm="confirmEdit(record)"
         >
-          <p
-            @click="mustUp(record, 'recharge', 'report_recharge_num')"
-            v-if="record.report_recharge_num <= 0"
-          >
+          <p v-if="record.report_status != 'success'">
             <a>强制回传</a>
           </p>
         </a-popconfirm>
@@ -34,13 +48,20 @@
 <script lang="ts">
 import usePagination from "@/hooks/usePagination";
 import PreviewBox from "./preview.vue";
-import { defineComponent, reactive, toRefs, ref, watch } from "vue";
+import { defineComponent, reactive, toRefs, ref, watch, computed } from "vue";
 import { TableColumnOfLog } from "@/views/_pageOptions/table-account";
-
-import { backLogList } from "@/api";
 import { message } from "ant-design-vue";
+import { backLogList, setMustUpback } from "@/api";
+import { picker } from "@/helper/config/range";
+import ToolBar from "@/components/tool-bar/index.vue";
+import useApp from "@/hooks/useApp";
+import { MutationType } from "@/store/modules/app/_type";
+import moment from "moment";
 const CommonTable = defineComponent({
-  props: ["visible","channel_id"],
+  props: ["visible", "channel_id"],
+  components: {
+    ToolBar,
+  },
   setup(props) {
     let { meta, tablePageOptions } = usePagination();
     const state = reactive({
@@ -48,29 +69,86 @@ const CommonTable = defineComponent({
       list: ref<any[]>([]),
       columns: TableColumnOfLog,
       pushVisible: false,
+      curPage: ref(1),
+      inSearching: false,
+      fields: ref({
+        date:''
+      }),
+      defaultToolvalue: {},
+      rangePick: picker,
+      pickered: computed(() =>
+        store.getters.selectTime.length > 0
+          ? [
+              moment(store.getters.selectTime[0]),
+              moment(store.getters.selectTime[1]),
+            ]
+          : [moment().subtract(30, "d"), moment()]
+      ),
     });
+    const { store } = useApp();
+
     const getList = async (page?: any) => {
       state.loading = true;
       let { data } = await backLogList({
-        page: page ? page.current : 1,
-        report_platform:'kuaishou',
-        platform:'zhuishuyun',
-        channel_id:props.channel_id
+        page: page?.current ? page.current : 1,
+        report_platform: "kuaishou",
+        platform: "zhuishuyun",
+        channel_id: props.channel_id,
+        ...state.fields,
       });
       state.loading = false;
+      state.curPage = page?.current ?? 1;
       state.list = data.list;
       meta.value = data.meta;
     };
 
+    getList();
+
     watch(
-      () => [props.visible,props.channel_id],
+      () => [props.visible, props.channel_id],
       ([newVal], [oldVal]) => {
         if (newVal) {
           getList();
         }
       }
     );
-    return { ...toRefs(state), tablePageOptions, getList };
+    const onSearch = (fields: any) => {
+      const { uid } = fields;
+      state.fields = fields;
+      if (state.pickered.length > 0) {
+        state.fields.date = [
+          moment(state.pickered[0]).format("YYYY-MM-DD"),
+          moment(state.pickered[1]).format("YYYY-MM-DD"),
+        ].join(",");
+      }
+
+      getList();
+    };
+    //强制回传
+    const confirmEdit = (record: any) => {
+      setMustUpback({
+        uid: record.uid,
+        report_type: "recharge",
+        platform: "zhuishuyun",
+      }).then((res) => {
+        message.success("上报成功!");
+        getList({ current: state.curPage });
+      });
+    };
+    const changeTime = (monent: any, string: string[]) => {
+      if (Array.isArray(string) && string.join("")) {
+        store.commit(MutationType.setSelectTime, string);
+      }
+    };
+    
+    return {
+      ...toRefs(state),
+      tablePageOptions,
+      getList,
+      confirmEdit,
+      onSearch,
+      changeTime
+    };
   },
   mounted() {},
 });