<template>
  <div class="app-container">
    <div class="flexBet searchTop">
      <!-- <div class="title flex m20">
        <div class="bar"></div>
        <div class="text">待支付</div>
      </div> -->

    </div>

    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="116px" class="flex form"
      style="position: relative">
      <el-form-item label="平台订单号" prop="orderNo">
        <el-input size="medium" v-model="queryParams.orderNo" placeholder="请输入平台订单号" @keyup.enter.native="handleQuery"
          style="width: 180px; border-color: #e6f1ff" />
      </el-form-item>
      <el-form-item label="商户订单号" prop="merchantOrderNo">
        <el-input size="medium" v-model="queryParams.merchantOrderNo" placeholder="请输入商户订单号"
          @keyup.enter.native="handleQuery" style="width: 180px; border-color: #e6f1ff" />
      </el-form-item>

      <el-form-item label="商户下游订单号" prop="downstreamMerchantOrderNo">
        <el-input size="medium" v-model="queryParams.downstreamMerchantOrderNo" placeholder="请输入商户下游订单号"
          @keyup.enter.native="handleQuery" style="width: 180px; border-color: #e6f1ff" />
      </el-form-item>

      <el-form-item label="卡号" prop="carddealerCardNumber">
        <el-input size="medium" v-model="queryParams.carddealerCardNumber" placeholder="请输入卡号"
          @keyup.enter.native="handleQuery" style="width: 180px; border-color: #e6f1ff" />
      </el-form-item>

      <el-form-item label="商户名称" prop="merchantName">
        <el-input size="medium" v-model="queryParams.merchantName" placeholder="请输入商户名称" @keyup.enter.native="handleQuery"
          style="width: 180px; border-color: #e6f1ff" />
      </el-form-item>

      <el-form-item label="码商名称" prop="carddealerName">
        <el-input size="medium" v-model="queryParams.carddealerName" placeholder="请输入码商名称"
          @keyup.enter.native="handleQuery" style="width: 180px; border-color: #e6f1ff" />
      </el-form-item>

      <el-form-item label="姓名" prop="carddealerCardHolder">
        <el-input size="medium" v-model="queryParams.carddealerCardHolder" placeholder="请输入姓名"
          @keyup.enter.native="handleQuery" style="width: 180px; border-color: #e6f1ff" />
      </el-form-item>
      <el-collapse>
        <el-collapse-item name="1">
          <el-form-item label="订单金额" prop="reqAmount">
            <el-input size="medium" v-model="queryParams.reqAmount" placeholder="请输入订单金额"
              @keyup.enter.native="handleQuery" style="width: 180px; border-color: #e6f1ff" />
          </el-form-item>

          <el-form-item label="通道" prop="platformChannelId">
            <el-select v-model="queryParams.platformChannelId" placeholder="请选择通道" clearable size="medium">
              <el-option v-for="(item, i) in channelAll" :key="i" :label="item.channelName" :value="item.id"></el-option>
            </el-select>
          </el-form-item>

          <el-form-item label="状态" prop="orderStatus">
            <el-select v-model="queryParams.orderStatus" placeholder="请选择状态" clearable size="medium">
              <el-option v-for="(item, i) in statusAll" :key="i" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>

          <el-form-item label="创建时间">
            <el-date-picker v-model="dateRange[0]" size="small" style="width: 340px" value-format="yyyy-MM-dd HH:mm:ss"
              type="datetimerange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
              :unlink-panels="true" :default-time="['00:00:00', '23:59:59']"></el-date-picker>
          </el-form-item>

          <el-form-item label="更新时间">
            <el-date-picker v-model="dateRange[1]" size="small" style="width: 340px" value-format="yyyy-MM-dd HH:mm:ss"
              type="datetimerange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
              :unlink-panels="true" :default-time="['00:00:00', '23:59:59']"></el-date-picker>
          </el-form-item>
        </el-collapse-item>
      </el-collapse>
      <el-form-item style="margin-left:10px">
        <div class="searchTop flexBet" style="align-items: center">
          <el-row :gutter="10" class="mb8">
            <el-button type="primary" icon="" size="medium" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="medium" @click="resetQuery">重置</el-button>
            <el-button type="primary" plain icon="" size="medium" @click="handleExport()">导出</el-button>
          </el-row>


        </div>
      </el-form-item>
    </el-form>

    <!-- <div class="searchTop flexBet">
        <el-row :gutter="10" class="mb8">
              <el-col :span="1.5">
                <el-button type="primary" plain icon="" size="medium" @click="handleExport()">导出</el-button>
              </el-col>
            </el-row>
            <el-row :gutter="10" class="mb8">
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      </el-row>
      </div> -->


    <div class="bg">


      <el-table stripe :data="infoList" v-loading="loading" :row-class-name="tableRowClassName">
        <el-table-column label="平台订单号" align="center" prop="orderNo" />
        <el-table-column label="商户订单号" align="center" prop="merchantOrderNo" />
        <el-table-column label="商户下游订单号" align="center" prop="downstreamMerchantOrderNo" min-width="120" />

        <el-table-column label="商户" align="center" prop="merchantName" />

        <el-table-column :label="'订单金额'" align="center" prop="securityDepositAmount">
          <template slot-scope="scope">
            {{ parseFloat(NumberDiv(scope.row.reqAmount, 100)).toFixed(2) }}
          </template>
        </el-table-column>

        <!-- <el-table-column :label="'实际支付金额'" align="center" prop="balance">
          <template slot-scope="scope">
            {{ NumberDiv(scope.row.paymentAmount, 100) }}
          </template>
        </el-table-column>

        <el-table-column label="付款人" align="center" prop="carddealerCardHolder" /> -->
        <el-table-column label="卡号" align="center" prop="carddealerCardNumber" />
        <el-table-column label="姓名" align="center" prop="carddealerCardHolder" />
        <el-table-column label="银行" align="center" prop="carddealerBankName" />
        <el-table-column label="付款人姓名" align="center" prop="payerName" />
        <!-- <el-table-column label="支行" align="center" prop="carddealerCardOrganization" /> -->
        <el-table-column label="通道" align="center" prop="platformChannelName" />
        <el-table-column label="码商" align="center" prop="carddealerName" />
        <!-- <el-table-column :label="'是否超时支付'" align="center" prop="balance">
          <template slot-scope="scope">
            {{ scope.row.isTimeoutPay == 1 ? '是' : '否' }}
          </template>
        </el-table-column> -->
        <el-table-column :label="'状态'" align="center" prop="balance">
          <template slot-scope="scope">
            {{ scope.row.orderStatus == 1 ? '待支付' : scope.row.orderStatus == 2 ? '成功' : '已超时' }}
          </template>
        </el-table-column>

        <el-table-column label="创建时间" align="center" prop="createTime" min-width="180" />
        <el-table-column label="更新时间" align="center" prop="updateTime" min-width="180" />

        <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
          <template slot-scope="scope">
            <el-button size="small" type="text" @click="handleView(scope.row)" style="color: #006eff">详情</el-button>
            <el-button size="small" type="text" @click="handleOver(scope.row)" style="color: #006eff">已收款</el-button>
            <!-- <el-button size="small" type="text" @click="handleNotify(scope.row)" style="color: #006eff">通知</el-button> -->
          </template>
        </el-table-column>
      </el-table>
      <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
        @pagination="getList">
      </pagination>
    </div>


    <!-- 详情 -->
    <el-dialog v-dialogDrag :close-on-click-modal="false" :title="detailTitle" :visible.sync="isShowDetail" width="50%"
      append-to-body>
      <el-form label-width="142px" :label-suffix="':'">
        <div style="display: flex;justify-content: space-around;">
          <div class="card-detail">
            <el-form-item label="付款人姓名">
              {{ detailInfoList.payerName }}
            </el-form-item>
            <el-form-item label="平台单号">
              {{ detailInfoList.orderNo }}
            </el-form-item>
            <el-form-item label="商户订单号">
              {{ detailInfoList.merchantOrderNo }}
            </el-form-item>
            <el-form-item label="商户下游订单号">
              {{ detailInfoList.downstreamMerchantOrderNo }}
            </el-form-item>
            <el-form-item label="商户名称">
              {{ detailInfoList.merchantName }}
            </el-form-item>
            <el-form-item label="商户编号">
              {{ detailInfoList.merchantNo }}
            </el-form-item>
            <el-form-item label="订单请求金额">
              {{ parseFloat(NumberDiv(detailInfoList.reqAmount, 100)).toFixed(2) }}
            </el-form-item>
            <el-form-item label="实付金额">
              {{ parseFloat(NumberDiv(detailInfoList.paymentAmount, 100)).toFixed(2) }}
            </el-form-item>
            <el-form-item label="手续费">
              {{ parseFloat(NumberDiv(detailInfoList.merchantFee, 100)).toFixed(2) }}
            </el-form-item>
            <el-form-item label="到账金额">
              {{ parseFloat(NumberDiv(detailInfoList.increaseAmount, 100)).toFixed(2) }}
            </el-form-item>
            <el-form-item label="创建时间">
              {{ detailInfoList.createTime }}
            </el-form-item>
            <el-form-item label="订单状态">
              {{ detailInfoList.orderStatus == 1 ? '待支付' : detailInfoList.orderStatus == 2 ? '成功' : '已超时' }}
            </el-form-item>
            <el-form-item label="商品名称">
              {{ detailInfoList.subject }}
            </el-form-item>
            <el-form-item label="更新时间">
              {{ detailInfoList.updateTime }}
            </el-form-item>
          </div>
          <div class="card-detail">
            <el-form-item label="收款卡号">
              {{ detailInfoList.carddealerCardNumber }}
            </el-form-item>
            <el-form-item label="银行名称">
              {{ detailInfoList.carddealerBankName }}
            </el-form-item>
            <el-form-item label="开户行">
              {{ detailInfoList.carddealerCardOrganization }}
            </el-form-item>
            <el-form-item label="收款人">
              {{ detailInfoList.cardHolder }}
            </el-form-item>
            <el-form-item label="通道">
              {{ detailInfoList.channelName }}
            </el-form-item>
            <el-form-item label="异步通知状态" v-if="detailInfoList.orderStatus != 3">
              {{ detailInfoList.notifyStatus == 0 ? '未通知' : detailInfoList.notifyStatus == 1 ? '成功' :
                detailInfoList.notifyStatus == 2 ? '通知进行中' : '超时' }}
            </el-form-item>
            <el-form-item label="回调方式" v-if="detailInfoList.orderStatus != 3">
              {{ detailInfoList.isAutoNotify == 1 ? '自动回调' : '手动回调' }}
            </el-form-item>
            <el-form-item label="通道费率">
              {{ detailInfoList.merchantRate + '%+' + parseFloat(NumberDiv(detailInfoList.merchantSingleFee,
                100)).toFixed(2) }}
            </el-form-item>
            <el-form-item label="操作人">
              {{ detailInfoList.notifyRemark }}
            </el-form-item>
            <el-form-item label="是否超时支付">
              {{ detailInfoList.isTimeoutPay == 1 ? '是' : '否' }}
            </el-form-item>
            <el-form-item label="操作时间">
              {{ detailInfoList.updateTime }}
            </el-form-item>
          </div>
        </div>

      </el-form>
    </el-dialog>


    <!-- 已收款 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="110px">
        <el-form-item label="订单金额" prop="reqAmount">
          <el-input v-model="form.reqAmount" placeholder="" style="width:350px" :disabled="true" />
        </el-form-item>

        <el-form-item label="支付金额" prop="paymentAmount">
          <el-input v-model="form.paymentAmount" placeholder="" style="width:350px" @input="change" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm('form')">保 存</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

  </div>
