Browse Source

线上支付账单

chenrui 6 tháng trước cách đây
mục cha
commit
a2bddcb80d

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1734051804409
+  "version": 1734061607009
 }

+ 13 - 1
src/config/router.config.js

@@ -710,7 +710,7 @@ export const asyncRouterMap = [
           {
             path: '/numsGoodsShelves/onlinePayInvoice',
             redirect: '/numsGoodsShelves/onlinePayInvoice/list',
-            name: 'ngsWithdrawalManagement',
+            name: 'onlinePayInvoice',
             component: BlankLayout,
             meta: {
               title: '线上支付账单',
@@ -729,6 +729,18 @@ export const asyncRouterMap = [
                   hidden: true
                   // permission: 'M_onlinePayInvoiceList'
                 }
+              },
+              {
+                path: 'detail/:shelfSn/:shelfName',
+                name: 'onlinePayInvoiceDetail',
+                component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/onlinePayInvoice/detail.vue'),
+                meta: {
+                  title: '线上支付明细',
+                  icon: 'monitor',
+                  hidden: true,
+                  replaceTab: true
+                  // permission: 'M_onlinePayInvoiceDetail'
+                }
               }
             ]
           },

+ 337 - 0
src/views/numsGoodsShelves/onlinePayInvoice/detail.vue

