Преглед изворни кода

轮胎商城统计分析(L)新增销售对账,应收总账(月),应付总账(月),利润总账(月)

wangzhuo пре 1 година
родитељ
комит
02df38b2db

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

@@ -0,0 +1,13 @@
+import request from '@/router/axios';
+
+export const getStatisticsList = (current, size, params) => {
+  return request({
+    url: '/api/blade-sales-part/order/statistics',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}

+ 12 - 0
src/enums/column-name.js

@@ -1257,6 +1257,18 @@ const columnName = [{
   {
     code: 283.1,
     name: '设备维修-维修项目'
+  },
+  {
+    code: 284,
+    name: '轮胎商城-统计分析-应收总账(月)'
+  },
+  {
+    code: 285,
+    name: '轮胎商城-统计分析-应付总账(月)'
+  },
+  {
+    code: 286,
+    name: '轮胎商城-统计分析-利润总账(月)'
   }
 ]
 export const getColumnName = (key) => {

+ 4 - 0
src/views/tirePartsMall/salesManagement/saleOrder/index.vue

@@ -385,6 +385,10 @@ export default {
       if (this.$route.query.type == 'S') {
         this.editOpen({ id: this.$route.query.detail.srcParentId }, 1)
       }
+      if (this.$route.query.jumpId) {
+        this.editOpen({ id: this.$route.query.jumpId }, 1)
+      }
+
       this.detailData = {
         id: this.$route.query.check.billId,
         check: this.$route.query.check,

+ 195 - 0
src/views/tirePartsMall/statisticAnalysis/generalLedgerPayable/detail.vue

@@ -0,0 +1,195 @@
+<template>
+  <div>
+    <div class="customer-head">
+      <div class="customer-back">
+        <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+                   @click="backToList">返回列表
+        </el-button>
+      </div>
+    </div>
+    <basic-container class="page-crad" style="margin-top: 30px">
+      <avue-crud
+        ref="crud"
+        :option="option"
+        :data="dataList"
+        :table-loading="loading"
+        :cell-style="cellStyle"
+        :key="crudIndex"
+      >
+<!--        <template slot="menuLeft">-->
+<!--          <el-button type="info" size="small" @click="outExport" icon="el-icon-download">导出</el-button>-->
+<!--        </template>-->
+        <template slot="accSysNo" slot-scope="scope">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="jumpPage(scope.row,scope.index)">{{ scope.row.accSysNo }}</span>
+        </template>
+      </avue-crud>
+    </basic-container>
+  </div>
+</template>
+
+<script>
+import {detail} from "@/api/statisticAnalysis/paymentLedger";
+import {getList} from "@/api/tirePartsMall/salesManagement/saleOrder";
+import { getToken } from "@/util/auth";
+
+export default {
+  name: "detail",
+  props: {
+    detailData: {
+      type: Object
+    },
+    tradeType: {
+      type: [Number, String]
+    }
+  },
+  data() {
+    return {
+      crudIndex: 0,
+      dataList: [],
+      loading: false,
+      option: {
+        searchShow: true,
+        align: "center",
+        searchSpan: 8,
+        border: true,
+        index: true,
+        addBtn: false,
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        cellBtn: false,
+        cancelBtn: false,
+        refreshBtn: false,
+        showSummary: true,
+        summaryText: '合计',
+        sumColumnList: [
+          {
+            name: 'totalMoney',
+            type: 'sum'
+          },
+          {
+            name: 'paymentAmountTl',
+            type: 'sum'
+          }
+        ],
+        searchIcon: true,
+        searchIndex: 2,
+        menu: false,
+        column: [
+          {
+            label: "客户",
+            prop: "customerName",
+            overHidden: true,
+          },
+          {
+            label: "订单号",
+            prop: "ordNo",
+            overHidden: true,
+          },
+          {
+            label: "业务时间",
+            prop: "businesDate",
+            overHidden: true,
+          },
+          {
+            label: "应付金额",
+            prop: "totalMoney",
+            overHidden: true,
+          },
+          {
+            label: "实付金额",
+            prop: "paymentAmountTl",
+            overHidden: true,
+          }
+        ],
+      },
+    }
+  },
+  created() {
+    if (this.detailData) {
+      this.queryData(this.detailData);
+    }
+  },
+  methods: {
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    // 日期格式化
+    dateFormatting(date) {
+      const year = date.getFullYear().toString().padStart(4, '0');
+      const month = (date.getMonth() + 1).toString().padStart(2, '0');
+      const day = date.getDate().toString().padStart(2, '0');
+      console.log(`${year}-${month}-${day}`)
+      return `${year}-${month}-${day}`
+    },
+    queryData(detailData) {
+      this.loading = true;
+      const date = new Date(detailData.businesDate);
+      const y = date.getFullYear()
+      const m = date.getMonth()
+      const startDate = new Date(y, m, 1);
+      const endDate = new Date(y, m + 1, 0);
+      const requestData = {
+        'customerId' : detailData.customerId,
+        'bsType' : 'CG',
+        'current' : 1,
+        'size' : 999999999,
+        'businesDateList[0]' : this.dateFormatting(startDate) + " 00:00:00",
+        'businesDateList[1]' : this.dateFormatting(endDate) + " 23:59:59"
+      };
+      getList(requestData).then(res => {
+        this.dataList = res.data.data.records;
+      }).finally(() => {
+        this.loading = false;
+        this.option.height = window.innerHeight - 180;
+        this.crudIndex++;
+      })
+      // detail(id, 'c', this.tradeType).then(res => {
+      //   this.dataList = res.data.data.records;
+      // }).finally(() => {
+      //   this.loading = false;
+      //   this.option.height = window.innerHeight - 180;
+      //   this.crudIndex++;
+      // })
+    },
+    backToList() {
+      this.$emit("goBack");
+    },
+    //导出
+    outExport() {
+      this.$confirm('是否导出应付总账详情信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        window.open(
+          `/api/trade-finance/dealWith/exportItem?${
+            this.website.tokenHeader
+          }=${getToken()}&dc=d&tradeType=${this.tradeType}&corpId=${this.detailData.id}`
+        );
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消' //
+        });
+      })
+    },
+    // 跳转页面
+    jumpPage(row, index) {
+      if (this.tradeType == '' || this.tradeType == 'JXS') {
+        this.$router.$avueRouter.closeTag("/dealer/purchase/index");
+        this.$router.push({
+          path: "/dealer/purchase/index",
+          query: {
+            params: row.srcParentId
+          },
+        });
+      }
+    },
+  },
+}
+</script>
+
+<style scoped>
+
+</style>

+ 445 - 0
src/views/tirePartsMall/statisticAnalysis/generalLedgerPayable/index.vue

@@ -0,0 +1,445 @@
+<template>
+  <div>
+    <basic-container class="page-crad" v-show="show">
+      <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"
+      >
+        <template slot="menuLeft">
+          <el-button
+            type="info"
+            icon="el-icon-printer"
+            size="small"
+            :loading="exportLoading"
+            @click.stop="statement"
+            v-if="false"
+          >报表打印
+          </el-button>
+          <el-button type="info" size="small" @click="outExport" icon="el-icon-download">导出</el-button>
+        </template>
+        <template slot="corpNameSearch">
+          <crop-select
+            v-model="search.corpId"
+            corpType="KG"
+          ></crop-select>
+        </template>
+        <template slot="sizeSearch">
+          <el-select
+            v-model="search.size"
+            placeholder="请选择"
+          >
+            <el-option label="是" :value="1"></el-option>
+            <el-option label="否" :value="0"></el-option>
+          </el-select>
+        </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>
+      </avue-crud>
+    </basic-container>
+    <report-dialog
+      :switchDialog="switchDialog"
+      :searchValue="statementData"
+      :reportName="'经销商-可用库存表'"
+      @onClose="onClose()"
+    />
+    <detail
+      v-if="!show"
+      :detail-data="detailData"
+      :trade-type="tradeType"
+      @goBack="goBack"
+    ></detail>
+  </div>
+</template>
+
+<script>
+import { getToken } from "@/util/auth";
+import { getList } from "@/api/statisticAnalysis/paymentLedger";
+import { getStatisticsList } from "@/api/tireMall/tirePartsMall/statisticAnalysis/index";
+import { micrometerFormat } from "@/util/validate";
+import _ from "lodash";
+import reportDialog from "@/components/report-dialog/main";
+import { gainUser } from "@/api/basicData/customerInquiry";
+import detail from "./detail";
+
+export default {
+  name: "index",
+  components: {
+    reportDialog,
+    detail
+  },
+  data() {
+    return {
+      exportLoading:false,
+      switchDialog:false,
+      statementData: {},
+      form: {},
+      search: {},
+      dataList: [],
+      loading: false,
+      detailData: {},
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      option: {},
+      defaultOption: {
+        searchShow: true,
+        align: "center",
+        searchSpan: 8,
+        border: true,
+        index: true,
+        addBtn: false,
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        showSummary: true,
+        summaryText: '合计',
+        sumColumnList: [
+          {
+            name: 'totalMoney',
+            type: 'sum'
+          },
+          {
+            name: 'paymentAmountTl',
+            type: 'sum'
+          },
+          {
+            name: 'outstandingAmount',
+            type: 'sum'
+          },
+        ],
+        searchIcon: true,
+        searchIndex: 2,
+        menu: false,
+        column: [
+          {
+            label: '客户',
+            prop: "customerName",
+            type: "select",
+            search: true,
+            overHidden: true,
+            props: {
+              label: 'cname',
+              value: 'id'
+            },
+            dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=KH&enableOrNot=0',
+
+          },
+          {
+            label: "业务日期",
+            prop: "businesDate",
+            type: 'date',
+            format: "yyyy-MM",
+            valueFormat: "yyyy-MM",
+            unlinkPanels: true,
+            searchRange: true,
+            overHidden: true,
+          },
+          {
+            label: "业务日期",
+            prop: "businesDateList",
+            search: true,
+            type: 'monthrange',
+            format: "yyyy-MM",
+            valueFormat: "yyyy-MM",
+            unlinkPanels: true,
+            searchRange: true,
+            overHidden: true,
+            hide: true
+          },
+          // {
+          //   label: "是否显示金额为0",
+          //   prop: "size",
+          //   search: true,
+          //   overHidden: true,
+          //   hide: true,
+          //   showColumn: false
+          // },
+          {
+            label: "应付金额",
+            prop: "totalMoney",
+            search: false,
+            overHidden: true,
+          },
+          {
+            label: "实付金额",
+            prop: "paymentAmountTl",
+            search: false,
+            overHidden: true,
+          },
+          {
+            label: "未付金额",
+            prop: "outstandingAmount",
+            search: false,
+            overHidden: true,
+          },
+        ],
+      },
+      // 仓库配置
+      configurationWarehouse: {
+        multipleChoices: false,
+        multiple: false,
+        collapseTags: false,
+        placeholder: "请点击右边按钮选择",
+        dicData: [],
+      },
+      brandOption: [],
+      userList: [],
+      tradeType: '',
+      sysitemType: null,
+      show: true,
+    };
+  },
+  filters: {
+    decimalFormat(num) {
+      return num ? Number(num).toFixed(2) : "0.00";
+    }
+  },
+  async created() {
+    // this.option = await this.getColumnData(this.getColumnName(285), this.defaultOption);
+    this.option = this.defaultOption;
+    this.getWorkDicts('brand').then(res => {
+      this.brandOption = res.data.data;
+    })
+    gainUser().then(res => {
+      this.userList = res.data.data;
+    });
+
+    let i = 0;
+    this.option.column.forEach(item => {
+      if (item.search) i++
+    })
+    if (i % 3 !== 0){
+      const num = 3 - Number(i % 3)
+      this.option.searchMenuSpan = num * 8;
+      this.option.searchMenuPosition = "right";
+    }
+  },
+  methods: {
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    searchReset() {
+    },
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.option.height = this.option.height - 46;
+      } else {
+        this.option.height = this.option.height + 46;
+      }
+      this.$refs.crud.getTableHeight();
+    },
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.search);
+    },
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+    sizeChange(val) {
+      this.page.currentPage = 1;
+      this.page.pageSize = val;
+    },
+    onLoad(page, params) {
+      this.search.customerId = this.search.customerName
+      this.sysitemType = localStorage.getItem('sysitemType');
+      if (this.sysitemType == 999) {
+        this.tradeType = ''
+      } else if (this.sysitemType == 1) {
+        this.tradeType = 'XX'
+      } else if (this.sysitemType == 2) {
+        this.tradeType = 'GN'
+      } else if (this.sysitemType == 3) {
+        this.tradeType = 'JK'
+      } else if (this.sysitemType == 4) {
+        this.tradeType = 'CK'
+      } else if (this.sysitemType == 5) {
+        this.tradeType = 'SW'
+      } else if (this.sysitemType == 6) {
+        this.tradeType = 'JXS'
+      } else if (this.sysitemType == 7) {
+        this.tradeType = 'LY'
+      }
+      this.loading = true;
+      this.dataList.forEach(item => {
+        this.$refs.crud.toggleRowExpansion(item, false);
+      });
+      // let queryParams = this.deepClone(Object.assign({ tradeType: this.tradeType, type: 'c' }, params, this.search));
+      let queryParams = this.deepClone(Object.assign({ type: 1 }, params, this.search));
+      if (queryParams.accDate && queryParams.accDate.length > 0) {
+        queryParams = {
+          ...queryParams,
+          accDateStart: queryParams.accDate[0] + ' 00:00:00',
+          accDateEnd: queryParams.accDate[1] + ' 23:59:59',
+        }
+        delete queryParams.accDate;
+      }
+      getStatisticsList(
+        page.currentPage,
+        page.pageSize,
+        queryParams
+      )
+        .then(res => {
+          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) {
+            this.option.height = window.innerHeight - 230;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    editOpen(row) {
+      if (row.billType == "BJ") {
+        this.$router.push({
+          path: "/exportTrade/customerInquiry/index",
+          query: {
+            id: row.id
+          }
+        });
+      } else {
+        this.$router.push({
+          path: "/exportTrade/salesContract/index",
+          query: {
+            id: row.id
+          }
+        });
+      }
+    },
+    statement() {
+      this.statementData = {...this.search};
+      if (this.statementData.accDate && this.statementData.accDate.length > 0) {
+        this.statementData.accDateStart = this.statementData.accDate[0]+ " " + "00:00:00"
+        this.statementData.accDateEnd = this.statementData.accDate[1]+ " " + "23:59:59"
+        delete this.statementData.accDate
+      }
+      this.switchDialog = !this.switchDialog;
+    },
+    onClose(val) {
+      this.switchDialog = val;
+    },
+    //列保存触发
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(138),
+        this.option
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      this.option = this.defaultOption;
+      const inSave = await this.delColumnData(this.getColumnName(285), this.defaultOption);
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout()
+        })
+        this.$message.success("重置成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    // 跳转到详情
+    beforeOpenPage(row, index) {
+      this.detailData = {
+        customerId: row.customerId,
+        businesDate: row.businesDate
+      };
+      this.show = false;
+    },
+    goBack() {
+      this.detailData=this.$options.data().detailData
+      if (JSON.stringify(this.$route.query) != "{}") {
+        this.$router.$avueRouter.closeTag();
+        this.$router.push({
+          path: "/statisticAnalysis/collectLedger/index"
+        });
+      }
+      this.dataList.forEach(item => {
+        this.$refs.crud.toggleRowExpansion(item, false)
+      })
+      this.show = true;
+      this.onLoad(this.page, this.search);
+    },
+    outExport() {
+      if (!this.search.corpId) this.$set(this.search, 'corpId', '');
+      if (this.search.accDate && this.search.accDate.length > 0) {
+        this.search = {
+          ...this.search,
+          accDateStart: this.search.accDate[0] + ' 00:00:00',
+          accDateEnd: this.search.accDate[1] + ' 23:59:59',
+        }
+      } else {
+        this.search = {
+          ...this.search,
+          accDateStart: '',
+          accDateEnd: '',
+        }
+      }
+      this.$confirm('是否导出应付总账信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        window.open(
+          `/api/blade-sales-part/order/statistics-export?${this.website.tokenHeader
+          }=${getToken()}&type=1&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}`
+        );
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消' //
+        });
+      })
+    },
+  }
+};
+</script>
+
+<style scoped>
+.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%;
+}
+</style>

