serviceDetailDialog.vue 2.76 KB
<!-- 服务商 - 财务列表 - 查看详情 -->
<template>
  <d2-dialog
    title="查看详情"
    :is-visible.sync="isVisible"
    btn-ok-label="关闭"
    width="700px"
    :no-cancel="noCancel"
    @confirmDialog="handleDetailClose"
    @closeDialog="handleDetailClose">
    <el-form
      :inline="true"
      label-width="0">
      <el-form-item>
        <span class="picker-placeholder">
          <el-date-picker
            v-model="summaryDate"
            type="month"
            placeholder="全部"
            :clear="false"
            :picker-options="{
              disabledDate(time) {
                return time.getTime() > Date.now();
              },
              shortcuts: [{
                text: '全部',
                onClick(picker) {
                  picker.$emit('pick', '');
                }
              }]
            }" />
        </span>
        <el-button
          @click="getList"
          type="primary">
          查询
        </el-button>
      </el-form-item>
    </el-form>
    <el-table
      :data="tableData"
      style="width: 100%"
      border>
      <el-table-column
        label="序号"
        type="index"
        :align="align" />
      <el-table-column
        prop="yqMerchantName"
        label="园区店名称"
        :align="align" />
      <el-table-column
        prop="subNums"
        label="订单笔数"
        :align="align" />
      <el-table-column
        prop="totalFranchiseeProfitMoney"
        label="总收入(元)"
        :align="align" />
    </el-table>
  </d2-dialog>
</template>

<script>
// import moment from 'moment'
import dayjs from 'dayjs'
import { getServiceSummaryApi } from '@api/finance'
export default {
  name: 'ServiceDetailDialog',
  data() {
    return {
      noCancel: true,
      align: 'center',
      summaryDate: '',
      tableData: []
    }
  },

  props: {
    isVisible: {
      type: Boolean,
      default: false
    },
    date: {
      type: String,
      default: ''
    }
  },

  watch: {
    isVisible(val) {
      this.summaryDate = val ? this.date : ''
      val && this.getList()
    }
  },

  mounted() { },

  methods: {
    getList() {
      getServiceSummaryApi({
        payStartDateStr: this.summaryDate ? dayjs(this.summaryDate).startOf('month').format('YYYY-MM-DD') : '',
        payEndDateStr: this.summaryDate ? dayjs(this.summaryDate).endOf('month').format('YYYY-MM-DD') : ''
      }).then((res) => {
        this.tableData = res.countList
      })
    },

    handleDetailClose() {
      this.$emit('handleStoreClose')
    }
  }
}

</script>
<style lang="scss">
.picker-placeholder {
  .el-input__inner::-webkit-input-placeholder {
    color: #606266;
  }
}
</style>