Browse Source

修改bug

Qukatie 1 year ago
parent
commit
bcbf707e64

+ 8 - 0
src/api/tireMall/tirePartsMall/statisticAnalysis/index.js

@@ -11,3 +11,11 @@ export const getStatisticsList = (current, size, params) => {
     }
   })
 }
+//查询列表
+export const statisticsSum = (params) => {
+  return request({
+    url: '/api/blade-sales-part/order/statisticsSum',
+    method: 'get',
+    params: params
+  })
+}

+ 1 - 1
src/api/tirePartsMall/salesAnalysis.js

@@ -15,4 +15,4 @@ export const salespersonCustomerSum = (params) => {
     method: 'get',
     params: params
   })
-}
+}

+ 9 - 0
src/api/tirePartsMall/salesManagement/saleOrder.js

@@ -7,6 +7,15 @@ export const getList = (params) => {
     params: params
   })
 }
+//查询列表
+export const statisticsDetails = (params) => {
+  return request({
+    url: '/api/blade-sales-part/order/statisticsDetails',
+    method: 'get',
+    params: params
+  })
+}
+
 //删除
 export const remove = (data) => {
   return request({

+ 14 - 7
src/views/tirePartsMall/activity/detailsPage.vue

@@ -11,7 +11,7 @@
                     @click="releasefun">发 布</el-button>
                 <el-button v-if="form.status == 1" type="warning" size="small" :disabled="!form.id"
                     @click="releasefun">撤销发布</el-button>
-                <el-button class="el-button--small-yh" type="primary" size="small" @click="editCustomer">保存数据</el-button>
+                <el-button class="el-button--small-yh" type="primary" size="small" @click="editCustomer" :disabled="form.status==1">保存数据</el-button>
             </div>
         </div>
         <div style="margin-top: 50px">
@@ -20,7 +20,7 @@
                     <template slot="activePictures">
                         <div style="display: flex;align-items: center;justify-content: center;">
                             <el-input v-model="form.activePictures" :disabled="true" placeholder="请输入内容"></el-input>
-                            <el-button type="primary" size="small" icon="el-icon-edit" @click="addPicture">上传</el-button>
+                            <el-button type="primary" size="small" icon="el-icon-edit" @click="addPicture" :disabled="form.status==1">上传</el-button>
                         </div>
                     </template>
                 </avue-form>
@@ -34,16 +34,16 @@
                     @saveColumn="saveColumnTwo('crud', 'optionDetails', 'optionDetailsBack', 339.1)">
                     <template slot="menuLeft">
                         <el-button icon="el-icon-plus" type="primary" size="small"
-                            @click="detailsAddButton">添加数据</el-button>
+                            @click="detailsAddButton" :disabled="form.status==1">添加数据</el-button>
                         <el-button type="danger" size="small" icon="el-icon-delete" plain
-                            @click="multipleActivityitemsRemovefun">删 除
+                            @click="multipleActivityitemsRemovefun" :disabled="form.status==1">删 除
                         </el-button>
                     </template>
                     <template slot-scope="{row,index}" slot="menu">
-                        <el-button type="text" size="small" @click="detailsRowCell(row, index)">{{ row.$cellEdit ? '确认' :
+                        <el-button type="text" size="small" @click="detailsRowCell(row, index)" :disabled="form.status==1">{{ row.$cellEdit ? '确认' :
                             '修改' }}</el-button>
-                        <el-button type="text" size="small" @click="activityitemsRemovefun(row, index)">删除</el-button>
-                        <el-button type="text" size="small" @click="changingtheImage(row, index)">换图</el-button>
+                        <el-button type="text" size="small" @click="activityitemsRemovefun(row, index)" :disabled="form.status==1">删除</el-button>
+                        <el-button type="text" size="small" @click="changingtheImage(row, index)" :disabled="form.status==1">换图</el-button>
                     </template>
                 </avue-crud>
             </trade-card>
@@ -81,6 +81,7 @@ export default {
             optionForm: {
                 menuBtn: false,
                 span: 6,
+                disabled:false,
                 column: [{
                     label: '活动名称',
                     prop: "activityName",
@@ -445,7 +446,13 @@ export default {
         // 详情获取数据
         activityDetailfun(id) {
             activityDetail(id).then(res => {
+                if(res.data.data.status==1){
+                    this.optionForm.disabled=true
+                }else{
+                    this.optionForm.disabled=false
+                }
                 this.form = res.data.data
+                
             })
         },
         // 详情确认按钮

+ 13 - 1
src/views/tirePartsMall/salesManagement/purchaseOrder/detailsPage.vue

@@ -2169,8 +2169,20 @@ export default {
             // this.$refs.formContacts.rowAdd()
         },
         uploadAfter(res, done, loading, column) {
-            if (res instanceof Array) {
+            if(Array.isArray(res)){
+                if (res instanceof Array) {
                 this.form.orderItemsList = this.form.orderItemsList.concat(res)
+                res.forEach(item => {
+                    dotList({
+                        storageId: this.form.storageId,
+                        goodsId: res.goodsId
+                    }).then(e => {
+                        this.findObject(this.optionContactsBack.column, "dot").dicData = e.data.data
+                    })
+                })
+            }
+            }else{
+                this.$message.error(res)
             }
             this.excelBox = false;
             loading = false;

+ 99 - 3
src/views/tirePartsMall/salesManagement/saleOrder/detailsPage.vue

@@ -85,6 +85,12 @@
                             <template slot-scope="{scope,row}" slot="menuLeft">
                                 <el-button type="primary" icon="el-icon-plus" size="small" :disabled="isAddBtn"
                                     @click="rowAdd(row)">添加商品</el-button>
+                                <el-button type="success" size="small" :disabled="isAddBtn" icon="el-icon-bottom"
+                                    @click="excelDialogfun('名称')">按名称导入
+                                </el-button>
+                                <el-button type="success" size="small" :disabled="isAddBtn" icon="el-icon-bottom"
+                                    @click="excelDialogfun('code')">按Code导入
+                                </el-button>
                                 <el-button type="primary" icon="el-icon-printer" size="small"
                                     @click="handlePrint">打印</el-button>
                                 <el-button type="danger" plain size="small" @click="batchDelete"
@@ -166,6 +172,20 @@
                                 </el-button>
                             </template>
                         </avue-crud>
+                        <el-dialog title="导入明细" append-to-body :visible.sync="excelBox" v-if="excelBox" width="555px"
+                            :close-on-click-modal="false" v-dialog-drag>
+                            <avue-form :option="excelOption" v-model="excelForm" table-loading="excelLoading"
+                                :upload-before="uploadBefore" :upload-after="uploadAfter">
+                                <template slot="excelTemplate">
+                                    <el-button type="primary" @click="derivation">
+                                        点击下载<i class="el-icon-download el-icon--right"></i>
+                                    </el-button>
+                                </template>
+                            </avue-form>
+                            <p style="text-align: center;color: #DC0505">
+                                温馨提示 第一次导入时请先下载模板
+                            </p>
+                        </el-dialog>
                     </el-tab-pane>
                     <el-tab-pane label="支付明细" name="payment_details">
                         <avue-crud :option="optionPaymentDetails" v-model="formContacts" ref="payment_details"
@@ -277,6 +297,7 @@
                     </basic-container>
                 </el-col>
             </el-row>
+
             <span slot="footer" class="dialog-footer">
                 <el-button @click="dialogVisible = false" :loading="saveLoading">取 消</el-button>
                 <el-button type="primary" @click="importGoods" v-if="commodityData !== true"
@@ -324,11 +345,13 @@ import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
 import {
     getList as KHgetList
 } from "@/api/tirePartsMall/basicData/customerInformation";
+import { getToken } from "@/util/auth";
 export default {
     name: "detailsPage",
 
     data() {
         return {
+            excelBox: false,
             reportName: '', // 打印传的名字
             SelectSearch: {}, // 添加商品检索
             // 编辑还是保存
@@ -364,6 +387,7 @@ export default {
                     value: "id",
                 }
             },
+            templateUrl: '', // 模板url
             // 表格需要的配置
             optionTwo: commodityxsho,
             loading: false,
@@ -418,6 +442,32 @@ export default {
                 paymentRecordsList: [],
                 outboundRecordsList: []
             },
+            excelOption: {
+                submitBtn: false,
+                emptyBtn: false,
+                column: [
+                    {
+                        label: "模板下载",
+                        prop: "excelTemplate",
+                        formslot: true,
+                        span: 24
+                    },
+                    {
+                        label: "导入明细",
+                        prop: "excelFile",
+                        type: "upload",
+                        drag: true,
+                        loadText: "上传中,请稍等",
+                        accept: '.xls,.xlsx',
+                        span: 24,
+                        propsHttp: {
+                            res: "data"
+                        },
+                        tip: "请上传 .xls,.xlsx 标准格式文件",
+                        action: "/api/blade-sales-part/ship/import-item"
+                    }
+                ]
+            },
             customerData: [], // 客户数据
             optionForm: {
                 menuBtn: false,
@@ -1106,7 +1156,7 @@ export default {
                     this.formContacts.propertyName = res.data.data.specificationAndModel
                     this.formContacts.pattern = res.data.data.brandItem
                     this.formContacts.goodsDescription = res.data.data.goodsDescription
-                    this.formContacts.units = res.data.data.unit
+                    this.formContacts.dotListunits = res.data.data.unit
                     this.sharedCompanyId = res.data.data.sharedCompanyId
                     this.formContacts.sharedCompanyId = res.data.data.sharedCompanyId
                     //
@@ -1279,6 +1329,52 @@ export default {
         }
     },
     methods: {
+        uploadAfter(res, done, loading, column) {
+            if(Array.isArray(res)){
+                if (res instanceof Array) {
+                this.form.orderItemsList = this.form.orderItemsList.concat(res)
+                res.forEach(item => {
+                    dotList({
+                        storageId: this.form.storageId,
+                        goodsId: res.goodsId
+                    }).then(e => {
+                        this.findObject(this.optionContactsBack.column, "dot").dicData = e.data.data
+                    })
+                })
+            }
+            }else{
+                this.$message.error(res)
+            }
+
+            this.excelBox = false;
+            loading = false;
+            done(res);
+        },
+        derivation() {
+            window.open(
+                `${this.templateUrl}?${this.website.tokenHeader
+                }=${getToken()}&stockId=${this.form.storageId}`
+            );
+        },
+        uploadBefore(file, done, loading) {
+            done();
+            loading = true;
+        },
+        // 销售明细 导入按钮
+        excelDialogfun(name) {
+            if (!this.form.customerId) {
+                this.$message.error('请选择客户')
+                return
+            }
+            if (name == '名称') {
+                this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/order/import-item-name'
+                this.templateUrl = '/api/blade-sales-part/order/export-item-name'
+            } else if (name == 'code') {
+                this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/order/import-item-code'
+                this.templateUrl = '/api/blade-sales-part/order/export-item-code'
+            }
+            this.excelBox = true
+        },
         //生成退货单
         getReturns() {
             this.$confirm("您确定要退货吗?", {
@@ -1997,8 +2093,8 @@ export default {
                             break
                         }
                     }
-                    this.form.salerName=this.form.$salerId?this.form.$salerId:''
-                    this.form.storageName=this.form.$storageId?this.form.$storageId:''
+                    this.form.salerName = this.form.$salerId ? this.form.$salerId : ''
+                    this.form.storageName = this.form.$storageId ? this.form.$storageId : ''
                     submit({
                         bsType: "XS",
                         ...this.form

+ 3 - 3
src/views/tirePartsMall/statisticAnalysis/generalLedgerPayable/detail.vue

@@ -29,7 +29,7 @@
 
 <script>
 import {detail} from "@/api/statisticAnalysis/paymentLedger";
-import {getList} from "@/api/tirePartsMall/salesManagement/saleOrder";
+import {statisticsDetails} from "@/api/tirePartsMall/salesManagement/saleOrder";
 import { getToken } from "@/util/auth";
 
 export default {
@@ -143,8 +143,8 @@ export default {
       this.customerId = detailData.customerId
       this.startDate = this.dateFormatting(startDate) + " 00:00:00"
       this.endDate = this.dateFormatting(endDate) + " 23:59:59"
-      getList(requestData).then(res => {
-        this.dataList = res.data.data.records;
+      statisticsDetails(requestData).then(res => {
+        this.dataList = res.data.data;
       }).finally(() => {
         this.loading = false;
         this.option.height = window.innerHeight - 180;

+ 51 - 15
src/views/tirePartsMall/statisticAnalysis/generalLedgerPayable/index.vue

@@ -19,6 +19,13 @@
         @search-criteria-switch="searchCriteriaSwitch"
         @search-reset="searchReset"
       >
+      <template slot="header">
+          <el-table :data="commodityData" border size="small" @header-click="cellClick" style="width: 100%"
+            v-loading="itemloading">
+            <el-table-column v-for="(item, index) in commodityLabel" :key="index" :prop="item.prop" show-overflow-tooltip
+              :label="item.label" />
+          </el-table>
+        </template>
         <template slot="menuLeft">
           <el-button
             type="info"
@@ -46,6 +53,9 @@
             <el-option label="否" :value="0"></el-option>
           </el-select>
         </template>
+        <template slot="whetherSettlementSearch">
+          <el-checkbox v-model="search.whetherSettlement" :true-label="1" :false-label="0"></el-checkbox>
+        </template>
         <template slot="customerName" slot-scope="scope">
           <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.customerName }}</span>
         </template>
@@ -69,7 +79,7 @@
 <script>
 import { getToken } from "@/util/auth";
 import { getList } from "@/api/statisticAnalysis/paymentLedger";
-import { getStatisticsList } from "@/api/tireMall/tirePartsMall/statisticAnalysis/index";
+import { getStatisticsList, statisticsSum } from "@/api/tireMall/tirePartsMall/statisticAnalysis/index";
 import { micrometerFormat } from "@/util/validate";
 import _ from "lodash";
 import reportDialog from "@/components/report-dialog/main";
@@ -84,11 +94,30 @@ export default {
   },
   data() {
     return {
+      itemloading: false,
+      commodityLabel: [
+        {
+          id: 1,
+          label: "应收金额",
+          prop: "totalMoney",
+        }, {
+          id: 2,
+          label: "实收金额",
+          prop: "paymentAmountTl",
+        }, {
+          id: 3,
+          label: "未收金额",
+          prop: "outstandingAmount",
+        }
+      ],
+      commodityData: [], // 合计数据
       exportLoading:false,
       switchDialog:false,
       statementData: {},
       form: {},
-      search: {},
+      search: {
+        whetherSettlement:0
+      },
       dataList: [],
       loading: false,
       detailData: {},
@@ -102,7 +131,9 @@ export default {
       defaultOption: {
         searchShow: true,
         align: "center",
-        searchSpan: 8,
+        searchIndex: 3,
+        searchSpan: 6,
+        searchMenuSpan: 6,
         border: true,
         index: true,
         addBtn: false,
@@ -126,7 +157,6 @@ export default {
           },
         ],
         searchIcon: true,
-        searchIndex: 2,
         menu: false,
         column: [
           {
@@ -139,8 +169,7 @@ export default {
               label: 'cname',
               value: 'id'
             },
-            dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=KH&enableOrNot=0',
-
+            dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=KH&enableOrNot=1',
           },
           {
             label: "业务日期",
@@ -164,14 +193,12 @@ export default {
             overHidden: true,
             hide: true
           },
-          // {
-          //   label: "是否显示金额为0",
-          //   prop: "size",
-          //   search: true,
-          //   overHidden: true,
-          //   hide: true,
-          //   showColumn: false
-          // },
+          {
+            label: "结清不显示",
+            prop: "whetherSettlement",
+            search: true,
+            hide: true
+          },
           {
             label: "应付金额",
             prop: "totalMoney",
@@ -213,8 +240,8 @@ export default {
     }
   },
   async created() {
+    this.option = this.defaultOption;
     this.option = await this.getColumnData(this.getColumnName(285), this.defaultOption);
-    // this.option = this.defaultOption;
     this.getWorkDicts('brand').then(res => {
       this.brandOption = res.data.data;
     })
@@ -309,6 +336,12 @@ export default {
           }
           this.dataList = res.data.data.records ? res.data.data.records : [];
           this.page.total = res.data.data.total;
+          this.itemloading = true,
+            statisticsSum({type:1,...queryParams}).then(res => {
+              this.commodityData= [res.data.data]
+            }).finally(() => {
+              this.itemloading = false;
+            });
           if (this.page.total) {
             this.option.height = window.innerHeight - 230;
           }
@@ -442,4 +475,7 @@ export default {
 .itemTable ::v-deep .el-table {
   width: 100%;
 }
+/deep/ .el-col-md-8 {
+  width: 24.33333%;
+}
 </style>

+ 6 - 5
src/views/tirePartsMall/statisticAnalysis/generalLedgerReceivable/detail.vue

@@ -29,7 +29,7 @@
 
 <script>
 import {detail} from "@/api/statisticAnalysis/collectLedger";
-import {getList} from "@/api/tirePartsMall/salesManagement/saleOrder";
+import {statisticsDetails} from "@/api/tirePartsMall/salesManagement/saleOrder";
 import { getToken } from "@/util/auth";
 
 export default {
@@ -71,7 +71,7 @@ export default {
             type: 'sum'
           },
           {
-            name: 'true',
+            name: 'paymentAmountTl',
             type: 'sum'
           }
         ],
@@ -137,14 +137,15 @@ export default {
         'bsType': 'XS',
         'current': 1,
         'size': 999999999,
+        'salerId':detailData.salerId,
         'businesDateList[0]' : this.dateFormatting(startDate) + " 00:00:00",
         'businesDateList[1]' : this.dateFormatting(endDate) + " 23:59:59"
       };
       this.customerId = detailData.customerId
       this.startDate = this.dateFormatting(startDate) + " 00:00:00"
       this.endDate = this.dateFormatting(endDate) + " 23:59:59"
-      getList(requestData).then(res => {
-        this.dataList = res.data.data.records;
+      statisticsDetails(requestData).then(res => {
+        this.dataList = res.data.data;
       }).finally(() => {
         this.loading = false;
         this.option.height = window.innerHeight - 180;
@@ -172,7 +173,7 @@ export default {
         window.open(
           `/api/blade-sales-part/order/statistics-exportDetails?${
             this.website.tokenHeader
-          }=${getToken()}&exportType=2&customerId=${this.customerId}&bsType=CG&businesDateList[0]=${this.startDate}&businesDateList[1]=${this.endDate}`
+          }=${getToken()}&exportType=2&customerId=${this.customerId}&salerId=${this.salerId}&bsType=CG&businesDateList[0]=${this.startDate}&businesDateList[1]=${this.endDate}`
         );
       }).catch(() => {
         this.$message({

+ 39 - 9
src/views/tirePartsMall/statisticAnalysis/generalLedgerReceivable/index.vue

@@ -4,8 +4,14 @@
       <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" @search-reset="searchReset"
-        >
+        @resetColumn="resetColumn" @search-criteria-switch="searchCriteriaSwitch" @search-reset="searchReset">
+        <template slot="header">
+          <el-table :data="commodityData" border size="small" @header-click="cellClick" style="width: 100%"
+            v-loading="itemloading">
+            <el-table-column v-for="(item, index) in commodityLabel" :key="index" :prop="item.prop" show-overflow-tooltip
+              :label="item.label" />
+          </el-table>
+        </template>
         <template slot="menuLeft">
           <el-button type="info" icon="el-icon-printer" size="small" :loading="exportLoading" @click.stop="statement"
             v-if="false">报表打印</el-button>
@@ -39,7 +45,7 @@
 <script>
 import { getToken } from "@/util/auth";
 import { getList } from "@/api/statisticAnalysis/collectLedger";
-import { getStatisticsList } from "@/api/tireMall/tirePartsMall/statisticAnalysis/index";
+import { getStatisticsList, statisticsSum } from "@/api/tireMall/tirePartsMall/statisticAnalysis/index";
 import { micrometerFormat } from "@/util/validate";
 import _ from "lodash";
 import reportDialog from "@/components/report-dialog/main";
@@ -54,12 +60,29 @@ export default {
   },
   data() {
     return {
+      itemloading: false,
+      commodityLabel: [
+        {
+          id: 1,
+          label: "应收金额",
+          prop: "totalMoney",
+        }, {
+          id: 2,
+          label: "实收金额",
+          prop: "paymentAmountTl",
+        }, {
+          id: 3,
+          label: "未收金额",
+          prop: "outstandingAmount",
+        }
+      ],
+      commodityData: [], // 合计数据
       exportLoading: false,
       switchDialog: false,
       statementData: {},
       form: {},
       search: {
-        whetherSettlement:0
+        whetherSettlement: 0
       },
       dataList: [],
       loading: false,
@@ -111,7 +134,7 @@ export default {
             filterable: true,
             props: {
               label: 'cname',
-              value: 'cname'
+              value: 'id'
             },
             dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=KH&enableOrNot=1',
           },
@@ -126,7 +149,7 @@ export default {
             },
             dicUrl: "/api/blade-user/client/getUserByRole",
             filterable: true,
-            hide:true,
+            hide: true,
           },
           {
             label: '业务员',
@@ -299,6 +322,12 @@ export default {
           if (this.page.total) {
             this.option.height = window.innerHeight - 230;
           }
+          this.itemloading = true,
+            statisticsSum({type:0,...queryParams}).then(res => {
+              this.commodityData= [res.data.data]
+            }).finally(() => {
+              this.itemloading = false;
+            });
         })
         .finally(() => {
           this.loading = false;
@@ -338,7 +367,8 @@ export default {
     beforeOpenPage(row, index) {
       this.detailData = {
         customerId: row.customerId,
-        businesDate: row.businesDate
+        businesDate: row.businesDate,
+        salerId: row.salerId,
       };
       this.show = false;
     },
@@ -389,8 +419,8 @@ export default {
         });
       })
     },
-        //列保存触发
-        async saveColumn() {
+    //列保存触发
+    async saveColumn() {
       const inSave = this.saveColumnData(this.getColumnName(284), this.option);
       if (inSave) {
         this.$nextTick(() => {

+ 4 - 3
src/views/tirePartsMall/statisticAnalysis/profitLedger/detail.vue

@@ -29,7 +29,7 @@
 
 <script>
 import {detail} from "@/api/statisticAnalysis/profitLedger";
-import {getList} from "@/api/tirePartsMall/salesManagement/saleOrder";
+import {statisticsDetails} from "@/api/tirePartsMall/salesManagement/saleOrder";
 import { getToken } from "@/util/auth";
 
 export default {
@@ -173,14 +173,15 @@ export default {
         'bsType': 'XS',
         'current': 1,
         'size': 999999999,
+        'salerId':detailData.salerId,
         'businesDateList[0]' : this.dateFormatting(startDate) + " 00:00:00",
         'businesDateList[1]' : this.dateFormatting(endDate) + " 23:59:59"
       };
       this.customerId = detailData.customerId
       this.startDate = this.dateFormatting(startDate) + " 00:00:00"
       this.endDate = this.dateFormatting(endDate) + " 23:59:59"
-      getList(requestData).then(res => {
-        this.dataList = res.data.data.records;
+      statisticsDetails(requestData).then(res => {
+        this.dataList = res.data.data;
       }).finally(() => {
         this.loading = false;
         this.option.height = window.innerHeight - 180;

+ 76 - 13
src/views/tirePartsMall/statisticAnalysis/profitLedger/index.vue

@@ -5,6 +5,13 @@
         :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" @search-reset="searchReset">
+        <template slot="header">
+          <el-table :data="commodityData" border size="small" @header-click="cellClick" style="width: 100%"
+            v-loading="itemloading">
+            <el-table-column v-for="(item, index) in commodityLabel" :key="index" :prop="item.prop" show-overflow-tooltip
+              :label="item.label" />
+          </el-table>
+        </template>
         <template slot="menuLeft">
           <el-button type="info" icon="el-icon-printer" size="small" :loading="exportLoading" @click.stop="statement"
             v-if="false">报表打印
@@ -22,9 +29,12 @@
         </template>
         <template slot="customerName" slot-scope="scope">
           <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row, scope.index)">{{
-              scope.row.customerName
+            scope.row.customerName
           }}</span>
         </template>
+        <template slot="whetherSettlementSearch">
+          <el-checkbox v-model="search.whetherSettlement" :true-label="1" :false-label="0"></el-checkbox>
+        </template>
       </avue-crud>
     </basic-container>
     <report-dialog :switchDialog="switchDialog" :searchValue="statementData" :reportName="'经销商-可用库存表'"
@@ -36,7 +46,7 @@
 <script>
 import { getToken } from "@/util/auth";
 import { getList } from "@/api/statisticAnalysis/profitLedger";
-import { getStatisticsList } from "@/api/tireMall/tirePartsMall/statisticAnalysis/index";
+import { getStatisticsList, statisticsSum } from "@/api/tireMall/tirePartsMall/statisticAnalysis/index";
 import { micrometerFormat } from "@/util/validate";
 import _ from "lodash";
 import reportDialog from "@/components/report-dialog/main";
@@ -51,11 +61,30 @@ export default {
   },
   data() {
     return {
+      itemloading: false,
+      commodityLabel: [
+        {
+          id: 1,
+          label: "收入",
+          prop: "totalMoney",
+        }, {
+          id: 2,
+          label: "成本",
+          prop: "cost",
+        }, {
+          id: 3,
+          label: "利润",
+          prop: "profit",
+        }
+      ],
+      commodityData: [], // 合计数据
       exportLoading: false,
       switchDialog: false,
       statementData: {},
       form: {},
-      search: {},
+      search: {
+        whetherSettlement: 0,
+      },
       dataList: [],
       loading: false,
       detailData: {},
@@ -69,8 +98,8 @@ export default {
       defaultOption: {
         searchShow: true,
         align: "center",
-        searchSpan: 8,
-        searchMenuSpan: 8,
+        searchSpan: 6,
+        searchMenuSpan: 24,
         border: true,
         index: true,
         addBtn: false,
@@ -94,7 +123,7 @@ export default {
           },
         ],
         searchIcon: true,
-        searchIndex: 2,
+        searchIndex: 3,
         menu: false,
         column: [
           {
@@ -107,8 +136,31 @@ export default {
               label: 'cname',
               value: 'id'
             },
-            dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=KH&enableOrNot=0',
-
+            dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=KH&enableOrNot=1',
+          },
+          {
+            label: '业务员',
+            prop: "salerId",
+            search: true,
+            type: "select",
+            props: {
+              label: "name",
+              value: "id"
+            },
+            dicUrl: "/api/blade-user/client/getUserByRole",
+            filterable: true,
+            hide: true,
+          },
+          {
+            label: '业务员',
+            prop: "salerName",
+            overHidden: true,
+          },
+          {
+            label: "结清不显示",
+            prop: "whetherSettlement",
+            search: true,
+            hide: true
           },
           {
             label: "业务日期",
@@ -173,8 +225,8 @@ export default {
     }
   },
   async created() {
+    this.option = this.defaultOption;
     this.option = await this.getColumnData(this.getColumnName(286), this.defaultOption);
-    // this.option = this.defaultOption;
     this.getWorkDicts('brand').then(res => {
       this.brandOption = res.data.data;
     })
@@ -246,7 +298,7 @@ export default {
       this.dataList.forEach(item => {
         this.$refs.crud.toggleRowExpansion(item, false);
       });
-          let queryParams = this.deepClone(Object.assign({ type: 0}, params, this.search));
+      let queryParams = this.deepClone(Object.assign({ type: 0 }, params, this.search));
       if (queryParams.accDate && queryParams.accDate.length > 0) {
         queryParams = {
           ...queryParams,
@@ -268,6 +320,12 @@ export default {
           }
           this.dataList = res.data.data.records ? res.data.data.records : [];
           this.page.total = res.data.data.total;
+          this.itemloading = true,
+            statisticsSum({ type: 0, ...queryParams }).then(res => {
+              this.commodityData = [res.data.data]
+            }).finally(() => {
+              this.itemloading = false;
+            });
           if (this.page.total) {
             this.option.height = window.innerHeight - 230;
           }
@@ -336,7 +394,8 @@ export default {
     beforeOpenPage(row, index) {
       this.detailData = {
         customerId: row.customerId,
-        businesDate: row.businesDate
+        businesDate: row.businesDate,
+        salerId: row.salerId,
       };
       this.show = false;
     },
@@ -377,8 +436,8 @@ export default {
         window.open(
           `/api/blade-sales-part/order/statistics-export?${this.website.tokenHeader
           }=${getToken()}&type=0&businesDateList[0]=${this.search.businesDateList[0] == null || this.search.businesDateList[0] === undefined ? '' : this.search.businesDateList[0]
-          }&businesDateList[1]=${this.search.businesDateList[1] == null || this.search.businesDateList[1] === undefined  ? '' : this.search.businesDateList[1]
-          }&customerId=${this.search.customerName == null || this.search.customerName === undefined  ? '' : this.search.customerName}`
+          }&businesDateList[1]=${this.search.businesDateList[1] == null || this.search.businesDateList[1] === undefined ? '' : this.search.businesDateList[1]
+          }&customerId=${this.search.customerName == null || this.search.customerName === undefined ? '' : this.search.customerName}`
         );
       }).catch(() => {
         this.$message({
@@ -403,4 +462,8 @@ export default {
 .itemTable ::v-deep .el-table {
   width: 100%;
 }
+
+/deep/ .el-col-md-8 {
+  width: 24.33333%;
+}
 </style>