+ 196 - 0
src/views/tirePartsMall/statisticAnalysis/generalLedgerReceivable/detail.vue

@@ -0,0 +1,196 @@
+<template>
+  <div>
+    <div class="customer-head">
+      <div class="customer-back">
+        <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+                   @click="backToList">返回列表
+        </el-button>
+      </div>
+    </div>
+    <basic-container class="page-crad" style="margin-top: 30px">
+      <avue-crud
+        ref="crud"
+        :option="option"
+        :data="dataList"
+        :table-loading="loading"
+        :cell-style="cellStyle"
+        :key="crudIndex"
+      >
+<!--        <template slot="menuLeft">-->
+<!--          <el-button type="info" size="small" @click="outExport" icon="el-icon-download">导出</el-button>-->
+<!--        </template>-->
+        <template slot="accSysNo" slot-scope="scope">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="jumpPage(scope.row,scope.index)">{{ scope.row.accSysNo }}</span>
+        </template>
+      </avue-crud>
+    </basic-container>
+  </div>
+</template>
+
+<script>
+import {detail} from "@/api/statisticAnalysis/collectLedger";
+import {getList} from "@/api/tirePartsMall/salesManagement/saleOrder";
+import { getToken } from "@/util/auth";
+
+export default {
+  name: "detail",
+  props: {
+    detailData: {
+      type: Object
+    },
+    tradeType: {
+      type: [Number, String]
+    }
+  },
+  data() {
+    return {
+      crudIndex: 0,
+      dataList: [],
+      loading: false,
+      option: {
+        searchShow: true,
+        align: "center",
+        searchSpan: 8,
+        border: true,
+        index: true,
+        addBtn: false,
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        cellBtn: false,
+        cancelBtn: false,
+        refreshBtn: false,
+        showSummary: true,
+        summaryText: '合计',
+        sumColumnList: [
+          {
+            name: 'totalMoney',
+            type: 'sum'
+          },
+          {
+            name: 'true',
+            type: 'sum'
+          }
+        ],
+        searchIcon: true,
+        searchIndex: 2,
+        menu: false,
+        column: [
+          {
+            label: "客户",
+            prop: "customerName",
+            overHidden: true,
+          },
+          {
+            label: "订单号",
+            prop: "ordNo",
+            overHidden: true,
+          },
+          {
+            label: "业务时间",
+            prop: "businesDate",
+            overHidden: true,
+          },
+          {
+            label: "应收金额",
+            prop: "totalMoney",
+            overHidden: true,
+          },
+          {
+            label: "实收金额",
+            prop: "paymentAmountTl",
+            overHidden: true,
+          }
+        ],
+      },
+    }
+  },
+  created() {
+    if (this.detailData) {
+      this.queryData(this.detailData);
+    }
+  },
+  methods: {
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    // 日期格式化
+    dateFormatting(date) {
+      const year = date.getFullYear().toString().padStart(4, '0');
+      const month = (date.getMonth() + 1).toString().padStart(2, '0');
+      const day = date.getDate().toString().padStart(2, '0');
+      console.log(`${year}-${month}-${day}`)
+      return `${year}-${month}-${day}`
+    },
+    queryData(detailData) {
+      this.loading = true;
+      const date = new Date(detailData.businesDate);
+      const y = date.getFullYear()
+      const m = date.getMonth()
+      const startDate = new Date(y, m, 1);
+      const endDate = new Date(y, m + 1, 0);
+      const requestData = {
+        'customerId': detailData.customerId,
+        'bsType': 'XS',
+        'current': 1,
+        'size': 999999999,
+        'businesDateList[0]' : this.dateFormatting(startDate) + " 00:00:00",
+        'businesDateList[1]' : this.dateFormatting(endDate) + " 23:59:59"
+      };
+      getList(requestData).then(res => {
+        this.dataList = res.data.data.records;
+      }).finally(() => {
+        this.loading = false;
+        this.option.height = window.innerHeight - 180;
+        this.crudIndex++;
+      })
+      // detail(id, 'd', this.tradeType).then(res => {
+      //   this.dataList = res.data.data.records;
+      // }).finally(() => {
+      //   this.loading = false;
+      //   this.option.height = window.innerHeight - 180;
+      //   this.crudIndex++;
+      // })
+    },
+    backToList() {
+      this.$emit("goBack");
+    },
+    //导出
+    outExport() {
+      console.log(this.tradeType)
+      this.$confirm('是否导出应收总账详情信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        window.open(
+          `/api/trade-finance/receivable/exportItem?${
+            this.website.tokenHeader
+          }=${getToken()}&dc=d&tradeType=${this.tradeType}&corpId=${this.detailData.id}`
+        );
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消' //
+        });
+      })
+    },
+    // 跳转页面
+    jumpPage(row, index) {
+      if (this.tradeType == '' || this.tradeType == 'JXS') {
+        this.$router.$avueRouter.closeTag("/dealer/sales/index");
+        this.$router.push({
+          path: "/dealer/sales/index",
+          query: {
+            params: row.srcParentId
+          },
+        });
+      }
+    },
+  },
+}
+</script>
+
+<style scoped>
+
+</style>

