<template>
  <div class="form-wrap">
    <el-form
      class="searchBox"
      ref="form"
      :model="form"
      :inline="true"
      label-width="100px"
    >
      <div class="block-title">
        查询条件
      </div>
      <el-form-item
        label="订单号"
        prop="orderNo"
      >
        <el-input v-model="form.orderNo"></el-input>
      </el-form-item>
      <template>
        <el-form-item
          label="合作方订单号"
          prop="partnerOrderNo"
        >
          <el-input v-model="form.partnerOrderNo"></el-input>
        </el-form-item>
      </template>
      <!-- <el-form-item
        label="票号"
        prop="keyWords7"
      >
        <QRReader v-model="form.keyWords7"></QRReader>
      </el-form-item>
      <el-form-item
        label="游客姓名"
        prop="keyWords2"
      >
        <el-input v-model="form.keyWords2"></el-input>
      </el-form-item>
      <el-form-item
        label="游客手机"
        prop="keyWords3">
        <el-input v-model="form.keyWords3"></el-input>
      </el-form-item>
      <el-form-item
        label="证件号"
        prop="keyWords4">
        <ReaderInput v-model="form.keyWords4"></ReaderInput>
      </el-form-item>
      <el-form-item
        label="起始时间"
        prop="startDate"
      >
        <el-date-picker
          v-model="form.startDate"
          type="datetime"
          placeholder="选择日期时间"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item
        label="截止时间"
        prop="endDate"
      >
        <el-date-picker
          default-time="23:59:59"
          v-model="form.endDate"
          type="datetime"
          placeholder="选择日期时间"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item
        label="状态"
        prop="keyWords5"
      >
        <el-select
          v-model="form.keyWords5"
          clearable
          placeholder="请选择"
        >
          <el-option
            label="全部"
            value=""></el-option>
          <el-option
            v-for="item in orderStatusDic"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item
        label="销售渠道"
        prop="keyWords8"
      >
        <el-select
          v-model="form.keyWords8"
          placeholder="请选择"
        >
          <el-option
            label="全部"
            :value="null"></el-option>
          <el-option
            v-for="(item,index) in saleChannel"
            :key="index"
            :label="item"
            :value="item"
          >
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item
        label="团散"
        prop="keyWords6"
      >
        <el-select
          v-model="form.keyWords6"
          placeholder="请选择"
        >
          <el-option
            label="全部"
            value=""
          >
          </el-option>
          <el-option
            label="散客"
            :value="1"
          >
          </el-option>
          <el-option
            label="团体"
            :value="2"
          >
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item
        label="售票员"
        prop="keyWords9">
        <el-select v-model="form.keyWords9">
          <el-option
            label="全部"
            value=""></el-option>
          <el-option
            v-for="item in salesList"
            :key="item.id"
            :label="item.nick_name"
            :value="item.nick_name">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item
        label="银行交易流水号"
        prop="orderNo7"
        label-width="180px"
      >
        <el-input v-model="form.orderNo7"></el-input>
      </el-form-item>
      <el-form-item
        label="支付方式"
        prop="orderNo0">
        <el-select
          v-model="form.orderNo0"
          filterable>
          <el-option
            label="全部"
            value=""></el-option>
          <el-option
            v-for="item in payChannelOptions"
            :key="item"
            :label="item"
            :value="item">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item
        label="票种列表"
        prop="orderNo1"
      >
        <el-select
          v-model="form.orderNo1"
          placeholder="请选择"
          filterable>
          <el-option
            value=""
            label="全部">
          </el-option>
          <el-option
            v-for="item in ticketTypeList"
            :key="item.id"
            :value="item.id"
            :label="item.name">
          </el-option>
        </el-select>
      </el-form-item>

      <el-form-item
        label="景点选择"
        prop="orderNo2"
      >
        <el-select
          v-model="form.orderNo2"
          placeholder="请选择">
          <el-option
            value=""
            label="全部">
          </el-option>
          <el-option
            v-for="item in scenicList"
            :key="item.id"
            :value="item.id"
            :label="item.name">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item
        label="客户状态"
        prop="keyWords20"
      >
        <el-select
          v-model="form.keyWords20"
          placeholder="请选择"
        >
          <el-option
            label="全部"
            value=""
          >
          </el-option>
          <el-option
            label="灰名单"
            :value="3"
          >
          </el-option>
          <el-option
            label="其他"
            :value="2"
          >
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item
        label="游玩起始时间"
        prop="startDate1"
        label-width="180px"
      >
        <el-date-picker
          v-model="form.startDate1"
          type="datetime"
          placeholder="选择游玩日期时间"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item
        label="游玩截止时间"
        prop="endDate1"
        label-width="180px"
      >
        <el-date-picker
          default-time="23:59:59"
          v-model="form.endDate1"
          type="datetime"
          placeholder="选择游玩日期时间"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item
        label="订单标签"
        prop="keyWords28"
      >
        <el-select
          clearable
          v-model="form.keyWords28"
          placeholder="请选择">
          <el-option
            v-for="item in order_tag_list"
            :key="item"
            :label="item"
            :value="item">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item
        v-if="['昭苏'].includes(scenicName)"
        label="车牌号"
        prop="keyWords29"
      >
        <el-input v-model="form.keyWords29"></el-input>
      </el-form-item> -->
      <div class="btn-wrap">
        <el-button
          @click="reset"
        >
          重置
        </el-button>
        <el-button
          :disabled="loading"
          type="primary"
          @click="getOrderList(true)"
        >
          搜索
        </el-button>
      </div>
    </el-form>

    <div class="tableBox">
      <div class="block-title">
        统计信息
      </div>
      <el-table
        stripe
        border
        v-loading="loading"
        :data="tableData">
        <el-table-column
          width="190"
          prop="orderNo"
          label="订单号"
          fixed="left"
        >
        </el-table-column>
        <el-table-column
          width="120"
          prop="partnerOrderNo"
          label="OTA订单号"
        >
        </el-table-column>
        <el-table-column
          width="120"
          prop="otaSourceName"
          label="订单来源渠道"
        >
        </el-table-column>
        <el-table-column
          label="支付方式"
          width="120"
          prop="payType">
        </el-table-column>
        <el-table-column
          label="支付状态"
          width="120"
          prop="payStatus">
        </el-table-column>
        <el-table-column
          label="支付状态"
          fixed="right"
        >
          <template slot-scope="scope">
            <el-tag
              :type="getPayStatus(scope.row.payStatus,'type')"
              size="normal"
            >
              {{ getPayStatus(scope.row.payStatus) }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column
          label="支付时间"
          width="120"
          prop="payTime">
        </el-table-column>
        <el-table-column
          label="关闭时间"
          width="120"
          prop="closeTime">
        </el-table-column>
        <el-table-column
          label="票种"
          min-width="120">
          <template slot-scope="scope">
            <Ellipsis
              type="tooltip"
              :content="scope.row.ticketsName"
              :length="15"></Ellipsis>
          </template>
        </el-table-column>
        <el-table-column
          prop="saleAdminName"
          width="120"
          label="售票员"
        >
        </el-table-column>
        <el-table-column
          width="140"
          label="售票时间"
        >
          <template slot-scope="scope">
            {{ scope.row.createTime | formatTime }}
          </template>
        </el-table-column>
        <el-table-column
          prop="buyerName"
          label="购买方名称"
        ></el-table-column>
        <el-table-column
          prop="buyerPhone"
          label="购买方手机">
        </el-table-column>
        <el-table-column
          prop="buyerIdentify"
          label="购买方证件号">
        </el-table-column>
        <el-table-column
          prop="buyerIdentifyType"
          label="购买方证件类型">
          <template slot-scope="scope">
            {{ papersType[scope.row.buyerIdentifyType] }}
          </template>
        </el-table-column>
        <el-table-column
          prop="buyerIdentifyType"
          label="是否是线上订单">
          <template slot-scope="scope">
            {{ scope.row.isOnlineOrder ? '是' : '否' }}
          </template>
        </el-table-column>
        <el-table-column
          width="80"
          prop="ticketNum"
          label="所含票数"
        >
        </el-table-column>
        <el-table-column
          width="80"
          label="人数"
        >
          <template slot-scope="scope">
            {{ reduceCheckNum(scope.row.ticketList) }}
          </template>
        </el-table-column>
        <el-table-column
          width="80"
          label="总价(￥)"
        >
          <template slot-scope="scope">
            {{ scope.row.price }}
          </template>
        </el-table-column>
        <el-table-column
          width="90"
          label="状态"
          fixed="right"
        >
          <template slot-scope="scope">
            <OrderStatusTag :value="scope.row.status"></OrderStatusTag>
          </template>
        </el-table-column>
        <el-table-column
          width="80"
          label="备注"
        >
          <template slot-scope="scope">
            {{ scope.row.remark }}
          </template>
        </el-table-column>
        <el-table-column
          label="操作"
          fixed="right"
          width="220"
        >
          <template slot-scope="scope">
            <el-link
              v-if="(scenicName==='狼山景区'||scenicName==='军山景区')&&(scope.row.payChannel==='POS支付'||scope.row.payChannel==='中行支付')&&(scope.row.status==='WAIT_PAY')"
              type="primary"
              @click="confirmPOS(scope.row)">
              确认POS支付
            </el-link>
            <el-link
              type="primary"
              @click="$refs.orderDetail.show(scope.row)">
              订单详情
            </el-link>
            <!--
            <el-link
              type="primary"
              v-if="scope.row.tickets.some(v=>v.is_invoice_picked===0&&v.status==='USED')&&scope.row.ota_name!=='清鹤自营售票'"
              @click="showPickInvoice(scope.row)">
              开票
            </el-link>
            -->
            <el-link
              type="primary"
              v-if="scenicName==='昭苏' && scope.row.ticketList.some(v=>v.is_invoice_picked===0&&v.status==='USED')&&scope.row.ota_name!=='清鹤自营售票'"
              @click="showPickInvoice(scope.row)">
              开票
            </el-link>
            <el-link
              type="primary"
              v-if="scenicName!=='昭苏' && scope.row.ticketList.some(v=>v.is_invoice_picked===0&&v.status==='USED')"
              @click="showPickInvoice(scope.row)">
              开票
            </el-link>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
        background
        :current-page.sync="form.pageNum"
        @current-change="getOrderList()"
        layout="total, prev, pager, next"
        :total="total"
      >
      </el-pagination>
    </div>

    <OrderDetail ref="orderDetail"></OrderDetail>

    <el-dialog
      title="开票"
      :visible.sync="visible"
      width="80%"
      @close="visible=false">
      <el-table
        ref="multipleTable"
        :data="currentOrder.ticketList"
        @selection-change="handleSelectionChange">
        <el-table-column
          type="selection"
          :selectable="selectable"
          width="55">
        </el-table-column>
        <el-table-column
          prop="ticket_no"
          label="票号"
        >
        </el-table-column>

        <el-table-column
          prop="tname"
          label="票种"
        >
        </el-table-column>

        <el-table-column
          width="80"
          label="票价(￥)"
        >
          <template slot-scope="scope">
            {{ scope.row.price/scope.row.check_num }}
          </template>
        </el-table-column>
        <el-table-column
          prop="guest_papers_type"
          label="证件类型"
        >
          <template slot-scope="scope">
            {{ papersType[scope.row.guest_papers_type] }}
          </template>
        </el-table-column>

        <el-table-column
          width="100"
          prop="check_num"
          label="检票人数"
        >
        </el-table-column>

        <el-table-column
          width="100"
          prop="payDateBegin"
          label="游玩时间"
        >
          <template slot-scope="scope">
            {{ scope.row.is_need_playtime?scope.row.payDateBegin:'无限制' }}
          </template>
        </el-table-column>
        <el-table-column
          width="80"
          label="取票状态"
        >
          <template slot-scope="scope">
            <el-tag :type="scope.row.is_print?'success':'info'">
              {{ scope.row.is_print?'已取票':'未取票' }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column
          width="80"
          label="状态"
        >
          <template slot-scope="scope">
            <OrderStatusTag :value="scope.row.status"></OrderStatusTag>
          </template>
        </el-table-column>
        <el-table-column
          width="80"
          label="是否已开票"
        >
          <template slot-scope="scope">
            {{ scope.row.is_invoice_picked===1?'已开':'未开' }}
          </template>
        </el-table-column>
        <el-table-column
          width="80"
          prop="price"
          label="小计"
        >
        </el-table-column>
      </el-table>
      {{ formEl.invoice_type }}
      <el-form
        class="searchBox"
        ref="formEl"
        :model="formEl"
        :inline="true"
        label-width="200px"
        style="background: transparent"
      >
        <!-- 九龙湖只能固定一种开票方式 -->
        <el-form-item
          v-if="['九龙湖','demo'].includes(scenicName)"
          label="开票方式"
          prop="invoice_type"
        >
          <!-- <el-radio
            v-if="false"
            v-model="formEl.invoice_type"
            :label="1">
            扫码开票
          </el-radio> -->
          <el-radio
            v-model="formEl.invoice_type"
            :label="0">
            普通开票
          </el-radio>
        </el-form-item>

        <el-form-item
          v-else
          verify
          label="开票方式"
          prop="invoice_type"
        >
          <el-radio
            v-model="formEl.invoice_type"
            :label="1">
            扫码开票
          </el-radio>
          <el-radio
            v-model="formEl.invoice_type"
            :label="0">
            普通开票
          </el-radio>
        </el-form-item>
        <el-form-item
          v-if="!formEl.invoice_type"
          verify
          label="购买方"
          prop="invoice_buyer"
        >
          <el-input
            v-model="formEl.invoice_buyer"
            style="width:100%"></el-input>
        </el-form-item>
        <el-form-item
          v-if="!formEl.invoice_type"
          label="纳税⼈识别号"
          prop="invoice_buyer_tax_num"
          :rules="rules.invoice_buyer_tax_num"
        >
          <el-input
            v-model="formEl.invoice_buyer_tax_num"
            style="width:100%"></el-input>
        </el-form-item>
        <el-form-item
          v-if="!formEl.invoice_type"
          label="纳税⼈邮箱"
          prop="invoice_buyer_email"
          :rules="[
            { required: false, message: '请输入邮箱', trigger: 'blur' },
            { type: 'email', message: '邮箱格式不正确', trigger: 'blur' }
          ]"
        >
          <el-input
            v-model="formEl.invoice_buyer_email"
            style="width:100%"></el-input>
        </el-form-item>
        <el-form-item
          v-if="!formEl.invoice_type"
          label="纳税⼈手机号"
          prop="invoice_buyer_phone"
          :rules="[
            { required: false, message: '请输入手机号', trigger: 'blur' },
            { pattern: /^1[3456789]\d{9}$/, message: '手机号格式不正确', trigger: 'blur' }
          ]"
        >
          <el-input
            v-model="formEl.invoice_buyer_phone"
            style="width:100%"></el-input>
        </el-form-item>
        <el-form-item
          v-if="!formEl.invoice_type"
          label="购买方地址"
          prop="invoice_buyer_address"
        >
          <el-input
            v-model="formEl.invoice_buyer_address"
            style="width:100%"></el-input>
        </el-form-item>
        <el-form-item
          v-if="!formEl.invoice_type"
          label="购买方银行开户行及账号"
          prop="invoice_buyer_bank_account"
        >
          <el-input
            v-model="formEl.invoice_buyer_bank_account"
            style="width:100%"></el-input>
        </el-form-item>
        <el-form-item
          v-if="!formEl.invoice_type"
          label="备注"
          prop="remark"
        >
          <el-input
            v-model="formEl.remark"
            style="width:100%"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer">
        <el-button @click="visible = false">取消</el-button>
        <el-button
          type="primary"
          @click="submitPickInvoice">确定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