@@ -0,0 +1,337 @@
+<template>
+  <div v-if="showPage" class="jg-page-wrap salesDetail-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <span class="billno">【数字货架】:{{ 名称名称 }}</span>
+          <a-button type="link" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo" style="margin-left:10px;vertical-align:middle;">
+            <a-icon :type="isShowBisiceInfo ? 'eye-invisible' : 'eye'"/>
+            {{ isShowBisiceInfo?'隐藏':'查看' }}信息
+          </a-button>
+          <a-button id="purchaseNewOrderEdit-back-btn" type="link" @click="handleBack" class="button-default"> <a-icon type="rollback" /> 返回列表</a-button>
+        </template>
+      </a-page-header>
+      <div class="sales-detail-body">
+        <!-- 数据统计 -->
+        <a-card size="small" :bordered="false" class="salesDetail-cont" v-show="isShowBisiceInfo">
+          <a-descriptions size="small" :column="4">
+            <div slot="title" style="display:flex;justify-content:space-between;align-items:center;">
+              数据统计
+            </div>
+            <a-descriptions-item label="账单总金额">{{ detailData&&detailData.consigneeTel || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="收款金额">{{ detailData&&detailData.remarks || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="退款中金额">{{ detailData&&detailData.salesBillNo || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="已退款金额">{{ detailData&&detailData.operatorName || '--' }}</a-descriptions-item>
+          </a-descriptions>
+        </a-card>
+        <a-card size="small" :bordered="false" class="pages-wrap">
+          <div ref="tableSearch" class="table-page-search-wrapper">
+            <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+              <a-row :gutter="15">
+                <a-col :xl="6" :lg="6" :md="12" :sm="24">
+                  <a-form-item label="下单时间">
+                    <rangeDate id="unSettlement-time" ref="orderDate" :value="orderDate" @change="orderDateChange" />
+                  </a-form-item>
+                </a-col>
+                <a-col :xl="6" :lg="6" :md="12" :sm="24">
+                  <a-form-item label="付款时间">
+                    <rangeDate id="unSettlement-qhtime" ref="rangeDate" :value="time" @change="dateChange" />
+                  </a-form-item>
+                </a-col>
+                <a-col :xl="6" :lg="6" :md="12" :sm="24">
+                  <a-form-item label="退款时间">
+                    <rangeDate id="unSettlement-time" ref="orderDate" :value="orderDate" @change="orderDateChange" />
+                  </a-form-item>
+                </a-col>
+                <a-col :xl="6" :lg="6" :md="12" :sm="24">
+                  <a-form-item label="采购单号">
+                    <a-input id="unSettlement-orderNo" placeholder="请输入采购单号" v-model.trim="queryParam.orderBillNo" allowClear/>
+                  </a-form-item>
+                </a-col>
+                <a-col :xl="6" :lg="6" :md="12" :sm="24">
+                  <a-form-item label="销售单号">
+                    <a-input id="unSettlement-orderNo" placeholder="请输入销售单号" v-model.trim="queryParam.orderBillNo" allowClear/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="业务状态">
+                    <v-select id="settle-settleType" code="SHELF_SETTLE_TYPE" v-model="queryParam.settleType" allowClear placeholder="请选择业务状态"></v-select>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="财务状态">
+                    <v-select id="settle-settleType" code="SHELF_SETTLE_TYPE" v-model="queryParam.settleType" allowClear placeholder="请选择财务状态"></v-select>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="到账状态">
+                    <v-select id="settle-settleType" code="SHELF_SETTLE_TYPE" v-model="queryParam.settleType" allowClear placeholder="请选择到账状态"></v-select>
+                  </a-form-item>
+                </a-col>
+                <a-col :xl="24" :lg="24" :md="24" :sm="24" style="text-align:center;">
+                  <a-button type="primary" @click="getRefresh" :disabled="disabled" id="withdrawa-refresh" >查询</a-button>
+                  <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="withdrawa-reset">重置</a-button>
+                </a-col>
+              </a-row>
+            </a-form>
+          </div>
+          <div style="margin-bottom:8px;">
+            账单总金额:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;
+            其中收款金额:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;
+            退款中金额:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;
+            已退款金额:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;
+          </div>
+          <!-- 列表 -->
+          <s-table
+            class="sTable"
+            ref="table"
+            size="small"
+            :rowKey="(record) => record.id"
+            :columns="columns"
+            :data="loadData"
+            :defaultLoadData="false"
+            bordered>
+            <!-- 操作 -->
+            <template slot="action" slot-scope="text, record">
+              <a-button
+                :id="'sales-detail-out-'+record.id"
+                size="small"
+                type="link"
+                v-if="record.oosFlag == 0 && (isOwerEdit || isAudit)"
+                class="button-primary"
+                @click="handleViewDetail(record)">出库明细</a-button>
+              <span v-else>--</span>
+            </template>
+          </s-table>
+        </a-card>
+      </div>
+    </a-spin>
+    <!-- 出入库明细 -->
+    <outInDetialModal ref="outInDetialModal" outBizType="SALES" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
+    <!-- 编辑备注 -->
+    <editRemarkModal :openModal="openEditModal" @close="openEditModal=false" @ok="handleEditOk"></editRemarkModal>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { hdPrint } from '@/libs/JGPrint'
+// 组件
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import PrintPanel from '@/views/common/printPanel.vue'
+// 接口
+import { salesDetailBySn, salesDetailPrint, salesDetailExport } from '@/api/sales'
+import { salesDetailList } from '@/api/salesDetail'
+export default {
+  name: 'SalesDetail',
+  components: { STable, VSelect, PrintPanel, rangeDate },
+  mixins: [commonMixin],
+  props: {
+    outBizSn: { //  有值则为弹框,无值则为页面
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      showPage: false, // 是否显示组件
+      spinning: false,
+      disabled: false,
+      showCost: false, // 是否显示成本价
+      printOrgCode: false, // 是否打印原创编码
+      printAllName: false, // 是否打印全部名称
+      printRemarks: false, // 是否打印备注
+      printPrice: false, // 是否打印价格
+      printNo: true, // 是否打印销售单号
+      showOutInModal: false, // 出库明细弹框
+      openEditModal: false, // 打开编辑备注弹窗
+      queryParam: {
+        shelfSn: undefined, // 货架sn
+        settleType: undefined, // 结算方式
+        customerName: undefined, // 客户名称
+        beginAmount: '', // 开始金额
+        endAmount: ''//
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        return salesDetailList(Object.assign(parameter, { orderBy: 'sales_bill_detail.CREATE_DATE desc', salesBillSn: this.outBizSn || this.$route.params.sn })).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.localDataSource = data.list
+            this.disabled = false
+          }
+          return data
+        })
+      },
+      localDataSource: [], // 原始列表数据
+      detailData: null, //  详情数据
+      isShowBisiceInfo: false// 显示基础内容
+    }
+  },
+  computed: {
+    // 是否自建单据
+    isOwerEdit () {
+      return this.detailData && this.detailData.sourceType == 'SALES'
+    },
+    // 是否审核通过
+    isAudit () {
+      return this.detailData ? (this.detailData.billStatus == 'WAIT_OUT_WAREHOUSE' || this.detailData.billStatus == 'FINISH') : false
+    },
+    // 列定义
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '下单时间', dataIndex: 'dealerProductEntity.code', width: '11%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
+        { title: '采购单号', dataIndex: 'productName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '关联销售单号', dataIndex: 'productOrigCode', width: '9%', align: 'center', customRender: function (text) { return text && text != ' ' ? text : '--' } },
+        { title: '财务收款单号', dataIndex: 'price', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '订单金额', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '结算方式', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '付款时间', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退款时间', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '财务状态', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '到账状态', dataIndex: 'oosFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+
+      return arr
+    }
+  },
+  methods: {
+    handleEditOk () {
+      this.openEditModal = false
+    },
+    // 打印预览/快捷打印
+    handlePrint (type, printerType) {
+      const _this = this
+      _this.spinning = true
+      let url = salesDetailPrint
+      const params = {
+        sn: this.outBizSn || this.$route.params.sn,
+        printOrgCode: this.printOrgCode ? 1 : 0,
+        printAllName: this.printAllName ? 1 : 0,
+        remarksShowFlag: this.printRemarks ? 1 : 0,
+        printNo: this.printNo ? 1 : 0,
+        priceFlag: this.printPrice ? 1 : 0
+      }
+      if (type == 'export') { //  导出
+        url = salesDetailExport
+      }
+      // 打印或导出
+      hdPrint(printerType, type, url, params, '销售单', function () {
+        _this.spinning = false
+      })
+    },
+    //  返回
+    handleBack () {
+      this.$router.push({ name: 'onlinePayOrderList' })
+    },
+    //  详情
+    getDetail () {
+      salesDetailBySn({ salesBillSn: this.outBizSn || this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.detailData = res.data
+        } else {
+          this.detailData = null
+        }
+      })
+    },
+    // 打开出入库明细
+    handleViewDetail (row) {
+      this.showOutInModal = true
+      this.$refs.outInDetialModal.getData(row)
+    },
+    // 页面初始
+    pageInit () {
+      const vm = this
+      vm.$nextTick(() => {
+        vm.spinning = false
+        vm.disabled = false
+        // 是否默认打印原厂编码
+        vm.printOrgCode = localStorage.getItem('printOrgCode-' + this.$store.state.user.info.orgId) == 'true'
+        vm.printAllName = localStorage.getItem('printAllName-' + this.$store.state.user.info.orgId) == 'true'
+        vm.printRemarks = localStorage.getItem('printRemarks-' + this.$store.state.user.info.orgId) == 'true'
+        vm.printPrice = localStorage.getItem('printPrice-' + this.$store.state.user.info.orgId) == 'true'
+        const printNo = localStorage.getItem('printNo-' + this.$store.state.user.info.orgId)
+        console.log(printNo)
+        vm.printNo = printNo ? printNo == 'true' : true
+        // 查询列表
+        vm.$refs.table.refresh(true)
+        // 获取单据详情
+        vm.getDetail()
+      })
+    }
+  },
+  watch: {
+    // 打印选项变化
+    printOrgCode (newValue, oldValue) {
+      localStorage.setItem('printOrgCode-' + this.$store.state.user.info.orgId, newValue)
+    },
+    printRemarks (newValue, oldValue) {
+      localStorage.setItem('printRemarks-' + this.$store.state.user.info.orgId, newValue)
+    },
+    printPrice (newValue, oldValue) {
+      localStorage.setItem('printPrice-' + this.$store.state.user.info.orgId, newValue)
+    },
+    printAllName (newValue, oldValue) {
+      localStorage.setItem('printAllName-' + this.$store.state.user.info.orgId, newValue)
+    },
+    printNo (newValue, oldValue) {
+      localStorage.setItem('printNo-' + this.$store.state.user.info.orgId, newValue)
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab || this.outBizSn) { // 页签刷新时调用
+      this.showPage = true
+      this.pageInit()
+    }
+  },
+  activated () {
+    this.showPage = true
+    this.pageInit()
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+    })
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .salesDetail-wrap{
+    position: relative;
+    height: 100%;
+    .billno{
+      font-size: 16px;
+      font-weight: 600;
+      display: inline-block;
+      vertical-align: middle;
+      color: #333;
+      margin-right: 15px;
+    }
+    .ant-tag-green,.ant-tag-orange{
+      vertical-align: middle;
+    }
+    .salesDetail-cont{
+      margin-bottom: 10px;
+      /deep/ .ant-descriptions-title{
+          margin-bottom: 10px;
+        }
+    }
+    .pages-wrap{
+        strong{
+          color:#f12929;
+        }
+    }
+
+  }
+</style>

+ 247 - 3
src/views/numsGoodsShelves/onlinePayInvoice/list.vue

@@ -1,8 +1,252 @@
 <template>
+  <a-card size="small" :bordered="false" class="accountManagementList-wrap jg-page-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="5" :sm="24">
+              <a-form-item label="货架名称">
+                <shelfList id="settle-shelfsn" style="max-width:300px;" v-model="queryParam.shelfSn"></shelfList>
+              </a-form-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-form-item label="关联客户">
+                <custList id="settle-customerName" ref="custList" @change="custChange" v-model="queryParam.customerName"></custList>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="settle-refresh" >查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="settle-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <div class="table-operator">
+        <div class="alert-message">
+          账单总金额:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;
+          其中收款金额:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;
+          待退款金额:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;
+          已退款金额:<strong>{{ detailData&&(detailData.totalGiveAmount || detailData.totalGiveAmount==0) ? toThousands(detailData.totalGiveAmount) : '--' }}</strong>;
+        </div>
+      </div>
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+77+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y:tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="action" slot-scope="text,record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-primary"
+            @click="handleUndetail(record)"
+            :id="'settle-detail-btn-'+record.id">明细</a-button>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
 </template>
 
 <script>
+import moment from 'moment'
+import { commonMixin } from '@/utils/mixin'
+import { toThousands } from '@/libs/tools.js'
+import { STable, VSelect } from '@/components'
+import shelfList from '@/views/common/shelfList'
+import custList from '@/views/common/custList.vue'
+import { queryShelfSettleRulePage, queryShelfSettleRuleCount } from '@/api/merchant'
+export default {
+  components: { STable, shelfList, custList, VSelect },
+  mixins: [commonMixin],
+  data () {
+    return {
+      toThousands,
+      advanced: true, // 高级搜索 展开/关闭
+      spinning: false,
+      disabled: false,
+      tableHeight: 0, // 表格高度
+      total: 0, // 待结算金额合计
+      count: 0, // 总记录
+      time: [], // 时间
+      queryParam: {
+        shelfSn: undefined, // 货架sn
+        settleType: undefined, // 结算方式
+        customerName: undefined, // 客户名称
+        beginAmount: '', // 开始金额
+        endAmount: ''//
+      },
+      // 列
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
+        { title: '货架名称', dataIndex: 'shelfName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '关联客户', dataIndex: 'customerName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '账单总金额', dataIndex: 'waitSettleAmount', width: '15%', align: 'right', customRender: function (text) { return toThousands(text, 2) || '--' } },
+        { title: '收款金额', dataIndex: 'waitSettleAmount', width: '15%', align: 'right', customRender: function (text) { return toThousands(text, 2) || '--' } },
+        { title: '待退款金额', dataIndex: 'waitSettleAmount', width: '15%', align: 'right', customRender: function (text) { return toThousands(text, 2) || '--' } },
+        { title: '已退款金额', dataIndex: 'waitSettleAmount', width: '15%', align: 'right', customRender: function (text) { return toThousands(text, 2) || '--' } },
+        { title: '操作', width: '15%', align: 'left', scopedSlots: { customRender: 'action' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        const _this = this
+        _this.disabled = true
+        _this.spinning = true
+        const paramsPage = Object.assign(parameter, this.queryParam) //  有分页
+        // 校验待结金额数值范围是否正确
+        if (this.checkValueRange()) {
+          return queryShelfSettleRulePage(paramsPage).then(res => {
+            let data
+            if (res.status == 200) {
+              data = res.data
+              this.getCount(paramsPage)
+              const no = (data.pageNo - 1) * data.pageSize
+              for (var i = 0; i < data.list.length; i++) {
+                data.list[i].no = no + i + 1
+              }
+              this.disabled = false
+            }
+            this.spinning = false
+            return data
+          })
+        } else {
+          const _this = this
+          this.disabled = true
+          this.spinning = true
+          return new Promise(function (resolve, reject) {
+            const data = []
+            _this.disabled = false
+            _this.spinning = false
+            resolve(data)
+          })
+        }
+      }
+    }
+  },
+  methods: {
+    // 选择客户
+    custChange (obj, row) {
+      if (row) {
+        this.queryParam.customerSn = row && row.customerSn || undefined
+        this.queryParam.customerName = undefined
+      } else {
+        this.queryParam.customerName = obj || undefined
+        this.queryParam.customerSn = undefined
+      }
+    },
+    // 禁止选择今天之后的日期
+    disabledDate (current) {
+      return current && current > moment().endOf('day')
+    },
+    // 校验待结金额数值范围
+    checkValueRange () {
+      const isONull = this.queryParam.beginAmount === null || this.queryParam.beginAmount === undefined
+      const isOEmpty = this.queryParam.beginAmount === ''
+      const isOZero = this.queryParam.beginAmount === 0
+      const isTNull = this.queryParam.endAmount === null || this.queryParam.endAmount === undefined
+      const isTEmpty = this.queryParam.endAmount === ''
+      const isTZero = this.queryParam.endAmount === 0
+      //  第一个为空(可为null可为空字符)第二个不为空
+      //  第一个不为空第二个为空(可为null可为空字符)
+      //  第一个大于第二个
+      if ((isONull || isOEmpty) && (this.queryParam.endAmount || isTZero)) {
+        this.$message.info('请输入正确的待结金额查询范围!')
+        return false
+      }
+      if ((this.queryParam.beginAmount || isOZero) && (isTNull || isTEmpty)) {
+        this.$message.info('请输入正确的待结金额查询范围!')
+        return false
+      }
+      if (this.queryParam.beginAmount > this.queryParam.endAmount) {
+        this.$message.info('请输入正确的待结金额查询范围!')
+        return false
+      }
+      this.queryParam.beginAmount = this.queryParam.beginAmount > 999999999 ? 999999999 : this.queryParam.beginAmount
+      this.queryParam.endAmount = this.queryParam.endAmount > 999999999 ? 999999999 : this.queryParam.endAmount
+      return true
+    },
+    // 重置
+    resetSearchForm () {
+      this.time = []
+      this.queryParam = {
+        shelfSn: undefined,
+        settleType: undefined,
+        customerName: undefined,
+        customerSn: undefined,
+        beginAmount: '',
+        endAmount: ''
+      }
+      this.$refs.custList.resetForm()
+      this.$refs.table.refresh(true)
+    },
+    // 合计
+    getCount (val) {
+      queryShelfSettleRuleCount(val).then(res => {
+        if (res.status == 200) {
+          this.count = res.data.size || 0
+          this.total = res.data.waitSettleAmount || 0
+        }
+      })
+    },
+    // 待结明细
+    handleUndetail (row) {
+      this.$router.push({ name: 'onlinePayInvoiceDetail', params: { shelfSn: row.shelfSn, settleType: row.settleType, shelfName: row.shelfName } })
+    },
+    // 结算历史
+    handleDetail (row) {
+      sessionStorage.setItem('settlementDetail', JSON.stringify(row))
+      this.$router.push({ name: 'settlementDetail', params: { shelfSn: row.shelfSn, shelfName: row.shelfName } })
+    },
+    // 计算表格高度
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 245
+    },
+    // 初始化页面
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
 </script>
-
-<style>
-</style>