+ 411 - 0
src/views/tirePartsMall/statisticAnalysis/generalLedgerReceivable/index.vue

@@ -0,0 +1,411 @@
+<template>
+  <div>
+    <basic-container class="page-crad" v-show="show">
+      <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">
+        <template slot="menuLeft">
+          <el-button type="info" icon="el-icon-printer" size="small" :loading="exportLoading" @click.stop="statement"
+            v-if="false">报表打印</el-button>
+          <el-button type="info" size="small" @click="outExport" icon="el-icon-download">导出</el-button>
+        </template>
+        <template slot="corpNameSearch">
+          <crop-select v-model="search.corpId" corpType="KG"></crop-select>
+        </template>
+        <template slot="sizeSearch">
+          <el-select v-model="search.size" placeholder="请选择">
+            <el-option label="是" :value="1"></el-option>
+            <el-option label="否" :value="0"></el-option>
+          </el-select>
+        </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>
+      </avue-crud>
+    </basic-container>
+    <report-dialog :switchDialog="switchDialog" :searchValue="statementData" :reportName="'经销商-可用库存表'"
+      @onClose="onClose()" />
+    <detail v-if="!show" :detail-data="detailData" :trade-type="tradeType" @goBack="goBack"></detail>
+  </div>
+</template>
+
+<script>
+import { getToken } from "@/util/auth";
+import { getList } from "@/api/statisticAnalysis/collectLedger";
+import { getStatisticsList } from "@/api/tireMall/tirePartsMall/statisticAnalysis/index";
+import { micrometerFormat } from "@/util/validate";
+import _ from "lodash";
+import reportDialog from "@/components/report-dialog/main";
+import { gainUser } from "@/api/basicData/customerInquiry";
+import detail from "./detail";
+
+export default {
+  name: "index",
+  components: {
+    reportDialog,
+    detail
+  },
+  data() {
+    return {
+      exportLoading: false,
+      switchDialog: false,
+      statementData: {},
+      form: {},
+      search: {},
+      dataList: [],
+      loading: false,
+      detailData: {},
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      option: {},
+      defaultOption: {
+        searchShow: true,
+        align: "center",
+        searchSpan: 8,
+        border: true,
+        index: true,
+        addBtn: false,
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        showSummary: true,
+        summaryText: '合计',
+        sumColumnList: [
+          {
+            name: 'totalMoney',
+            type: 'sum'
+          },
+          {
+            name: 'paymentAmountTl',
+            type: 'sum'
+          },
+          {
+            name: 'outstandingAmount',
+            type: 'sum'
+          },
+        ],
+        searchIcon: true,
+        searchIndex: 2,
+        menu: false,
+        column: [
+          {
+            label: '客户',
+            prop: "customerName",
+            type: "select",
+            search: true,
+            overHidden: true,
+            props: {
+              label: 'cname',
+              value: 'id'
+            },
+            dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=KH&enableOrNot=0',
+
+          },
+          {
+            label: "业务日期",
+            prop: "businesDate",
+            type: 'date',
+            format: "yyyy-MM",
+            valueFormat: "yyyy-MM",
+            unlinkPanels: true,
+            searchRange: true,
+            overHidden: true,
+          },
+          {
+            label: "业务日期",
+            prop: "businesDateList",
+            search: true,
+            type: 'monthrange',
+            format: "yyyy-MM",
+            valueFormat: "yyyy-MM",
+            unlinkPanels: true,
+            searchRange: true,
+            overHidden: true,
+            hide: true
+          },
+          // {
+          //   label: "是否显示金额为0",
+          //   prop: "size",
+          //   search: true,
+          //   overHidden: true,
+          //   hide: true,
+          //   showColumn: false
+          // },
+          {
+            label: "应收金额",
+            prop: "totalMoney",
+            search: false,
+            overHidden: true,
+          },
+          {
+            label: "实收金额",
+            prop: "paymentAmountTl",
+            search: false,
+            overHidden: true,
+          },
+          {
+            label: "未收金额",
+            prop: "outstandingAmount",
+            search: false,
+            overHidden: true,
+          }
+        ],
+      },
+      // 仓库配置
+      configurationWarehouse: {
+        multipleChoices: false,
+        multiple: false,
+        collapseTags: false,
+        placeholder: "请点击右边按钮选择",
+        dicData: [],
+      },
+      brandOption: [],
+      userList: [],
+      tradeType: '',
+      sysitemType: null,
+      show: true,
+    };
+  },
+  filters: {
+    decimalFormat(num) {
+      return num ? Number(num).toFixed(2) : "0.00";
+    }
+  },
+  async created() {
+    // this.option = await this.getColumnData(this.getColumnName(284), this.defaultOption);
+    this.option = this.defaultOption;
+    this.getWorkDicts('brand').then(res => {
+      this.brandOption = res.data.data;
+    })
+    gainUser().then(res => {
+      this.userList = res.data.data;
+    });
+    let i = 0;
+    this.option.column.forEach(item => {
+      if (item.search) i++
+    })
+    if (i % 3 !== 0) {
+      const num = 3 - Number(i % 3)
+      this.option.searchMenuSpan = num * 8;
+      this.option.searchMenuPosition = "right";
+    }
+  },
+  methods: {
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.option.height = this.option.height - 46;
+      } else {
+        this.option.height = this.option.height + 46;
+      }
+      this.$refs.crud.getTableHeight();
+    },
+    searchReset() {
+    },
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.search);
+    },
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+    sizeChange(val) {
+      this.page.currentPage = 1;
+      this.page.pageSize = val;
+    },
+    onLoad(page, params) {
+      this.search.customerId = this.search.customerName
+      this.sysitemType = localStorage.getItem('sysitemType');
+      if (this.sysitemType == 999) {
+        this.tradeType = ''
+      } else if (this.sysitemType == 1) {
+        this.tradeType = 'XX'
+      } else if (this.sysitemType == 2) {
+        this.tradeType = 'GN'
+      } else if (this.sysitemType == 3) {
+        this.tradeType = 'JK'
+      } else if (this.sysitemType == 4) {
+        this.tradeType = 'CK'
+      } else if (this.sysitemType == 5) {
+        this.tradeType = 'SW'
+      } else if (this.sysitemType == 6) {
+        this.tradeType = 'JXS'
+      } else if (this.sysitemType == 7) {
+        this.tradeType = 'LY'
+      }
+      this.loading = true;
+      this.dataList.forEach(item => {
+        this.$refs.crud.toggleRowExpansion(item, false);
+      });
+      let queryParams = this.deepClone(Object.assign({ type: 0 }, params, this.search));
+      if (queryParams.accDate && queryParams.accDate.length > 0) {
+        queryParams = {
+          ...queryParams,
+          accDateStart: queryParams.accDate[0] + ' 00:00:00',
+          accDateEnd: queryParams.accDate[1] + ' 23:59:59',
+        }
+        delete queryParams.accDate;
+      }
+      getStatisticsList(
+        page.currentPage,
+        page.pageSize,
+        queryParams
+      )
+        .then(res => {
+          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) {
+            this.option.height = window.innerHeight - 230;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    editOpen(row) {
+      if (row.billType == "BJ") {
+        this.$router.push({
+          path: "/exportTrade/customerInquiry/index",
+          query: {
+            id: row.id
+          }
+        });
+      } else {
+        this.$router.push({
+          path: "/exportTrade/salesContract/index",
+          query: {
+            id: row.id
+          }
+        });
+      }
+    },
+    statement() {
+      this.statementData = { ...this.search };
+      if (this.statementData.accDate && this.statementData.accDate.length > 0) {
+        this.statementData.accDateStart = this.statementData.accDate[0] + " " + "00:00:00"
+        this.statementData.accDateEnd = this.statementData.accDate[1] + " " + "23:59:59"
+        delete this.statementData.accDate
+      }
+      this.switchDialog = !this.switchDialog;
+    },
+    onClose(val) {
+      this.switchDialog = val;
+    },
+    //列保存触发
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(137),
+        this.option
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      this.option = this.defaultOption;
+      const inSave = await this.delColumnData(this.getColumnName(284), this.defaultOption);
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout()
+        })
+        this.$message.success("重置成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    // 跳转到详情
+    beforeOpenPage(row, index) {
+      this.detailData = {
+        customerId: row.customerId,
+        businesDate: row.businesDate
+      };
+      this.show = false;
+    },
+    goBack() {
+      this.detailData = this.$options.data().detailData
+      if (JSON.stringify(this.$route.query) != "{}") {
+        this.$router.$avueRouter.closeTag();
+        this.$router.push({
+          path: "/statisticAnalysis/collectLedger/index"
+        });
+      }
+      this.dataList.forEach(item => {
+        this.$refs.crud.toggleRowExpansion(item, false)
+      })
+      this.show = true;
+      this.onLoad(this.page, this.search);
+    },
+    outExport() {
+      if (!this.search.corpId) this.$set(this.search, 'corpId', '');
+      if (this.search.accDate && this.search.accDate.length > 0) {
+        this.search = {
+          ...this.search,
+          accDateStart: this.search.accDate[0] + ' 00:00:00',
+          accDateEnd: this.search.accDate[1] + ' 23:59:59',
+        }
+      } else {
+        this.search = {
+          ...this.search,
+          accDateStart: '',
+          accDateEnd: '',
+        }
+      }
+      this.$confirm('是否导出应收总账信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        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}`
+        );
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消' //
+        });
+      })
+    },
+  }
+};
+</script>
+
+<style scoped>
+.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%;
+}
+</style>

