Explorar el Código

RING:绩效FIX

ringcode hace 3 años
padre
commit
bf3c2ed31f
Se han modificado 5 ficheros con 34 adiciones y 152 borrados
  1. 1 0
      src/api/index.ts
  2. 2 0
      src/main.ts
  3. 1 1
      src/views/data/index.vue
  4. 14 90
      src/views/data/performance-detail.vue
  5. 16 61
      src/views/data/performance.vue

+ 1 - 0
src/api/index.ts

@@ -918,6 +918,7 @@ export const getStuffPerformance = (
     model: string,
     value: string | number,
     page: number,
+    back_amount_order: number | string
   }
 ): any => {
   return axios("/promoter/stat", { params: query });

+ 2 - 0
src/main.ts

@@ -14,6 +14,7 @@ import ElementPlus from 'element-plus';
 import 'element-plus/lib/theme-chalk/index.css';
 import 'dayjs/locale/zh-cn'
 import locale from 'element-plus/lib/locale/lang/zh-cn'
+import { ElIcon } from 'element-plus'
 
 const app = createApp(App);
 
@@ -23,6 +24,7 @@ createGlobalData(app);
 
 
 app.use(ElementPlus, { locale })
+app.use(ElIcon)
 app.use(store).use(router);
 
 router.isReady().then((_) => app.mount("#app"));

+ 1 - 1
src/views/data/index.vue

@@ -18,4 +18,4 @@ const DataIndex = defineComponent({
 });
 
 export default DataIndex;
-</script>
+</script>

+ 14 - 90
src/views/data/performance-detail.vue

@@ -45,6 +45,12 @@
             style="width: 100px"
             type="number"
             :min="0"
+            :onkeyup="
+              (search.value =
+                Number(String(search.value).replace(/\D/g, '')) == 0
+                  ? ''
+                  : Number(String(search.value).replace(/\D/g, '')))
+            "
             @keyup.enter="getList"
           />&nbsp;
           <a-select
@@ -66,6 +72,7 @@
             size="small"
             style="width: 240px"
             value-format="YYYY-MM"
+            :clearable="false"
           >
           </el-date-picker>
           <el-date-picker
@@ -79,6 +86,7 @@
             size="small"
             style="width: 240px"
             value-format="YYYY-MM-DD"
+            :clearable="false"
           >
           </el-date-picker>
         </div>
@@ -180,6 +188,10 @@ const PerformanceDetial = defineComponent({
         end_date: this.search.date_arr ? this.search.date_arr[1] : "",
         ...this.search,
       };
+      if(sorter) {
+        if(sorter.order === 'descend') param.back_amount_order = 2
+        if(sorter.order === "ascend") param.back_amount_order = 1
+      }
       delete param.date_arr;
       console.log("请求参数", param);
       let { data } = await getStuffPerformance({
@@ -257,37 +269,6 @@ const PerformanceDetial = defineComponent({
       });
       console.log("渲染");
       linePlot.render();
-      // fetch(
-      //   "https://gw.alipayobjects.com/os/bmw-prod/e00d52f4-2fa6-47ee-a0d7-105dd95bde20.json"
-      // )
-      //   .then((res: any) => res.json())
-      //   .then((data: any) => {
-      //     console.log("CHART DATA:", data);
-      //     const linePlot = new Line("chart-container", {
-      //       data,
-      //       xField: "year",
-      //       yField: "gdp",
-      //       seriesField: "name",
-      //       yAxis: {
-      //         label: {
-      //           formatter: (v: any) => `${(v / 10e8).toFixed(1)} B`,
-      //         },
-      //       },
-      //       legend: {
-      //         position: "top",
-      //       },
-      //       smooth: true,
-      //       // @TODO 后续会换一种动画方式
-      //       animation: {
-      //         appear: {
-      //           animation: "path-in",
-      //           duration: 3000,
-      //         },
-      //       },
-      //     });
-
-      //     linePlot.render();
-      //   });
     },
     // 工具函数:获取最近日期
     getDateRange(dateNow: any, intervalDays: any, bolPastTime: any) {
@@ -366,9 +347,8 @@ const PerformanceDetial = defineComponent({
         if(item.dataIndex === 'cash_withdrawal_amount') withdrawalIndex = index
         if(item.dataIndex === 'user_charge_amount_sum') chargeIndex = index+2
       })
-      // 选择按月查询 1.自然日从0加起-默认展示M+0、M+1、M+2 \ 2.24小时-从1加起-默认展示M+1、M+2
+      // 选择按月查询 1.自然日从0加起-默认展示M+0、M+1、M+2 \ 2.24小时-从1加起-默认展示M+0、M+1
       if(this.search.type === 'month') { //  按月查询
-        if(this.search.model === 'natural') { // 自然日
           if(!this.search.value) {// 默认 未输入自定义月数
             for(let i = 0; i< 3; i++) {
               this.columns.splice(withdrawalIndex+(i+1), 0,{
@@ -424,63 +404,7 @@ const PerformanceDetial = defineComponent({
                 })
             }
           }
-        } else { // 24小时
-          if(!this.search.value) { // 未输入月数 默认
-            for(let i =0; i< 3; i++) {
-              this.columns.splice(withdrawalIndex+(i+1), 0,{
-                title: '提现(元)M+'+ (i+1),
-                dataIndex: 'cash_withdrawal',
-                width: 150,
-                customRender: ({ text, record }) => {
-                  return (<div style="color:gray;font-size:13px">
-                            <p style="color:black;font-size:14px">{ text[i].amount }</p>
-                            <p>累计提现: { text[i].accruing_amount }</p>
-                            <p>回本率: { text[i].back_rate }</p>
-                          </div>)
-                },
-              })
-              this.columns.splice(chargeIndex+(i*2), 0,{
-                title: '用户充值(元)M+'+ (i+1),
-                dataIndex: 'user_charge',
-                width: 150,
-                customRender: ({ text, record }) => {
-                  return (<div style="color:gray;font-size:13px">
-                            <p style="color:black;font-size:14px">{ text[i].amount }</p>
-                            <p>累计提现: { text[i].accruing_amount }</p>
-                            <p>回本率: { text[i].back_rate }</p>
-                          </div>)
-                },
-              })
-            }
-          } else { // 自定义月数
-            for(let i = 0; i< this.search.value; i++) {
-                this.columns.splice(withdrawalIndex+(i+1), 0,{
-                  title: '提现(元)M+'+ (i+1),
-                  dataIndex: 'cash_withdrawal',
-                  width: 150,
-                  customRender: ({ text, record }) => {
-                    return (<div style="color:gray;font-size:13px">
-                              <p style="color:black;font-size:14px">{ text[i].amount }</p>
-                              <p>累计提现: { text[i].accruing_amount }</p>
-                              <p>回本率: { text[i].back_rate }</p>
-                            </div>)
-                  },
-                })
-                this.columns.splice(chargeIndex+(i*2), 0,{
-                  title: '用户充值(元)M+'+(i+1),
-                  dataIndex: 'user_charge',
-                  width: 150,
-                  customRender: ({ text, record }) => {
-                    return (<div style="color:gray;font-size:13px">
-                              <p style="color:black;font-size:14px">{ text[i].amount }</p>
-                              <p>累计提现: { text[i].accruing_amount }</p>
-                              <p>回本率: { text[i].back_rate }</p>
-                            </div>)
-                  },
-                })
-            }
-          }
-        }
+        
       } else { // 选择按日查询 1.自然日从0加起-默认展示T+0、T+2、T+6、T+14、T+29 \ 2.24小时-从1加起-默认展示T+0、T+2、T+6、T+14、T+29
           if(!this.search.value) {// 默认 未输入自定义月数
             for(let i = 0; i< 5; i++) {

+ 16 - 61
src/views/data/performance.vue

@@ -21,8 +21,12 @@
             type="number"
             :min="0"
             :max="30"
-            :precision="0"
-            :onkeyup="(search.value = String(search.value).replace(/\D/g, ''))"
+            :onkeyup="
+              (search.value =
+                Number(String(search.value).replace(/\D/g, '')) == 0
+                  ? ''
+                  : Number(String(search.value).replace(/\D/g, '')))
+            "
             @keyup.enter="getList"
           />&nbsp;
           <a-select
@@ -44,6 +48,7 @@
             size="small"
             style="width: 240px"
             value-format="YYYY-MM"
+            :clearable="false"
           >
           </el-date-picker>
           <el-date-picker
@@ -57,6 +62,7 @@
             size="small"
             style="width: 240px"
             value-format="YYYY-MM-DD"
+            :clearable="false"
           >
           </el-date-picker>
         </div>
@@ -163,6 +169,7 @@ const Performance = defineComponent({
         dataIndex: 'operation',
         slots: { customRender: 'operation' },
         fixed: 'right',
+        width:150
       }]
     },
     // 获取推广链接数据
@@ -178,7 +185,12 @@ const Performance = defineComponent({
         end_date: this.search.date_arr ? this.search.date_arr[1] : "",
         ...this.search,
       };
+      if(sorter) {
+        if(sorter.order === 'descend') param.back_amount_order = 2
+        if(sorter.order === "ascend") param.back_amount_order = 1
+      }
       delete param.date_arr;
+      // if(!param.value) delete param.value
       console.log("请求参数", param);
       let { data } = await getStuffPerformance({
         page: page ? page.current : 1,
@@ -217,9 +229,8 @@ const Performance = defineComponent({
         if(item.dataIndex === 'cash_withdrawal_amount') withdrawalIndex = index
         if(item.dataIndex === 'user_charge_amount_sum') chargeIndex = index+2
       })
-      // 选择按月查询 1.自然日从0加起-默认展示M+0、M+1、M+2 \ 2.24小时-从1加起-默认展示M+1、M+2
+      // 选择按月查询 1.自然日从0加起-默认展示M+0、M+1、M+2 \ 2.24小时-从1加起-默认展示M+0、M+1
       if(this.search.type === 'month') { //  按月查询
-        if(this.search.model === 'natural') { // 自然日
           if(!this.search.value) {// 默认 未输入自定义月数
             for(let i = 0; i< 3; i++) {
               this.columns.splice(withdrawalIndex+(i+1), 0,{
@@ -275,63 +286,7 @@ const Performance = defineComponent({
                 })
             }
           }
-        } else { // 24小时
-          if(!this.search.value) { // 未输入月数 默认
-            for(let i =0; i< 3; i++) {
-              this.columns.splice(withdrawalIndex+(i+1), 0,{
-                title: '提现(元)M+'+ (i+1),
-                dataIndex: 'cash_withdrawal',
-                width: 150,
-                customRender: ({ text, record }) => {
-                  return (<div style="color:gray;font-size:13px">
-                            <p style="color:black;font-size:14px">{ text[i].amount }</p>
-                            <p>累计提现: { text[i].accruing_amount }</p>
-                            <p>回本率: { text[i].back_rate }</p>
-                          </div>)
-                },
-              })
-              this.columns.splice(chargeIndex+(i*2), 0,{
-                title: '用户充值(元)M+'+ (i+1),
-                dataIndex: 'user_charge',
-                width: 150,
-                customRender: ({ text, record }) => {
-                  return (<div style="color:gray;font-size:13px">
-                            <p style="color:black;font-size:14px">{ text[i].amount }</p>
-                            <p>累计提现: { text[i].accruing_amount }</p>
-                            <p>回本率: { text[i].back_rate }</p>
-                          </div>)
-                },
-              })
-            }
-          } else { // 自定义月数
-            for(let i = 0; i< this.search.value; i++) {
-                this.columns.splice(withdrawalIndex+(i+1), 0,{
-                  title: '提现(元)M+'+ (i+1),
-                  dataIndex: 'cash_withdrawal',
-                  width: 150,
-                  customRender: ({ text, record }) => {
-                    return (<div style="color:gray;font-size:13px">
-                              <p style="color:black;font-size:14px">{ text[i].amount }</p>
-                              <p>累计提现: { text[i].accruing_amount }</p>
-                              <p>回本率: { text[i].back_rate }</p>
-                            </div>)
-                  },
-                })
-                this.columns.splice(chargeIndex+(i*2), 0,{
-                  title: '用户充值(元)M+'+(i+1),
-                  dataIndex: 'user_charge',
-                  width: 150,
-                  customRender: ({ text, record }) => {
-                    return (<div style="color:gray;font-size:13px">
-                              <p style="color:black;font-size:14px">{ text[i].amount }</p>
-                              <p>累计提现: { text[i].accruing_amount }</p>
-                              <p>回本率: { text[i].back_rate }</p>
-                            </div>)
-                  },
-                })
-            }
-          }
-        }
+        
       } else { // 选择按日查询 1.自然日从0加起-默认展示T+0、T+2、T+6、T+14、T+29 \ 2.24小时-从1加起-默认展示T+0、T+2、T+6、T+14、T+29
           if(!this.search.value) {// 默认 未输入自定义月数
             for(let i = 0; i< 5; i++) {