Эх сурвалжийг харах

销售分析业绩提成页面完成

cz 2 жил өмнө
parent
commit
b6c7876a01

+ 4 - 0
src/views/WDLY/outInBound/abnormal/index.vue

@@ -132,6 +132,10 @@ const typeData = [
     label: "调仓",
     value: "30",
   },
+  {
+    label: "到货异常",
+    value: "40",
+  },
 ];
 const statusData = [
   {

+ 2 - 2
src/views/WDLY/outInBound/waitOutBound/index.vue

@@ -197,7 +197,7 @@ const outboundType = ref([
     value: "1",
   },
   {
-    label: "库完成",
+    label: "库完成",
     value: "2",
   },
 ]);
@@ -270,7 +270,7 @@ const config = computed(() => {
         prop: "status",
       },
       render(status) {
-        return status == 0 ? "未出库" : status == 1 ? "部分出库" : "库完成";
+        return status == 0 ? "未出库" : status == 1 ? "部分出库" : "库完成";
       },
     },
     {

+ 89 - 31
src/views/dataBoard/board/salesAnalysis/index.vue

@@ -2,7 +2,7 @@
   <div class="content">
     <div class="bck">
       <el-form :inline="true" :model="queryForm">
-        <el-form-item label="">
+        <!-- <el-form-item label="">
           <el-date-picker
             v-model="queryForm.aa"
             type="month"
@@ -18,7 +18,7 @@
             <el-radio-button label="今年" />
             <el-radio-button label="其他" />
           </el-radio-group>
-        </el-form-item>
+        </el-form-item> -->
         <el-form-item>
           <el-date-picker
             v-model="queryForm.timeArr"
@@ -96,6 +96,7 @@
         <el-col :span="16">
           <byTable
             :hideSearch="true"
+            :tableHeight="250"
             :source="sourceList.scatterData"
             :pagination="sourceList.scatterPagination"
             :config="scatterConfig"
@@ -271,14 +272,14 @@ const optionOne = reactive({
       trigger: "item",
     },
     legend: {
-      top: "0%",
+      bottom: "0%",
       left: "center",
     },
     series: [
       {
-        name: "销售分",
+        name: "销售分",
         type: "pie",
-        radius: ["20%", "50%"],
+        radius: ["30%", "70%"],
         avoidLabelOverlap: false,
         itemStyle: {
           borderRadius: 10,
@@ -292,14 +293,20 @@ const optionOne = reactive({
         emphasis: {
           label: {
             show: true,
-            fontSize: 40,
+            fontSize: 20,
             fontWeight: "bold",
           },
         },
         labelLine: {
           show: false,
         },
-        data: [2000, 1000],
+        data: [
+          { value: 1048, name: "Search Engine" },
+          { value: 735, name: "Direct" },
+          { value: 580, name: "Email" },
+          { value: 484, name: "Union Ads" },
+          { value: 300, name: "Video Ads" },
+        ],
       },
     ],
   },
@@ -335,7 +342,7 @@ const optionTwo = reactive({
     ],
     series: [
       {
-        name: "Direct",
+        name: "名称",
         type: "bar",
         barWidth: "25%",
         data: [10, 52, 200, 334, 390, 330, 220],
@@ -349,21 +356,23 @@ const optionTwo = reactive({
 const scatterConfig = computed(() => {
   return [
     {
+      type: "index",
       attrs: {
         label: "序列",
-        prop: "receiptWarehouseName",
+        width: 80,
+        align: "center",
       },
     },
     {
       attrs: {
         label: "国家",
-        prop: "receiptWarehouseName",
+        prop: "countryName",
       },
     },
     {
       attrs: {
         label: "订单量(单)",
-        prop: "receiptWarehouseName",
+        prop: "count",
       },
     },
     {
@@ -380,15 +389,17 @@ const scatterConfig = computed(() => {
 const salesConfig = computed(() => {
   return [
     {
+      type: "index",
       attrs: {
         label: "序列",
-        prop: "receiptWarehouseName",
+        width: 80,
+        align: "center",
       },
     },
     {
       attrs: {
         label: "客户",
-        prop: "receiptWarehouseName",
+        prop: "corporationName",
       },
     },
     {
@@ -405,15 +416,17 @@ const salesConfig = computed(() => {
 const salesmanSalesConfig = computed(() => {
   return [
     {
+      type: "index",
       attrs: {
         label: "序列",
-        prop: "receiptWarehouseName",
+        width: 80,
+        align: "center",
       },
     },
     {
       attrs: {
         label: "业务员",
-        prop: "receiptWarehouseName",
+        prop: "userName",
       },
     },
     {
@@ -430,15 +443,17 @@ const salesmanSalesConfig = computed(() => {
 const productSalesConfig = computed(() => {
   return [
     {
+      type: "index",
       attrs: {
         label: "序列",
-        prop: "receiptWarehouseName",
+        width: 80,
+        align: "center",
       },
     },
     {
       attrs: {
         label: "商品名称",
-        prop: "receiptWarehouseName",
+        prop: "productName",
       },
     },
     {
@@ -456,9 +471,11 @@ const productSalesConfig = computed(() => {
 const productSalesOneConfig = computed(() => {
   return [
     {
+      type: "index",
       attrs: {
         label: "序列",
-        prop: "receiptWarehouseName",
+        width: 80,
+        align: "center",
       },
     },
     {
@@ -485,30 +502,67 @@ const getData = () => {
   salesmanSalesLoading.value = true;
   productSalesLoading.value = true;
   productSalesOneLoading.value = true;
-
   proxy.post("/contract/salesStatistics", queryForm).then((res) => {
     allData.salesStatisticsData = res;
     setTimeout(() => {
       statisticsLoading.value = false;
     }, 200);
   });
+  proxy.post("/contract/countrySalesStatistics", queryForm).then((res) => {
+    sourceList.value.scatterData = res;
+    optionOne.data.series[0].data = res.map((x) => ({
+      value: x.amount,
+      name: x.countryName,
+    }));
+    myChart.setOption(optionOne.data);
+    setTimeout(() => {
+      scatterLoading.value = false;
+    }, 200);
+  });
 
   proxy.post("/contract/customSalesStatistics", queryForm).then((res) => {
     sourceList.value.salesData = res;
+    const option = { ...optionTwo };
+    option.data.xAxis[0].data = res.map((x) => x.corporationName);
+    option.data.series[0].data = res.map((x) => x.amount);
+    option.data.series[0].name = "销售额(¥)";
+    myChartOne.setOption(option.data);
     setTimeout(() => {
       salesLoading.value = false;
     }, 200);
   });
 
   proxy.post("/contract/salesmanSalesStatistics", queryForm).then((res) => {
+    sourceList.value.salesmanSalesData = res;
+    const option = { ...optionTwo };
+    option.data.xAxis[0].data = res.map((x) => x.userName);
+    option.data.series[0].data = res.map((x) => x.amount);
+    option.data.series[0].name = "销售额(¥)";
+    myChartTwo.setOption(option.data);
+    setTimeout(() => {
+      salesmanSalesLoading.value = false;
+    }, 200);
+  });
+
+  proxy.post("/contract/productSalesStatistics", queryForm).then((res) => {
     sourceList.value.productSalesVolumeData = res;
+    const option = { ...optionTwo };
+    option.data.xAxis[0].data = res.map((x) => x.productName);
+    option.data.series[0].data = res.map((x) => x.amount);
+    option.data.series[0].name = "销售额(¥)";
+    myChartThree.setOption(option.data);
     setTimeout(() => {
       productSalesLoading.value = false;
     }, 200);
   });
 
-  proxy.post("/contract/salesmanSalesStatistics", queryForm).then((res) => {
+  proxy.post("/contract/salesVolumeStatistics", queryForm).then((res) => {
     sourceList.value.productSalesVolumeOneData = res;
+    const option = { ...optionTwo };
+    option.data.xAxis[0].data = res.map((x) => x.productName);
+    option.data.series[0].data = res.map((x) => x.amount);
+    option.data.series[0].name = "销售量(个)";
+    myChartFour.setOption(option.data);
     setTimeout(() => {
       productSalesOneLoading.value = false;
     }, 200);
@@ -516,42 +570,46 @@ const getData = () => {
 };
 
 const onQuery = () => {
-  queryForm.beginTime = queryForm.timeArr[0];
-  queryForm.endTime = queryForm.timeArr[1];
+  if (queryForm.timeArr.length > 1) {
+    queryForm.beginTime = queryForm.timeArr[0];
+    queryForm.endTime = queryForm.timeArr[1];
+  } else {
+    queryForm.beginTime = "";
+    queryForm.endTime = "";
+  }
   getData();
 };
 
-const onReset = () => {};
+const onReset = () => {
+  queryForm.timeArr = [];
+  onQuery();
+};
+
 onMounted(() => {
   myChart = echarts.init(echartDom.value);
   window.addEventListener("resize", () => {
     myChart.resize();
   });
-  myChart.setOption(optionOne.data);
   // 客户分类柱状图
   myChartOne = echarts.init(echartDomOne.value);
   window.addEventListener("resize", () => {
     myChartOne.resize();
   });
-  myChartOne.setOption(optionTwo.data);
   // 业务员销售趋势柱状图
   myChartTwo = echarts.init(echartDomTwo.value);
   window.addEventListener("resize", () => {
     myChartTwo.resize();
   });
-  myChartTwo.setOption(optionTwo.data);
   //商品销售额柱状图
   myChartThree = echarts.init(echartDomThree.value);
   window.addEventListener("resize", () => {
     myChartThree.resize();
   });
-  myChartThree.setOption(optionTwo.data);
   // 商品销量柱状图
   myChartFour = echarts.init(echartDomFour.value);
   window.addEventListener("resize", () => {
     myChartFour.resize();
   });
-  myChartFour.setOption(optionTwo.data);
   getData();
 });
 </script>
@@ -622,9 +680,9 @@ onMounted(() => {
     background: linear-gradient(#ffebe9, #ffebe9);
   }
 }
-.scatter {
-  // display: flex;
-}
+// .scatter {
+//   display: flex;
+// }
 .public {
   display: flex;
 }

+ 5 - 0
src/views/product/material/index.vue

@@ -307,6 +307,11 @@ const formConfig = computed(() => {
       label: "规格型号",
     },
     {
+      type: "input",
+      prop: "barCode",
+      label: "条码编号",
+    },
+    {
       type: "select",
       prop: "unit",
       label: "单位",

+ 5 - 0
src/views/product/product/index.vue

@@ -309,6 +309,11 @@ const formConfig = computed(() => {
       label: "规格型号",
     },
     {
+      type: "input",
+      prop: "barCode",
+      label: "条码编号",
+    },
+    {
       type: "select",
       prop: "unit",
       label: "单位",

+ 5 - 0
src/views/product/product/index2.vue

@@ -309,6 +309,11 @@ const formConfig = computed(() => {
       label: "规格型号",
     },
     {
+      type: "input",
+      prop: "barCode",
+      label: "条码编号",
+    },
+    {
       type: "select",
       prop: "unit",
       label: "单位",

+ 15 - 3
src/views/salesMange/salesMange/performance/index.vue

@@ -8,6 +8,9 @@
               v-model="queryForm.time"
               type="year"
               placeholder="请选择"
+              format="YYYY"
+              value-format="YYYY"
+              clearable
               @change="onQuery"
             />
           </el-form-item>
@@ -15,6 +18,7 @@
             <el-select
               v-model="queryForm.userId"
               placeholder="请选择"
+              clearable
               @change="onQuery"
             >
               <el-option
@@ -355,7 +359,11 @@ const getDict = () => {
     });
 };
 const getList = async (req) => {
-  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  sourceList.value.pagination = {
+    ...sourceList.value.pagination,
+    ...req,
+    ...queryForm,
+  };
   loading.value = true;
   proxy.post("/commission/page", sourceList.value.pagination).then((res) => {
     sourceList.value.data = res.rows;
@@ -505,9 +513,13 @@ const submitChangeForm = () => {
       Number(haveOverallRatio) +
       Number(departmentalRatio) +
       Number(personalRatio);
-    if (sum > 100) return this.msgInfo("全部占比不可大于100%");
+    if (sum > 100)
+      return ElMessage({
+        message: "全部占比不可大于100%",
+        type: "info",
+      });
     proxy
-      .post("/commission/add", {
+      .post("/saleStatement/settlement", {
         commissionRule: formChangeData.data,
         ...rowData.value,
       })