+ 244 - 0
src/views/tirePartsMall/statisticAnalysis/profitLedger/detail.vue

@@ -0,0 +1,244 @@
+<template>
+  <div>
+    <div class="customer-head">
+      <div class="customer-back">
+        <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+                   @click="backToList">返回列表
+        </el-button>
+      </div>
+    </div>
+    <basic-container class="page-crad" style="margin-top: 30px">
+      <avue-crud
+        ref="crud"
+        :option="option"
+        :data="dataList"
+        :table-loading="loading"
+        :cell-style="cellStyle"
+        :key="crudIndex"
+      >
+<!--        <template slot="menuLeft">-->
+<!--          <el-button type="info" size="small" @click="outExport" icon="el-icon-download">导出</el-button>-->
+<!--        </template>-->
+        <template slot="accSysNo" slot-scope="scope">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="jumpPage(scope.row,scope.index)">{{ scope.row.accSysNo }}</span>
+        </template>
+      </avue-crud>
+    </basic-container>
+  </div>
+</template>
+
+<script>
+import {detail} from "@/api/statisticAnalysis/profitLedger";
+import {getList} from "@/api/tirePartsMall/salesManagement/saleOrder";
+import { getToken } from "@/util/auth";
+
+export default {
+  name: "detail",
+  props: {
+    detailData: {
+      type: Object
+    },
+    tradeType: {
+      type: [Number, String]
+    }
+  },
+  data() {
+    return {
+      crudIndex: 0,
+      dataList: [],
+      loading: false,
+      option: {
+        searchShow: true,
+        align: "center",
+        searchSpan: 8,
+        border: true,
+        index: true,
+        addBtn: false,
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        cellBtn: false,
+        cancelBtn: false,
+        refreshBtn: false,
+        showSummary: true,
+        summaryText: '合计',
+        sumColumnList: [
+          {
+            name: 'goodsTotalNum',
+            type: 'sum'
+          },
+          {
+            name: 'numberRows',
+            type: 'sum'
+          },
+          {
+            name: 'totalMoney',
+            type: 'sum'
+          },
+          {
+            name: 'paymentAmountTl',
+            type: 'sum'
+          },
+          {
+            name: 'cost',
+            type: 'sum'
+          },
+          {
+            name: 'grossProfit',
+            type: 'sum'
+          },
+        ],
+        searchIcon: true,
+        searchIndex: 2,
+        menu: false,
+        column: [
+          {
+            label: "客户",
+            prop: "customerName",
+            overHidden: true,
+          },
+          {
+            label: "订单号",
+            prop: "ordNo",
+            overHidden: true,
+          },
+          {
+            label: "业务日期",
+            prop: "businesDate",
+            overHidden: true,
+          },
+          {
+            label: "数量",
+            prop: "goodsTotalNum",
+            overHidden: true,
+          },
+          {
+            label: "行数",
+            prop: "numberRows",
+            overHidden: true,
+          },
+          {
+            label: "收入",
+            prop: "totalMoney",
+            overHidden: true,
+          },
+          {
+            label: "实收",
+            prop: "paymentAmountTl",
+            overHidden: true,
+          },
+          {
+            label: "成本",
+            prop: "cost",
+            overHidden: true,
+          },
+          {
+            label: "利润",
+            prop: "grossProfit",
+            overHidden: true,
+          },
+        ],
+      },
+    }
+  },
+  created() {
+    if (this.detailData) {
+      this.queryData(this.detailData);
+    }
+  },
+  methods: {
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    // 日期格式化
+    dateFormatting(date) {
+      const year = date.getFullYear().toString().padStart(4, '0');
+      const month = (date.getMonth() + 1).toString().padStart(2, '0');
+      const day = date.getDate().toString().padStart(2, '0');
+      console.log(`${year}-${month}-${day}`)
+      return `${year}-${month}-${day}`
+    },
+    queryData(detailData) {
+      this.loading = true;
+      const date = new Date(detailData.businesDate);
+      const y = date.getFullYear()
+      const m = date.getMonth()
+      const startDate = new Date(y, m, 1);
+      const endDate = new Date(y, m + 1, 0);
+      const requestData = {
+        'customerId': detailData.customerId,
+        'bsType': 'XS',
+        'current': 1,
+        'size': 999999999,
+        'businesDateList[0]' : this.dateFormatting(startDate) + " 00:00:00",
+        'businesDateList[1]' : this.dateFormatting(endDate) + " 23:59:59"
+      };
+      getList(requestData).then(res => {
+        this.dataList = res.data.data.records;
+      }).finally(() => {
+        this.loading = false;
+        this.option.height = window.innerHeight - 180;
+        this.crudIndex++;
+      })
+
+      // detail(id, this.tradeType).then(res => {
+      //   this.dataList = res.data.data.records;
+      // }).finally(() => {
+      //   this.loading = false;
+      //   this.option.height = window.innerHeight - 180;
+      //   this.crudIndex++;
+      // })
+    },
+    backToList() {
+      this.$emit("goBack");
+    },
+    //导出
+    outExport() {
+      this.$confirm('是否导出应付总账详情信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        window.open(
+          `/api/trade-finance/profit/exportItem?${
+            this.website.tokenHeader
+          }=${getToken()}&dc=d&tradeType=${this.tradeType}&corpId=${this.detailData.id}`
+        );
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消' //
+        });
+      })
+    },
+    // 跳转页面
+    jumpPage(row, index) {
+      if (row.billType == '申请') {
+        if (this.tradeType == '' || this.tradeType == 'JXS') {
+          this.$router.$avueRouter.closeTag("/dealer/purchase/index");
+          this.$router.push({
+            path: "/dealer/purchase/index",
+            query: {
+              params: row.srcParentId
+            },
+          });
+        }
+      } else if (row.billType == '收费') {
+        if (this.tradeType == '' || this.tradeType == 'JXS') {
+          this.$router.$avueRouter.closeTag("/dealer/sales/index");
+          this.$router.push({
+            path: "/dealer/sales/index",
+            query: {
+              params: row.srcParentId
+            },
+          });
+        }
+      }
+    },
+  },
+}
+</script>
+
+<style scoped>
+
+</style>

