qukaidi преди 3 години
родител
ревизия
7f15e99a0d
променени са 1 файла, в които са добавени 44 реда и са изтрити 83 реда
  1. 44 83
      src/views/statisticAnalysis/salesmanCommission/index.vue

+ 44 - 83
src/views/statisticAnalysis/salesmanCommission/index.vue

@@ -1,79 +1,37 @@
 <template>
   <div>
     <basic-container class="page-crad">
-      <avue-crud
-        ref="crud"
-        :option="option"
-        :data="dataList"
-        :page.sync="page"
-        :search.sync="search"
-        :cell-style="cellStyle"
-        @search-change="searchChange"
-        @current-change="currentChange"
-        @size-change="sizeChange"
-        @refresh-change="refreshChange"
-        @on-load="onLoad"
-        :table-loading="loading"
-        @saveColumn="saveColumn"
-        @resetColumn="resetColumn"
-        @search-criteria-switch="searchCriteriaSwitch"
-      >
+      <avue-crud ref="crud" :option="option" :data="dataList" :page.sync="page" :search.sync="search"
+        :cell-style="cellStyle" @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
+        @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
+        @resetColumn="resetColumn" @search-criteria-switch="searchCriteriaSwitch">
         <template slot="menuLeft">
-          <el-button
-            type="info"
-            icon="el-icon-printer"
-            size="small"
-            :loading="exportLoading"
-            @click.stop="statement"
-          >报表打印
+          <el-button type="info" icon="el-icon-printer" size="small" :loading="exportLoading" @click.stop="statement">
+            报表打印
           </el-button>
         </template>
         <template slot="brandSearch">
-          <el-select
-            v-model="search.brand"
-            filterable
-            clearable
-            multiple
-            collapse-tags
-            placeholder="请选择 品牌"
-          >
-            <el-option
-              v-for="(item, index) in brandOption"
-              :key="index"
-              :label="item.dictValue"
-              :value="item.dictValue"
-            />
+          <el-select v-model="search.brand" filterable clearable placeholder="请选择 品牌">
+            <el-option v-for="(item, index) in brandOption" :key="index" :label="item.dictValue"
+              :value="item.dictValue" />
           </el-select>
         </template>
         <template slot="chargeMemberSearch">
-          <el-select
-            v-model="search.chargeMember"
-            filterable
-            clearable
-            placeholder="请选择 业务员"
-          >
-            <el-option
-              v-for="(item, index) in userList"
-              :key="index"
-              :label="item.realName"
-              :value="item.realName"
-            ></el-option>
+          <el-select v-model="search.chargeMember" filterable clearable placeholder="请选择 业务员">
+            <el-option v-for="(item, index) in userList" :key="index" :label="item.realName" :value="item.realName">
+            </el-option>
           </el-select>
         </template>
       </avue-crud>
     </basic-container>
-    <report-dialog
-      :switchDialog="switchDialog"
-      :searchValue="statementData"
-      :reportName="'经销商-可用库存表'"
-      @onClose="onClose()"
-    />
+    <report-dialog :switchDialog="switchDialog" :searchValue="statementData" :reportName="'经销商-可用库存表'"
+      @onClose="onClose()" />
   </div>
 </template>
 
 <script>
 import { getToken } from "@/util/auth";
-import { getList, exportExcel } from "@/api/statisticAnalysis/salesReconciliation";
+import { getList } from "@/api/statisticAnalysis/salesCommission";
 import { micrometerFormat } from "@/util/validate";
 import _ from "lodash";
 import reportDialog from "@/components/report-dialog/main";
@@ -86,8 +44,8 @@ export default {
   },
   data() {
     return {
-      exportLoading:false,
-      switchDialog:false,
+      exportLoading: false,
+      switchDialog: false,
       statementData: {},
       form: {},
       search: {},
@@ -124,13 +82,13 @@ export default {
           },
           {
             label: "业务员",
-            prop: "chargeMember",
+            prop: "salesName",
             search: true,
             overHidden: true,
           },
           {
             label: "制单日期",
-            prop: "createTime",
+            prop: "careteTime",
             search: true,
             type: 'date',
             format: "yyyy-MM-dd",
@@ -141,7 +99,7 @@ export default {
           },
           {
             label: "尺寸",
-            prop: "size",
+            prop: "specs",
             search: false,
             overHidden: true,
           },
@@ -182,7 +140,7 @@ export default {
     this.option.column.forEach(item => {
       if (item.search) i++
     })
-    if (i % 3 !== 0){
+    if (i % 3 !== 0) {
       const num = 3 - Number(i % 3)
       this.option.searchMenuSpan = num * 8;
       this.option.searchMenuPosition = "right";
@@ -219,30 +177,31 @@ export default {
       this.page.pageSize = val;
     },
     onLoad(page, params) {
-      this.loading = true;
-      this.dataList.forEach(item => {
-        this.$refs.crud.toggleRowExpansion(item, false);
-      });
-      let queryParams = Object.assign({}, params);
-      if (queryParams.businesDate && queryParams.businesDate.length > 0) {
-        queryParams = {
-          ...queryParams,
-          orderStartDate: queryParams.businesDate[0] + ' 00:00:00',
-          orderEndDate: queryParams.businesDate[1] + ' 23:59:59',
-        }
-        delete queryParams.businesDate;
+      if (this.search.careteTime && this.search.careteTime.length > 0) {
+        params = {
+          ...params,
+          beginCreateTime: this.search.careteTime[0],
+          endCreateTime: this.search.careteTime[1]
+        };
       }
+      let queryParams = Object.assign({}, params);
+      delete queryParams.careteTime;
+      // this.dataList.forEach(item => {
+      //   this.$refs.crud.toggleRowExpansion(item, false);
+      // });
+      this.loading = true;
+      console.log(queryParams)
       getList(
         page.currentPage,
         page.pageSize,
         queryParams
       )
         .then(res => {
-          if (res.data.data.records) {
-            res.data.data.records.forEach(e => {
-              e.itemLoading = true;
-            });
-          }
+          // if (res.data.data.records) {
+          //   res.data.data.records.forEach(e => {
+          //     e.itemLoading = true;
+          //   });
+          // }
           this.dataList = res.data.data.records ? res.data.data.records : [];
           this.page.total = res.data.data.total;
           if (this.page.total) {
@@ -271,10 +230,10 @@ export default {
       }
     },
     statement() {
-      this.statementData = {...this.search};
+      this.statementData = { ...this.search };
       if (this.statementData.createTime && this.statementData.createTime.length > 0) {
-        this.statementData.createStartTime = this.statementData.createTime[0]+ " " + "00:00:00"
-        this.statementData.createEndTime = this.statementData.createTime[1]+ " " + "23:59:59"
+        this.statementData.createStartTime = this.statementData.createTime[0] + " " + "00:00:00"
+        this.statementData.createEndTime = this.statementData.createTime[1] + " " + "23:59:59"
         delete this.statementData.createTime
       }
       this.switchDialog = !this.switchDialog;
@@ -317,9 +276,11 @@ export default {
 .page-crad ::v-deep .basic-container__card {
   height: 94.2vh;
 }
+
 ::v-deep .el-table__expanded-cell[class*="cell"] {
   padding: 0px;
 }
+
 .itemTable ::v-deep .el-table {
   width: 100%;
 }