Sfoglia il codice sorgente

RING:员工绩效基础页面

ringcode 3 anni fa
parent
commit
fa6a2b51df

+ 30 - 0
src/assets/common-style/frame.scss

@@ -0,0 +1,30 @@
+.title-box {
+  width: 100%;
+  height: 70px;
+  padding: 20px 40px 0 30px;
+  background: white;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  h3 {
+    font-weight: bold;
+  }
+}
+.padding-box {
+  padding: 20px 20px 0;
+  .search-box {
+    height: 70px;
+    border-bottom: 1px solid rgb(214, 211, 211);
+    background: white;
+    display: flex;
+    align-items: center;
+    .ant-form-item,
+    .ant-btn {
+      margin-left: 20px;
+    }
+  }
+  .table-box {
+    padding-top: 20px;
+    background: white;
+  }
+}

+ 25 - 1
src/router/async.ts

@@ -164,6 +164,30 @@ export const QuickApp: RouteConfig = {
   component: () => import("@/views/read/quick-app.vue")
 };
 
+export const Performance: RouteConfig = {
+  name: "Performance",
+  path: "/data/performance",
+  meta: {
+    title: "员工绩效",
+    noMenu: true
+  },
+  // children: [PutAdAcountL, PutAdGroup, PutAdPlan],
+  component: () => import("@/views/data/performance.vue")
+};
+
+export const DataAnalysis: RouteConfig = {
+  name: "DataAnalysis",
+  path: "/data",
+  icon: "DesktopOutlined",
+  meta: {
+    title: "数据分析"
+  },
+  children: [
+    Performance,
+  ],
+  component: () => import("@/views/data/index.vue")
+};
+
 export const ForgetPwd: RouteConfig = {
   name: "ForgetPwd",
   path: "/forgetpwd",
@@ -176,6 +200,6 @@ export const ForgetPwd: RouteConfig = {
 
 
 
-const asyncRoutes: RouteConfig[] = [AccountManager, PutManager, Financial, QuickApp, ForgetPwd];
+const asyncRoutes: RouteConfig[] = [AccountManager, PutManager, Financial, QuickApp, ForgetPwd, DataAnalysis];
 
 export default asyncRoutes;

+ 21 - 0
src/views/data/index.vue

@@ -0,0 +1,21 @@
+<template>
+  <router-view></router-view>
+</template>
+
+<script lang="ts">
+import { defineComponent } from "vue";
+
+import useStore from "@/hooks/useStore";
+
+import { getOfficialSimpleAccount } from "@/api";
+import { ActionType } from "@/store/modules/app/_type";
+
+const DataIndex = defineComponent({
+  setup() {
+    const store = useStore();
+    store.dispatch(ActionType.doSaveOfficial);
+  },
+});
+
+export default DataIndex;
+</script>

+ 157 - 0
src/views/data/performance.vue

@@ -0,0 +1,157 @@
+<template>
+  <div class="performance">
+    <div class="title-box">
+      <h3>员工绩效</h3>
+    </div>
+    <div class="padding-box">
+      <div class="search-box"></div>
+    </div>
+  </div>
+</template>
+
+<script lang="ts">
+import usePagination from "@/hooks/usePagination";
+import { defineComponent, reactive, toRefs, ref } from "vue";
+import { onBeforeRouteUpdate } from "vue-router";
+// import { TableColumnOfYuewen } from "../_pageOptions/table_yuewen";
+//getPromotionList
+import {
+  getPromotionList,
+  addPromotionLInk,
+  updateReportConfig,
+  deletePromotion,
+} from "@/api";
+import { message } from "ant-design-vue";
+const PutDataIndex = defineComponent({
+  components: {},
+  setup() {
+    let { tablePageOptions } = usePagination();
+    const formRef = ref();
+    const state = reactive({
+      search: {
+        name: "", // 推广员名称
+        days: "", // 自定义天数 1~30天 无默认
+        months: "", // 自定义月数 默认一个月
+        dateType: "month", // 按月查询month/按天查询date
+        month_range: "", // 按月查询 月范围
+        date_range: "", // 按天查询 日期范围
+      },
+      addLink: {
+        channel_id: "", // 推广链接id
+        channel_name: "", // 渠道名
+        book_name: "", // 作品名
+      },
+      list: ref<any[]>([]),
+      visible: false, // 添加派单链接dialog
+      rateVisible: false, // 添加派单链接dialog
+      drawerVisible: false,
+      confirmLoading: false, // 提交链接loading
+      // columns: TableColumnOfYuewen,
+      rate: 0, // 设置回传配置
+      channelId: "",
+      loading: false,
+      rules: {
+        channel_id: [
+          { required: true, message: "请输入推广链接ID", trigger: "change" },
+        ],
+        channel_name: [
+          { required: true, message: "请输入渠道名", trigger: "change" },
+        ],
+        book_name: [
+          { required: true, message: "请输入作品名", trigger: "change" },
+        ],
+      },
+    });
+    return { ...toRefs(state), formRef, tablePageOptions };
+  },
+  mounted() {
+    this.getList({ current: 1 });
+  },
+  methods: {
+    // 重置搜索条件
+    resetSearch() {
+      // this.search.book_name = "";
+      // this.search.channel_name = "";
+      // this.search.channel_id = "";
+    },
+    // 获取推广链接数据
+    async getList(page?: any) {
+      // this.loading = true;
+      // let { data } = await getPromotionList({
+      //   page: page ? page.current : 1,
+      //   ...this.search,
+      // });
+      // this.loading = false;
+      // this.list = data.list;
+    },
+    // 点击添加链接
+    onAddLink() {
+      this.addLink.channel_id = "";
+      this.addLink.channel_name = "";
+      this.addLink.book_name = "";
+      this.visible = true;
+    },
+    // 确认增加派单链接
+    async onEmitLink() {
+      this.formRef.validate().then(() => {});
+      if (!this.addLink.channel_name) return message.warn("请输入渠道名称");
+      if (!this.addLink.channel_id) return message.warn("请输入链接ID");
+      if (!this.addLink.book_name) return message.warn("请输入推广作品");
+      try {
+        await addPromotionLInk(this.addLink);
+        message.success("新增成功");
+        this.getList({ current: 1 });
+        this.visible = false;
+      } catch (err) {
+        console.log("ERROR:", err);
+      }
+    },
+    // 删除
+    async onDelete(val: any) {
+      try {
+        await deletePromotion({ channel_id: val.channel_id });
+        this.getList({ current: 1 });
+        message.success("删除成功");
+      } catch (err) {
+        console.log(err);
+      }
+    },
+    // 点击回传配置
+    onRateConfig(val: any) {
+      this.channelId = val.channel_id;
+      this.rateVisible = true;
+      this.rate = val.rate;
+    },
+    // 提交回传配置
+    async onEmitRate() {
+      if (this.rate > 100 || this.rate < 0)
+        return message.error("回传比例应在0~100之间");
+      if (parseInt(this.rate) !== parseFloat(this.rate))
+        return message.warn("请输入整数");
+      try {
+        await updateReportConfig({
+          channel_id: this.channelId,
+          rate: this.rate,
+        });
+        message.success("修改成功");
+        this.getList({ current: 1 });
+        this.rateVisible = false;
+      } catch (err) {
+        console.log(err);
+      }
+    },
+    // 查看注册用户
+    openUserDrawer(val: any) {
+      this.channelId = val.channel_id;
+      this.drawerVisible = true;
+    },
+  },
+});
+
+export default PutDataIndex;
+</script>
+<style lang="scss" scoped>
+@import "@/assets/common-style/frame.scss";
+// .performance {
+// }
+</style>