+ 406 - 0
src/views/tirePartsMall/statisticAnalysis/profitLedger/index.vue

@@ -0,0 +1,406 @@
+<template>
+  <div>
+    <basic-container class="page-crad" v-show="show">
+      <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">
+        <template slot="menuLeft">
+          <el-button type="info" icon="el-icon-printer" size="small" :loading="exportLoading" @click.stop="statement"
+            v-if="false">报表打印
+          </el-button>
+          <el-button type="info" size="small" @click="outExport" icon="el-icon-download">导出</el-button>
+        </template>
+        <template slot="corpNameSearch">
+          <crop-select v-model="search.corpId" corpType="KG"></crop-select>
+        </template>
+        <template slot="sizeSearch">
+          <el-select v-model="search.size" placeholder="请选择">
+            <el-option label="是" :value="1"></el-option>
+            <el-option label="否" :value="0"></el-option>
+          </el-select>
+        </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>
+      </avue-crud>
+    </basic-container>
+    <report-dialog :switchDialog="switchDialog" :searchValue="statementData" :reportName="'经销商-可用库存表'"
+      @onClose="onClose()" />
+    <detail v-if="!show" :detail-data="detailData" :trade-type="tradeType" @goBack="goBack"></detail>
+  </div>
+</template>
+
+<script>
+import { getToken } from "@/util/auth";
+import { getList } from "@/api/statisticAnalysis/profitLedger";
+import { getStatisticsList } from "@/api/tireMall/tirePartsMall/statisticAnalysis/index";
+import { micrometerFormat } from "@/util/validate";
+import _ from "lodash";
+import reportDialog from "@/components/report-dialog/main";
+import { gainUser } from "@/api/basicData/customerInquiry";
+import detail from "./detail";
+
+export default {
+  name: "index",
+  components: {
+    reportDialog,
+    detail
+  },
+  data() {
+    return {
+      exportLoading: false,
+      switchDialog: false,
+      statementData: {},
+      form: {},
+      search: {},
+      dataList: [],
+      loading: false,
+      detailData: {},
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      option: {},
+      defaultOption: {
+        searchShow: true,
+        align: "center",
+        searchSpan: 8,
+        searchMenuSpan: 8,
+        border: true,
+        index: true,
+        addBtn: false,
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        showSummary: true,
+        summaryText: '合计',
+        sumColumnList: [
+          {
+            name: 'totalMoney',
+            type: 'sum'
+          },
+          {
+            name: 'cost',
+            type: 'sum'
+          },
+          {
+            name: 'profit',
+            type: 'sum'
+          },
+        ],
+        searchIcon: true,
+        searchIndex: 2,
+        menu: false,
+        column: [
+          {
+            label: '客户',
+            prop: "customerName",
+            type: "select",
+            search: true,
+            overHidden: true,
+            props: {
+              label: 'cname',
+              value: 'id'
+            },
+            dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=KH&enableOrNot=0',
+
+          },
+          {
+            label: "业务日期",
+            prop: "businesDate",
+            type: 'date',
+            format: "yyyy-MM",
+            valueFormat: "yyyy-MM",
+            unlinkPanels: true,
+            searchRange: true,
+            overHidden: true,
+          },
+          {
+            label: "业务日期",
+            prop: "businesDateList",
+            search: true,
+            type: 'monthrange',
+            format: "yyyy-MM",
+            valueFormat: "yyyy-MM",
+            unlinkPanels: true,
+            searchRange: true,
+            overHidden: true,
+            hide: true
+          },
+          {
+            label: "应收金额",
+            prop: "totalMoney",
+            search: false,
+            overHidden: true,
+          },
+          {
+            label: "成本金额",
+            prop: "cost",
+            search: false,
+            overHidden: true,
+          },
+          {
+            label: "利润金额",
+            prop: "profit",
+            search: false,
+            overHidden: true,
+          },
+        ],
+      },
+      // 仓库配置
+      configurationWarehouse: {
+        multipleChoices: false,
+        multiple: false,
+        collapseTags: false,
+        placeholder: "请点击右边按钮选择",
+        dicData: [],
+      },
+      brandOption: [],
+      userList: [],
+      tradeType: '',
+      sysitemType: null,
+      show: true,
+    };
+  },
+  filters: {
+    decimalFormat(num) {
+      return num ? Number(num).toFixed(2) : "0.00";
+    }
+  },
+  async created() {
+    // this.option = await this.getColumnData(this.getColumnName(286), this.defaultOption);
+    this.option = this.defaultOption;
+    this.getWorkDicts('brand').then(res => {
+      this.brandOption = res.data.data;
+    })
+    gainUser().then(res => {
+      this.userList = res.data.data;
+    });
+
+    let i = 0;
+    this.option.column.forEach(item => {
+      if (item.search) i++
+    })
+    if (i % 3 !== 0) {
+      const num = 3 - Number(i % 3)
+      this.option.searchMenuSpan = num * 8;
+      this.option.searchMenuPosition = "right";
+    }
+  },
+  methods: {
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    searchReset() {
+    },
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.option.height = this.option.height - 46;
+      } else {
+        this.option.height = this.option.height + 46;
+      }
+      this.$refs.crud.getTableHeight();
+    },
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.search);
+    },
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+    sizeChange(val) {
+      this.page.currentPage = 1;
+      this.page.pageSize = val;
+    },
+    onLoad(page, params) {
+      this.search.customerId = this.search.customerName
+      this.sysitemType = localStorage.getItem('sysitemType');
+      if (this.sysitemType == 999) {
+        this.tradeType = ''
+      } else if (this.sysitemType == 1) {
+        this.tradeType = 'XX'
+      } else if (this.sysitemType == 2) {
+        this.tradeType = 'GN'
+      } else if (this.sysitemType == 3) {
+        this.tradeType = 'JK'
+      } else if (this.sysitemType == 4) {
+        this.tradeType = 'CK'
+      } else if (this.sysitemType == 5) {
+        this.tradeType = 'SW'
+      } else if (this.sysitemType == 6) {
+        this.tradeType = 'JXS'
+      } else if (this.sysitemType == 7) {
+        this.tradeType = 'LY'
+      }
+      this.loading = true;
+      this.dataList.forEach(item => {
+        this.$refs.crud.toggleRowExpansion(item, false);
+      });
+          let queryParams = this.deepClone(Object.assign({ type: 0}, params, this.search));
+      if (queryParams.accDate && queryParams.accDate.length > 0) {
+        queryParams = {
+          ...queryParams,
+          accDateStart: queryParams.accDate[0],
+          accDateEnd: queryParams.accDate[1],
+        }
+        delete queryParams.accDate;
+      }
+      getStatisticsList(
+        page.currentPage,
+        page.pageSize,
+        queryParams
+      )
+        .then(res => {
+          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) {
+            this.option.height = window.innerHeight - 230;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    editOpen(row) {
+      if (row.billType == "BJ") {
+        this.$router.push({
+          path: "/exportTrade/customerInquiry/index",
+          query: {
+            id: row.id
+          }
+        });
+      } else {
+        this.$router.push({
+          path: "/exportTrade/salesContract/index",
+          query: {
+            id: row.id
+          }
+        });
+      }
+    },
+    statement() {
+      this.statementData = { ...this.search };
+      if (this.statementData.accDate && this.statementData.accDate.length > 0) {
+        this.statementData.accDateStart = this.statementData.accDate[0]
+        this.statementData.accDateEnd = this.statementData.accDate[1]
+        delete this.statementData.accDate
+      }
+      this.switchDialog = !this.switchDialog;
+    },
+    onClose(val) {
+      this.switchDialog = val;
+    },
+    //列保存触发
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(139),
+        this.option
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      this.option = this.defaultOption;
+      const inSave = await this.delColumnData(this.getColumnName(286), this.defaultOption);
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout()
+        })
+        this.$message.success("重置成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    // 跳转到详情
+    beforeOpenPage(row, index) {
+      this.detailData = {
+        customerId: row.customerId,
+        businesDate: row.businesDate
+      };
+      this.show = false;
+    },
+    goBack() {
+      this.detailData = this.$options.data().detailData
+      if (JSON.stringify(this.$route.query) != "{}") {
+        this.$router.$avueRouter.closeTag();
+        this.$router.push({
+          path: "/statisticAnalysis/collectLedger/index"
+        });
+      }
+      this.dataList.forEach(item => {
+        this.$refs.crud.toggleRowExpansion(item, false)
+      })
+      this.show = true;
+      this.onLoad(this.page, this.search);
+    },
+    outExport() {
+      if (!this.search.corpId) this.$set(this.search, 'corpId', '');
+      if (this.search.accDate && this.search.accDate.length > 0) {
+        this.search = {
+          ...this.search,
+          accDateStart: this.search.accDate[0],
+          accDateEnd: this.search.accDate[1]
+        }
+      } else {
+        this.search = {
+          ...this.search,
+          accDateStart: '',
+          accDateEnd: '',
+        }
+      }
+      this.$confirm('是否导出应付总账信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        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}`
+        );
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消' //
+        });
+      })
+    },
+  }
+};
+</script>
+
+<style scoped>
+.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%;
+}
+</style>