/* eslint-disable no-unused-vars */
import { apiOrderList, pickInvoice, getInvoice } from '@/api/order'
import { orderStatusDic, channelList, papersType } from '@/assets/staticData'
import { getPayStatus } from '@/utils/index'

// import ReaderInput from '@/components/ReaderInput'
import Ellipsis from '@/components/Ellipsis'
import moment from 'moment'
import { payPOS } from '@/api/pay'
import { getSelf } from '@/api/systemSetting/account'
import { getSystemConfigList } from '@/api/systemConfig'

const Store = require('electron-store')
const localStore = new Store()

export default {
  name: 'salesQuery',
  computed: {
    scenicName () {
      return this.$localStore.get('scenicName') || this.$store.state.user.scenicName
    },
    salesList () {
      return this.$store.state.user.salesList
    },
    saleChannel () {
      return this.$store.state.app.saleChannel
    },
    payChannelOptions () {
      return this.$store.getters.payChannelOptions
    },
    ticketTypeList () {
      return this.$store.state.app.ticketTypeList
    },
    scenicList () {
      return this.$store.state.app.scenicList
    }
  },
  components: {
    // ReaderInput,
    Ellipsis
  },
  data () {
    return {
      projectName: process.env.VUE_APP_PROJECT,
      channelList,
      orderStatusDic,
      papersType,
      isDev: process.env.NODE_ENV === 'development',
      form: {
        startDate: new Date(moment().startOf('day').valueOf()),
        endDate: new Date(moment().endOf('day').valueOf()),
        startDate1: new Date(moment().startOf('day').valueOf()),
        endDate1: new Date(moment().endOf('day').valueOf()),
        partnerOrderNo: '', // OTA订单号
        ota_3rd_orderNo: '', // 渠道订单号
        orderNo: '', // 订单号
        keyWords2: '', // 游客姓名
        keyWords3: '', // 游客手机
        keyWords4: '', // 游客身份证
        keyWords5: '', // 状态
        keyWords6: '', // 1散客 2团体
        keyWords7: '', // 票号
        keyWords8: null,
        keyWords9: '', // 售票员
        orderNo0: '',
        orderNo1: '',
        orderNo2: '',
        orderNo7: '', // 银行交易流水号
        keyWords20: '',
        keyWords28: '',
        keyWords29: '',
        pageNum: 1,
        pageSize: 10
      },
      tableData: [],
      total: 0,
      loading: false,
      invoice_type: 0,
      formEl: {
        invoice_type: 1,
        invoice_buyer: '',
        invoice_buyer_tax_num: '',
        invoice_buyer_email: '',
        invoice_buyer_phone: '',
        invoice_buyer_address: '',
        invoice_buyer_bank_account: '',
        remark: ''
      },
      rules: {
        invoice_buyer_tax_num: [
          { required: false, message: '请输入纳税人识别号', trigger: 'blur' },
          { pattern: /^[A-Za-z0-9]{15,20}$/, message: '纳税人识别号格式不正确', trigger: 'blur' }
        ]
      },
      currentOrder: {},
      multipleSelection: [],
      order_tag_list: [],
      visible: false
    }
  },
  filters: {
    filterChannel (n) {
      switch (n) {
        case 1:
          return '线下'
        case 2:
          return '线上'
        case 3:
          return '自助机'
      }
    }
  },
  async created () {
    const searchParams = JSON.parse(sessionStorage.getItem('统计表-售票记录-查询条件'))
    if (searchParams) {
    // 如果存在查询条件，则设置到组件的数据中
      this.form = searchParams // 记住上次搜索条件
    }
    this.getOrderList()
    // const res = await getSystemConfigList()
    // this.order_tag_list = res.list.find(v => v.config_key === 'order_tag_list')?.config_value?.replace(/\s+/g, '')?.split(',') || []
  },
  methods: {
    getPayStatus,
    reset () {
      this.$refs.form.resetFields()
    },
    // 取票状态
    checkPrintStatus (ticketList) {
      let tempArr = ticketList.filter(i => i.is_print)
      if (tempArr.length) {
        if (tempArr.length === ticketList.length) {
          return { type: 'success', text: '已取票' }
        } else {
          return { type: 'warning', text: '部分取票' }
        }
      } else {
        return { type: 'info', text: '未取票' }
      }
    },
    toggleSelection (rows) {
      if (rows) {
        rows.forEach(row => {
          this.$refs.multipleTable.toggleRowSelection(row)
        })
      } else {
        this.$refs.multipleTable.clearSelection()
      }
    },
    handleSelectionChange (val) {
      this.multipleSelection = val
    },
    selectable (row, index) {
      return row.status === 'USED'
    },
    showPickInvoice (order) {
      this.visible = true
      this.currentOrder = order
      if (['九龙湖', 'demo'].includes(this.scenicName)) {
        this.formEl.invoice_type = 0 // 九龙湖只能普通开票
      }
    },
    submitPickInvoice () {
      if (!this.multipleSelection.length) return this.$message.error('请选择门票')
      this.$refs.formEl.validate(valid => {
        if (!valid) return
        if (this.formEl.invoice_type) {
          this.formEl.invoice_buyer = ''
          this.formEl.invoice_buyer_tax_num = ''
          this.formEl.invoice_buyer_email = ''
          this.formEl.invoice_buyer_phone = ''
          this.formEl.invoice_buyer_address = ''
          this.formEl.invoice_buyer_bank_account = ''
          this.formEl.remark = ''
        }
        pickInvoice([this.currentOrder.id], this.multipleSelection.map(v => v.id), this.formEl.invoice_type, this.formEl.invoice_buyer, this.formEl.invoice_buyer_tax_num, this.formEl.invoice_buyer_email, this.formEl.invoice_buyer_phone, this.formEl.invoice_buyer_address, this.formEl.invoice_buyer_bank_account, this.formEl.remark).then(res => {
          this.$message.success('操作成功')
          this.getOrderList()
          this.visible = false
          this.currentOrder = {}
          this.formEl = {
            invoice_type: 1,
            invoice_buyer: '',
            invoice_buyer_tax_num: '',
            invoice_buyer_email: '',
            invoice_buyer_phone: '',
            invoice_buyer_address: '',
            invoice_buyer_bank_account: '',
            remark: ''
          }
          this.$confirm('发票已生成，是否跳转到发票下载页？', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            this.$router.push('/queryReport/invoiceRecord')
          })
        })
      })
    },
    confirmPOS (record) {
      this.$confirm('请确认该订单已付款,将手动更新订单状态为已支付', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        getSelf().then(response => {
          const params = {
            manager_id: response.id,
            id: record.id,
            payChannel: record.payChannel,
            posId: localStore.get('termId'),
            tradeInfo: '',
            type: 'TICKET'
          }
          payPOS(params).then(res => {
            this.$message.success('操作成功')
            this.getOrderList()
            this.$confirm('门票状态已修改,是否跳转补打门票页面？', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              this.$router.push({ name: 'printTicket' })
            }).catch(() => {
            })
          })
        })
      }).catch(() => {
      })
    },
    getOrderList (goFirst) {
      this.loading = true
      goFirst && (this.form.pageNum = 1)
      apiOrderList(this.form).then(res => {
        this.total = res.data.total

        res.data.records.forEach(item => {
          let ticketsName = []
          item.ticketList.forEach(i => {
            if (ticketsName.indexOf(i.ticketTypeName) < 0) {
              ticketsName.push(i.ticketTypeName)
            }
          })
          item.ticketsName = ticketsName.join('，')
        })

        this.tableData = res.data.records
        this.tableData.forEach(v => {
          if (v.price === 0 && v.payChannel === '现金') {
            v.payChannel = '免票'
          }
        })

        console.log(this.tableData, 'tableData')
      }).finally(() => {
        this.loading = false
      })
      sessionStorage.setItem('统计表-售票记录-查询条件', JSON.stringify(this.form)) // 下次记住
    },
    reduceCheckNum (list) {
      console.log(list, 'list')
      if (!list) return 0
      return list.reduce((prev, item) => {
        return prev + item.peopleNum
      }, 0)
    }
  }
}
</script>

<style scoped>

</style>