</template>

<script>
import { listPayOrder, getPayOrder, delPayOrder, addPayOrder, updatePayOrder, exportPayOrder } from "@/api/order/payOrder";
import { common_api, payToOrder } from "@/api/form";
import cardMerchantOrderRefreshMixin from "@/api/cardMerchantOrderRefresh.mixin";

export default {
  name: "PayOrder",
  components: {
  },
  mixins: [cardMerchantOrderRefreshMixin],

  data() {
    return {
      dateRange: [],
      // 所有通道
      channelAll: [],
      // 状态
      statusAll: [
        {
          label: '全部',
          value: null,
        },
        {
          label: '待支付',
          value: 1,
        },
        {
          label: '成功',
          value: 2,
        },
        {
          label: '已超时',
          value: 3,
        },
      ],
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 代收订单表格数据
      infoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        orderNo: null,
        merchantOrderNo: null,
        carddealerCardNumber: null,
        merchantName: null,
        carddealerName: null,
        payerName: null,
        orderAmount: null,
        channelName: null,
        orderStatus: 1,
        carddealerCardHolder: null,
        reqAmount: null,
        platformChannelId: null,
        downstreamMerchantOrderNo:null
      },
      // 显示详情
      isShowDetail: false,
      // 详情
      detailTitle: "",
      // 详情的数据
      detailInfoList: {},
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        paymentAmount: [
          { required: true, message: "支付金额不能为空", trigger: "blur" }
        ],
        orderNo: [
          { required: true, message: "平台单号不能为空", trigger: "blur" }
        ],
        merchantOrderNo: [
          { required: true, message: "商户订单号(即下游订单号)不能为空", trigger: "blur" }
        ],
        merchantId: [
          { required: true, message: "商户id不能为空", trigger: "blur" }
        ],
        merchantNo: [
          { required: true, message: "商户编号不能为空", trigger: "blur" }
        ],
        reqAmount: [
          { required: true, message: "订单请求金额不能为空", trigger: "blur" }
        ],
        increaseAmount: [
          { required: true, message: "账户增加的金额不能为空", trigger: "blur" }
        ],
        merchantFee: [
          { required: true, message: "商户手续费(扣商户)不能为空", trigger: "blur" }
        ],
        merchantRate: [
          { required: true, message: "商户费率不能为空", trigger: "blur" }
        ],
        merchantSingleFee: [
          { required: true, message: "商户单笔手续费不能为空", trigger: "blur" }
        ],
        orderStatus: [
          { required: true, message: "订单状态:1-待支付;2-已支付;3-支付失败不能为空", trigger: "blur" }
        ],
        createTime: [
          { required: true, message: "创建时间不能为空", trigger: "blur" }
        ],
        updateTime: [
          { required: true, message: "更新时间不能为空", trigger: "blur" }
        ],
        notifyUrl: [
          { required: true, message: "异步通知url不能为空", trigger: "blur" }
        ],
        returnUrl: [
          { required: true, message: "同步跳转url不能为空", trigger: "blur" }
        ],
        platformChannelId: [
          { required: true, message: "平台通道id(来自platform_channel表id)不能为空", trigger: "blur" }
        ],
        channelCode: [
          { required: true, message: "通道代码(来自platform_channel表channel_code)不能为空", trigger: "blur" }
        ],
        notifyStatus: [
          { required: true, message: "异步通知状态(0未通知,1成功,2通知进行中,3超时)不能为空", trigger: "blur" }
        ],
        notifyFailTimes: [
          { required: true, message: "通知失败的次数不能为空", trigger: "blur" }
        ],
        nextNotifyTime: [
          { required: true, message: "下次通知时间(通知失败时才有)不能为空", trigger: "blur" }
        ],
        subject: [
          { required: true, message: "商品的标题/交易标题/订单标题/订单关键字等不能为空", trigger: "blur" }
        ],
        mode: [
          { required: true, message: "模式：test|pro(测试|生产)不能为空", trigger: "blur" }
        ],
        paymentAmount: [
          { required: true, message: "实际支付金额不能为空", trigger: "blur" }
        ],
        cardId: [
          { required: true, message: "卡id(来自carddealer_card表id)不能为空", trigger: "blur" }
        ],
        carddealerId: [
          { required: true, message: "卡商id(来自carddealer表id)不能为空", trigger: "blur" }
        ],
        isCommission: [
          { required: true, message: "是否已经分佣(1是，2否)不能为空", trigger: "blur" }
        ],
        isTimeoutPay: [
          { required: true, message: "是超时支付(1-是，2-否)不能为空", trigger: "blur" }
        ],
        carddealerFrozenAmount: [
          { required: true, message: "卡商冻结金额不能为空", trigger: "blur" }
        ],
        expiredTime: [
          { required: true, message: "订单过期时间(指定到某个时间点过期，来自global_config)不能为空", trigger: "blur" }
        ],
        payerName: [
          { required: true, message: "付款人姓名不能为空", trigger: "blur" }
        ],
        isCrypto: [
          { required: true, message: "是否加密货币不能为空", trigger: "blur" }
        ],
        recvAddr: [
          { required: true, message: "收款地址不能为空", trigger: "blur" }
        ],
        queryTime: [
          { required: true, message: "最后查询时间不能为空", trigger: "blur" }
        ],
        txid: [
          { required: true, message: "交易id不能为空", trigger: "blur" }
        ],
        fromAddr: [
          { required: true, message: "付款地址不能为空", trigger: "blur" }
        ],
        orgReqAmount: [
          { required: true, message: "发起的金额不能为空", trigger: "blur" }
        ]
      },
      reqAmount: null,
    };
  },
  created() {
    this.getList();
    this.init()
  },
  $autoRefresh: {
    // 刷新间隔时间
    interval: 1000 * 15,
    // 立即执行一次
    immediate: false,
    // 被回调的函数, 不保证顺序执行
    handles: ["getList"],
    /**
     * 调用 handles 后的回调函数
     * 这个字段为数组类型, 数组中的每个元素都是一个函数, 在对应索引的 handle 执行后被调用
     */
    callbacks: [],
    // 是否启用调试模式
    debug: true,
  },
  methods: {
    tableRowClassName({ row, rowIndex }) {
      if (row.orderStatus == 3) {
        return "redOrder";
      }
      if (this.NumberDiv(row.reqAmount, 100) != this.NumberDiv(row.paymentAmount, 100)) {
        return "yellowOrder";
      }
      if (row.orderStatus == 2) {
        return "greenOrder";
      }
    },
    change() {
      this.$forceUpdate()
    },
    // 超时
    handleOver(row) {
      const id = row.orderNo;
      getPayOrder(id).then((response) => {
        this.form = response.data;
        let a = response.data.reqAmount
        let b = response.data.reqAmount
        this.form.reqAmount = this.NumberDiv(a, 100)
        this.form.paymentAmount = this.NumberDiv(b, 100)
        this.open = true;
        this.title = "已收款";
      });
    },
    init() {
      common_api.platformChannelAll().then(response => {
        for (var i = 0; i < response.data.length; i++) {
          if (response.data[i].channelType == 1) {
            this.channelAll.push(response.data[i])
          }
        }
      });
    },
    timerHandler() {
      let queryParams = {
        pageNum: this.queryParams.pageNum,
        pageSize: this.queryParams.pageSize,
        orderNo: this.queryParams.orderNo,
        merchantOrderNo: this.queryParams.merchantOrderNo,
        carddealerCardNumber: this.queryParams.carddealerCardNumber,
        merchantName: this.queryParams.merchantName,
        carddealerName: this.queryParams.carddealerName,
        payerName: this.queryParams.payerName,
        orderAmount: this.queryParams.orderAmount,
        channelName: this.queryParams.channelName,
        orderStatus: this.queryParams.orderStatus,
        carddealerCardHolder: this.queryParams.carddealerCardHolder,
        reqAmount: typeof (this.reqAmount) == 'object' ? null : !this.reqAmount ? null : parseFloat(this.reqAmount),
        platformChannelId: this.queryParams.platformChannelId,
        downstreamMerchantOrderNo:this.queryParams.downstreamMerchantOrderNo
      }
      listPayOrder(this.addSESDateRange(queryParams, this.dateRange, 'type')).then(response => {
        this.infoList = response.rows;
        this.total = Number(response.total);
      });
    },
    /** 查询代收订单列表 */
    getList(reqAmount) {
      this.loading = true;
      let queryParams = {
        pageNum: this.queryParams.pageNum,
        pageSize: this.queryParams.pageSize,
        orderNo: this.queryParams.orderNo,
        merchantOrderNo: this.queryParams.merchantOrderNo,
        carddealerCardNumber: this.queryParams.carddealerCardNumber,
        merchantName: this.queryParams.merchantName,
        carddealerName: this.queryParams.carddealerName,
        payerName: this.queryParams.payerName,
        orderAmount: this.queryParams.orderAmount,
        channelName: this.queryParams.channelName,
        orderStatus: this.queryParams.orderStatus,
        carddealerCardHolder: this.queryParams.carddealerCardHolder,
        reqAmount: typeof (reqAmount) == 'object' ? null : !reqAmount ? null : parseFloat(reqAmount),
        platformChannelId: this.queryParams.platformChannelId,
        downstreamMerchantOrderNo:this.queryParams.downstreamMerchantOrderNo
      }
      listPayOrder(this.addSESDateRange(queryParams, this.dateRange, 'type')).then(response => {
        this.infoList = response.rows;
        this.total = Number(response.total);
        this.loading = false;
        this.startTimer(queryParams)
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.dateRange = []
      this.form = {

      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      var reqAmount;
      this.queryParams.reqAmount ? reqAmount = this.NumberMul(this.queryParams.reqAmount, 100) : this.queryParams.reqAmount
      reqAmount = parseFloat(reqAmount)
      this.queryParams.pageNum = 1;
      reqAmount ? this.reqAmount = reqAmount : this.reqAmount = null
      reqAmount ? this.getList(reqAmount) : this.getList(null)
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRange = []
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加代收订单";
    },
    // 查看详情
    handleView(row) {
      const id = row.orderNo;
      getPayOrder(id).then((response) => {
        this.detailInfoList = response.data;
        this.isShowDetail = true;
        this.detailTitle = "详情";
      });
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getPayOrder(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改代收订单";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          let paymentAmount = this.NumberMul(this.form.paymentAmount, 100)
          payToOrder.payOrderOvertimePayment({
            orderNo: this.form.orderNo,
            paymentAmount: paymentAmount,
            isTimeoutPay: 2,
          }).then(response => {
            this.msgSuccess("操作成功");
            this.open = false;
            this.getList();
          });
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$confirm('是否确认删除代收订单编号为"' + ids + '"的数据项?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(function () {
        return delPayOrder(ids);
      }).then(() => {
        this.getList();
        this.msgSuccess("删除成功");
      })
    },
    // 通知
    handleNotify(row) {
      this.reset()
      payToOrder.notify(row.orderNo).then(response => {
        this.msgSuccess("操作成功");
        this.getList();
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      if (this.dateRange.length) {
                if (this.dateRange[0]) {
                    this.queryParams.beginTime = this.dateRange[0][0]
                    this.queryParams.endTime = this.dateRange[0][1]
                }else{
                    this.queryParams.beginTime = null
                    this.queryParams.endTime = null
                }
                if (this.dateRange[1]) {
                    this.queryParams.updateBeginTime = this.dateRange[1][0]
                    this.queryParams.updateEndTime = this.dateRange[1][1]
                }else{
                    this.queryParams.updateBeginTime = null
                    this.queryParams.updateEndTime = null
                }
            } else {
                this.queryParams.beginTime = null
                this.queryParams.endTime = null
                this.queryParams.updateBeginTime = null
                this.queryParams.updateEndTime = null
            }
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有代收订单数据项?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(function () {
        return exportPayOrder(queryParams);
      }).then(response => {
        this.download(response.msg);
      })
    }
  }
};
</script>
<style>
.yellowOrder {
  background: #FEFEE5 !important;
}

.greenOrder {
  background: #E9FEEA !important;
}

.redOrder {
  background: #FDF2F2 !important;
}
</style>
<style scoped>
::v-deep .el-table tbody tr:hover>td {
  background-color: rgba(0, 0, 0, 0) !important
}

::v-deep .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {
  background: none !important;
}
</style>