+ 370 - 0
src/views/tirePartsMall/statisticAnalysis/salesReconciliation/index.vue

@@ -0,0 +1,370 @@
+<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">
+        <template slot="menuLeft">
+          <el-button type="info" size="small" @click="outExport" icon="el-icon-download">导出</el-button>
+        </template>
+        <template slot="corpNameSearch">
+          <crop-select v-model="search.corpId" corpType="KH"></crop-select>
+        </template>
+        <template slot="storageNameSearch">
+          <warehouse-select v-model="search.storageId" :configuration="configurationWarehouse" />
+        </template>
+        <template slot-scope="{ row }" slot="ordNo">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row)">{{ row.ordNo }}
+          </span>
+        </template>
+        <template slot-scope="{ row }" slot="customerId">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row)">{{ row.customerName }}
+          </span>
+        </template>
+      </avue-crud>
+    </basic-container>
+  </div>
+</template>
+
+<script>
+import { getToken } from "@/util/auth";
+// import { getList } from "@/api/statisticAnalysis/salesReconciliation";
+import {getListOrder} from "@/api/financialManagement/paymentRequest";
+import { getStore } from '@/util/store'
+import { micrometerFormat } from "@/util/validate";
+import _ from "lodash";
+import { Row } from "element-ui";
+export default {
+  name: "index",
+  data() {
+    return {
+      form: {},
+      search: {},
+      dataList: [],
+      loading: false,
+      detailData: {},
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      option: {},
+      defaultOption: {
+        searchShow: true,
+        align: "center",
+        searchMenuSpan: 16,
+        searchSpan: 8,
+        border: true,
+        index: true,
+        addBtn: false,
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        showSummary: true,
+        searchIcon: true,
+        searchIndex: 2,
+        menu: false,
+        column: [
+          {
+            label: "系统编号",
+            prop: "ordNo",
+            search: true,
+            overHidden: true
+          },
+          // {
+          //   label: "客户名称",
+          //   prop: "corpName",
+          //   search: true,
+          //   overHidden: true
+          // },
+          {
+            label: '业务对象',
+            prop: "customerId",
+            search: true,
+            remote: true,
+            overHidden: true,
+            type: 'select',
+            props: {
+              label: 'cname',
+              value: 'id'
+            },
+            dicUrl: '/api/blade-sales-part/corpsDesc/listAll?corpType=KH&cname={{key}}',
+          },
+          // {
+          //   label: "业务日期",
+          //   prop: "createTime",
+          //   search: true,
+          //   type: "date",
+          //   format: "yyyy-MM-dd",
+          //   valueFormat: "yyyy-MM-dd",
+          //   unlinkPanels: true,
+          //   searchRange: true,
+          //   overHidden: true
+          // },
+
+          {
+            label: '业务日期',
+            prop: "businesDate",
+            overHidden: true,
+            searchProp: "businesDateList",
+            type: "date",
+            overHidden: true,
+            search: true,
+            width: 100,
+            searchRange: true,
+            searchDefaultTime: ["00:00:00", "23:59:59"],
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd HH:mm:ss"
+          },
+          // {
+          //   label: "业务员",
+          //   prop: "chargeMember",
+          //   search: true,
+          //   overHidden: true
+          // },
+          {
+            label: '业务员',
+            disabled: false,
+            prop: "salerId",
+            search: true,
+            type: "select",
+            props: {
+              label: "name",
+              value: "id"
+            },
+            dicUrl: "/api/blade-user/client/getUserByRole",
+            filterable: true,
+            rules: [{
+              required: true,
+              message: " ",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "收入",
+            prop: "totalMoney",
+            search: false,
+            overHidden: true
+          },
+          {
+            label: "实收",
+            prop: "paymentAmountTl",
+            search: false,
+            overHidden: true
+          },
+          {
+            label: "成本",
+            prop: "cost",
+            search: false,
+            overHidden: true
+          },
+          {
+            label: "利润",
+            prop: "grossProfit",
+            search: false,
+            overHidden: true
+          }
+        ]
+      },
+      // 仓库配置
+      configurationWarehouse: {
+        multipleChoices: false,
+        multiple: false,
+        collapseTags: false,
+        placeholder: "请点击右边按钮选择",
+        dicData: []
+      }
+    };
+  },
+  filters: {
+    decimalFormat(num) {
+      return num ? Number(num).toFixed(2) : "0.00";
+    }
+  },
+  async created() {
+    // this.option = await this.getColumnData(
+    //   this.getColumnName(126),
+    //   this.defaultOption
+    // );
+    this.option = this.defaultOption;
+    let i = 0;
+    this.option.column.forEach(item => {
+      if (item.search) i++;
+    });
+    if (i % 3 !== 0) {
+      const num = 3 - Number(i % 3);
+      this.option.searchMenuSpan = num * 8;
+      this.option.searchMenuPosition = "right";
+    }
+  },
+  methods: {
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.option.height = this.option.height - 46;
+      } else {
+        this.option.height = this.option.height + 46;
+      }
+      this.$refs.crud.getTableHeight();
+    },
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    refreshChange() {
+      delete this.search.corpName;
+      delete this.search.storageName;
+      this.onLoad(this.page, this.search);
+    },
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+    sizeChange(val) {
+      this.page.currentPage = 1;
+      this.page.pageSize = val;
+    },
+    onLoad(page, params = {}) {
+      let data = this.deepClone(Object.assign({bsType: 'XS'}, params, this.search));
+      if (data.createTime) {
+        data.beginCreateTime = data.createTime[0]
+        data.endCreateTime = data.createTime[1]
+        delete data.createTime
+      }
+      getListOrder(page.currentPage, page.pageSize, data)
+        .then(res => {
+          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) {
+            this.option.height = window.innerHeight - 210;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+      // getList(page.currentPage, page.pageSize, data)
+      //   .then(res => {
+      //     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) {
+      //       this.option.height = window.innerHeight - 210;
+      //     }
+      //   })
+      //   .finally(() => {
+      //     this.loading = false;
+      //   });
+    },
+    editOpen(row) {
+      let tagList = []
+      tagList = getStore({
+        name: 'tagList'
+      })
+      if (tagList.find(e => e.label == '销售订单(L)')) {
+        return this.$message.error('请关闭销售订单(L)标签')
+      }
+
+      this.$router.push({
+        path: "/tirePartsMall/salesManagement/saleOrder/index",
+        query: {
+          jumpId: row.id
+        }
+      });
+    },
+    outExport() {
+      if (!this.search.corpId) this.$set(this.search, "corpId", "");
+      if (this.search.createTime && this.search.createTime.length > 0) {
+        this.search = {
+          ...this.search,
+          orderStartDate: this.search.createTime[0] + " 00:00:00",
+          orderEndDate: this.search.createTime[1] + " 23:59:59"
+        };
+      } else {
+        this.search = {
+          ...this.search,
+          beginCreateTime: "",
+          endCreateTime: ""
+        };
+      }
+      // return console.log(this.search)
+      this.$confirm("是否导出销售对账信息?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          window.open(
+            `/api/blade-purchase-sales/exportOrder/reconciliationExport?${this.website.tokenHeader
+            }=${getToken()}&corpId=${this.search.corpId}&chargeMember=${this.search.chargeMember}&sysNo=${this.search.sysNo
+            }&beginCreateTime=${this.search.beginCreateTime}&endCreateTime =${this.search.endCreateTime
+            }`
+          );
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消" //
+          });
+        });
+    },
+    //列保存触发
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(126),
+        this.option
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      this.option = this.defaultOption;
+      const inSave = await this.delColumnData(
+        this.getColumnName(126),
+        this.defaultOption
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.$message.success("重置成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    }
+  }
+};
+</script>
+
+<style scoped>
+.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%;
+}
+</style>