<template>
  <div id="invoice_red_letter">
    <div class="search">
      <el-input
          v-model="sellerEntName"
          clearable
          prefix-icon="el-icon-search"
          placeholder="请输入销方企业名称"
          class="search_input"
      >
      </el-input>
      <el-input
          v-model="buyerEntName"
          clearable
          prefix-icon="el-icon-search"
          placeholder="请输入购方企业名称"
          class="search_input"
      >
      </el-input>
      <el-input
          v-model="invoiceNumber"
          clearable
          prefix-icon="el-icon-search"
          placeholder="请输入发票号码"
          class="search_input"
      >
      </el-input>
      <el-input
          v-model="invoiceCode"
          clearable
          prefix-icon="el-icon-search"
          placeholder="请输入发票代码"
          class="search_input"
      >
      </el-input>
      <el-select v-model="applicationStatus" placeholder="请选择申请状态">
        <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
            class="search_input"
        >
        </el-option>
      </el-select>
      <el-input
          v-model="redLetterNumber"
          clearable
          prefix-icon="el-icon-search"
          placeholder="请输入红字信息编号"
          class="search_input"
      >
      </el-input>
      <el-date-picker
          v-model="startDate"
          type="date"
          placeholder="请选择起始日期"
          class="search_input"
          value-format="yyyy-MM-dd"
      >
      </el-date-picker>
      <el-date-picker
          v-model="endDate"
          type="date"
          placeholder="请选择结束日期"
          class="search_input"
          value-format="yyyy-MM-dd"
      >
      </el-date-picker>
      <el-button
          @click="getRedLetterList"
          type="primary"
          icon="el-icon-search"
      >搜索
      </el-button
      >
      <el-button
          class="invoice_button"
          type="primary"
          v-on:click="redLetterSearchClean"
      >重 置
      </el-button
      >
    </div>
    <div style="margin: 5px">
      <el-button v-on:click="invoiceManual" type="primary" icon="el-icon-search">手工填开</el-button>
      <!--      <el-button @click="handleResetSearch">导入填开</el-button>-->
      <!--      <el-button @click="handleSearch" type="primary" icon="el-icon-search">导入模版下载</el-button>-->
      <!--      <el-button @click="handleResetSearch">批量删除</el-button>-->
      <!--      <el-button @click="handleSearch" type="primary" icon="el-icon-search">刷新</el-button>-->
      <!--      <el-button @click="handleResetSearch">批量上传</el-button>-->
      <!--      <el-button @click="handleSearch" type="primary" icon="el-icon-search">批量下载</el-button>-->
      <!--      <el-button @click="handleResetSearch">审核下载</el-button>-->
      <!--      <el-button @click="handleResetSearch">批量导出</el-button>-->
    </div>
    <div>
      <el-container>
        <el-table
            :data="redLetterList"
            border
            style="width: 100%; flex: 1"
            :height="tableHeight"
            ref="table"
        >
          <el-table-column
              prop="applyEntTaxId"
              label="申请方税号"
              width="160"
          ></el-table-column>
          <el-table-column
              prop="applyType"
              label="申请类型"
              width="120"
              :formatter="getApplyType"
          ></el-table-column>
          <el-table-column
              prop="deductedFlag"
              label="是否已抵扣"
              width="120"
              :formatter="getDeductedFlag"
          ></el-table-column>
          <el-table-column
              prop="applyStatus"
              label="申请状态"
              width="100"
              :formatter="getApplyStatus"
          ></el-table-column>
          <el-table-column
              prop="statusMemo"
              label="状态描述"
              width="100"
          ></el-table-column>
          <el-table-column
              prop="applyNo"
              label="红字信息申请编号"
              width="190"
          ></el-table-column>
          <el-table-column
              prop="redInfoNo"
              label="红字信息编号"
              width="130"
          ></el-table-column>
          <el-table-column
              prop="invoiceCode"
              label="发票代码"
              width="120"
          ></el-table-column>
          <el-table-column
              prop="invoiceNumber"
              label="发票号码"
              width="120"
          ></el-table-column>
          <el-table-column
              prop="invoiceCategory"
              label="发票种类"
              width="160"
              :formatter="getInvoiceType"
          ></el-table-column>
          <el-table-column
              prop="sellerEntName"
              label="销方名称"
              width="160"
          ></el-table-column>
          <el-table-column
              prop="sellerEntTaxId"
              label="销方税号"
              width="160"
          ></el-table-column>
          <el-table-column
              prop="buyerEntName"
              label="购方名称"
              width="160"
          ></el-table-column>
          <el-table-column
              prop="buyerEntTaxId"
              label="购方税号"
              width="160"
          ></el-table-column>
          <el-table-column
              prop="totalAmountTaxes"
              label="价税合计"
              width="100"
          ></el-table-column>
          <el-table-column
              prop="totalAmount"
              label="总金额"
              width="100"
          ></el-table-column>
          <el-table-column
              prop="totalTaxes"
              label="总税额"
              width="100"
          ></el-table-column>
          <el-table-column
              prop="contactPhone"
              label="联系电话"
              width="160"
          ></el-table-column>
          <el-table-column
              prop="applyReason"
              label="申请理由"
              width="160"
          ></el-table-column>
          <el-table-column
              prop="createTime"
              label="创建时间"
              width="160"
          ></el-table-column>
          <el-table-column
              fixed="right"
              label="操作"
              align="center"
              width="280"
          >
            <template slot-scope="scope">
              <el-button
                  @click="redLetterSee(scope.row)"
                  type="primary"
                  size="mini"
              >查看
              </el-button
              >
              <el-button
                  v-if="scope.row.applyStatus === 0"
                  @click="redLetterEdit(scope.row)"
                  type="primary"
                  size="mini"
              >编辑
              </el-button>
              <el-button
                  v-if="scope.row.applyStatus === 0 || scope.row.applyStatus === 1"
                  @click="redLetterDelete(scope.row)"
                  type="primary"
                  size="mini"
              >删除
              </el-button>
              <el-button
                  v-if="scope.row.applyStatus !== 5 && scope.row.applyStatus !== 0"
                  @click="statusRefresh(scope.row)"
                  type="primary"
                  size="mini"
              >刷新
              </el-button>
              <el-button
                  v-if="scope.row.applyStatus === 0"
                  @click="submitInvoice(scope.row)"
                  type="primary"
                  size="mini"
              >提交
              </el-button>
              <el-button
                  v-if="scope.row.applyStatus === 5"
                  @click="redLetterRevoke(scope.row)"
                  type="primary"
                  size="mini"
              >撤销
              </el-button>
              <el-button
                  v-if="scope.row.applyStatus === 5"
                  @click="getRedLetterData(scope.row)"
                  type="primary"
                  size="mini"
              >导出
              </el-button>
              <el-button
                  v-if="scope.row.applyStatus === 5"
                  @click="redInvoicePrint(scope.row)"
                  type="primary"
                  size="mini"
              >打印
              </el-button
              >
            </template>
          </el-table-column>
        </el-table>
      </el-container>
    </div>
    <div style="height: 50px">
      <el-row type="flex" :gutter="20">
        <el-col :span="12"></el-col>
        <el-col :span="12">
          <div style="text-align: right">
            <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="pageNum"
                :page-sizes="pageSizes"
                :page-size="pageSize"
                layout="total, sizes, prev, pager, next"
                :total="totalNumber"
            >
            </el-pagination>
          </div>
        </el-col>
      </el-row>
    </div>
    <el-dialog
        title="开具红字发票信息选择(专用发票)"
        :visible.sync="isSHowManual"
        center
        :close-on-click-modal="false"
        v-on:closed="redAddPageClose"
    >
      <invoice_red_letter_add
          ref="invoiceRedLetterAdd"
          :invoiceRedLetterAdd="this"
      ></invoice_red_letter_add>
      <span slot="footer">
                <el-button type="primary" v-on:click="invoiceRedLetterNext"
                >下一步</el-button
                >
                <el-button type="primary" v-on:click="redLetterCancel"
                >取消</el-button
                >
            </span>
    </el-dialog>
    <el-dialog
        title="红字信息表填开"
        :visible.sync="isShowInput"
        center
        width="70%"
        :close-on-click-modal="false"
        :append-to-body="true"
        v-on:opened="redInfoPageOpen"
        v-on:closed="redInfoPageClose"
    >
      <invoice_red_letter_info
          ref="invoiceRedLetterInfo"
          :invoiceRedLetterInfo="this"
      ></invoice_red_letter_info>
    </el-dialog>
    <el-dialog
        title="红字信息表编辑"
        :visible.sync="isShowEdit"
        center
        width="70%"
        :close-on-click-modal="false"
        :append-to-body="true"
        v-on:opened="redEditPageOpen"
    >
      <invoice_red_letter_edit
          ref="invoiceRedLetterEdit"
          :invoiceRedLetterEdit="this"
      ></invoice_red_letter_edit>
    </el-dialog>
    <el-dialog
        title="红字信息表详情"
        :visible.sync="isShowSee"
        center
        width="70%"
        :append-to-body="true"
        v-on:opened="redSeePageOpen"
    >
      <invoice_red_letter_see
          ref="invoiceRedLetterSee"
          :invoiceRedLetterSee="this"
      ></invoice_red_letter_see>
    </el-dialog>
  </div>
</template>

<script>
import invoiceRedLetterAdd from '@/pages/invoice_management/components/invoice_red_letter_add'
import invoiceRedLetterInfo from '@/pages/invoice_management/components/invoice_red_letter_info'
import invoiceRedLetterEdit from '@/pages/invoice_management/components/invoice_red_letter_edit'
import invoiceRedLetterSee from '@/pages/invoice_management/components/invoice_red_letter_see'
import { AxiosRequestData } from '@/data/axios_request'
import cache from '@/utils/cache'
import FileSaver from 'file-saver'
import INVOICE_RED_TABLE_XML from '@/utils/invoice-red-table-xml'
import { InvoiceProducts, RedLetterInfoProduct, RedInvoiceSubmit } from '@/data/invoice_calculation'

export default {
  name: 'invoice_red_letter',
  components: {
    invoice_red_letter_add: invoiceRedLetterAdd,
    invoice_red_letter_info: invoiceRedLetterInfo,
    invoice_red_letter_edit: invoiceRedLetterEdit,
    invoice_red_letter_see: invoiceRedLetterSee,
  },
  data() {
    return {
      tableHeight: '',
      isSHowManual: false,
      isShowInput: false,
      invoiceCode: '',
      invoiceNumber: '',
      options: [
        {
          value: 0,
          label: '保存'
        },
        {
          value: 1,
          label: '未上传'
        },
        {
          value: 2,
          label: '上传中'
        },
        {
          value: 3,
          label: '上传失败'
        },
        {
          value: 4,
          label: '已核销，待查证'
        },
        {
          value: 5,
          label: '审核通过'
        },
        {
          value: 6,
          label: '查证未通过'
        }
      ],
      applicationStatus: null,
      redLetterNumber: '',
      startDate: '',
      endDate: '',
      sellerEntName: '',
      buyerEntName: '',
      redLetterList: [],
      pageNum: 1,
      pageSize: 10,
      totalNumber: 0,
      totalPage: 0,
      pageSizes: [10, 30, 50, 100],
      entTaxId: '',
      token: '',
      isShowSee: false,
      isShowEdit: false,
      requestId: '',
      account: ''
    }
  },
  created() {
    this.tableHeight = window.innerHeight - 250
    this.token = cache.getToken()
    let company = JSON.parse(cache.getSession('company'))
    let user = JSON.parse(cache.getSession('user'))
    this.account = user.account
    this.entTaxId = company.entTaxId
    this.getRedLetterList()
  },
  mounted() {
    this.tableHeight = window.innerHeight - 250
    window.onresize = () => {
      return (() => {
        this.tableHeight = window.innerHeight - 250
      })()
    }
  },
  methods: {
    // 获取申请类型
    getApplyType(row, column, cellValue) {
      if (cellValue === 1) {
        return '购方申请'
      }
      if (cellValue === 2) {
        return '销方申请'
      } else {
        return ''
      }
    },
    // 获取抵扣状态
    getDeductedFlag(row, column, cellValue) {
      if (cellValue === true) {
        return '已抵扣'
      }
      if (cellValue === false) {
        return '未抵扣'
      } else {
        return ''
      }
    },
    // 获取申请状态
    getApplyStatus(row, column, cellValue) {
      if (cellValue === 0) {
        return '保存'
      }
      if (cellValue === 1) {
        return '未上传'
      }
      if (cellValue === 2) {
        return '上传中'
      }
      if (cellValue === 3) {
        return '上传失败'
      }
      if (cellValue === 4) {
        return '已核销，待查证'
      }
      if (cellValue === 5) {
        return '审核通过'
      } else {
        return ''
      }
    },
    // 获取发票类型
    getInvoiceType(row, column, cellValue) {
      if (cellValue === 1) {
        return '增值税普通电子发票'
      }
      if (cellValue === 2) {
        return '增值税电子专用发票'
      }
      if (cellValue === 3) {
        return '增值税普通纸质发票'
      }
      if (cellValue === 4) {
        return '增值税专用纸质发票'
      } else {
        return ''
      }
    },
    // 变更每页显示的数据条数
    handleSizeChange(val) {
      this.pageSize = val
      this.getRedLetterList()
    },
    // 翻页
    handleCurrentChange(val) {
      this.pageNum = val
      this.getRedLetterList()
    },
    // 显示红字信息表选择信息页面
    invoiceManual() {
      this.isSHowManual = true
    },
    // 点击下一步
    invoiceRedLetterNext() {
      let status = this.$refs.invoiceRedLetterAdd.dataCheck()
      if (status) {
        this.isShowInput = true
      }
    },
    // 红字信息表填开返回上一页
    invoiceRedLetterReturn() {
      this.isShowInput = false
    },
    // 红字信息表打开
    redInfoPageOpen() {
      this.$refs.invoiceRedLetterInfo.setInvoiceInfo()
    },
    // 红字信息表关闭
    redInfoPageClose() {
      this.$refs.invoiceRedLetterInfo.clearInfo(false)
    },
    // 红字信息表编辑打开
    redEditPageOpen() {
      this.$refs.invoiceRedLetterEdit.setInvoiceInfo()
    },
    // 红字信息表查看打开
    redSeePageOpen() {
      this.$refs.invoiceRedLetterSee.setInvoiceInfo()
    },
    // 红字信息表查询
    async getRedLetterList() {
      if (this.startDate !== '') {
        this.startDate += ' 00:00:00'
      }
      if (this.endDate !== '') {
        this.endDate += ' 23:59:59'
      }
      if (this.token && this.entTaxId) {
        const url = '/sys/invoice/redInfo/findPage'
        let response = await AxiosRequestData(
            url,
            this.token,
            {
              applyEntTaxId: this.entTaxId,
              sellerEntName: this.sellerEntName,
              buyerEntName: this.buyerEntName,
              invoiceNumber: this.invoiceNumber,
              applyStatus: this.invoiceCode,
              redInfoNo: this.applicationStatus,
              createTimeBegin: this.startDate,
              createTimeEnd: this.endDate,
              pageNum: this.pageNum,
              pageSize: this.pageSize,
            },
            false,
            2
        )
        if (response) {
          if (response.code === 0) {
            console.log(7788)
            console.log(response)
            this.totalNumber = response.data.total
            this.totalPage = response.data.pages
            this.redLetterList = response.data.records
          }
        }
      }
    },
    // 清空搜索栏信息
    redLetterSearchClean() {
      this.invoiceCode = ''
      this.invoiceNumber = ''
      this.applicationStatus = null
      this.redLetterNumber = ''
      this.startDate = ''
      this.endDate = ''
      this.sellerEntName = ''
      this.buyerEntName = ''
    },
    // 红字申请取消
    redLetterCancel() {
      this.isSHowManual = false
    },
    // 查看红字信息表
    redLetterSee(row) {
      this.requestId = row.requestId
      this.isShowSee = true
    },
    // 编辑红字信息表
    redLetterEdit(row) {
      this.requestId = row.requestId
      this.isShowEdit = true
    },
    // 红字信息表保存
    infoSave() {
      this.isSHowManual = false
      this.isShowInput = false
      this.getRedLetterList()
    },
    // 提交
    async submitInvoice(row) {
      if (this.token) {
        const url = '/sys/invoice/redInfo/findApplyDetail'
        let response = await AxiosRequestData(
            url,
            this.token,
            {
              requestId: row.requestId,
            },
            false,
            2
        )
        if (response) {
          if (response.code === 0) {
            let invoiceInfo = RedInvoiceSubmit(response.data.REQUEST_COMMON_HZSQ)
            const url = '/sys/invoice/redInfo/commit'
            let responseInfo = await AxiosRequestData(
                url,
                this.token,
                {
                  applyEntTaxId: this.entTaxId,
                  requestId: row.requestId,
                  mobile: this.account,
                  hzsqCmdParam: {
                    REQUEST_COMMON_HZSQ: invoiceInfo
                  },
                  reqChannel: 4,
                },
                false,
                1
            )
            if (responseInfo) {
              if (responseInfo.code === 0) {
                this.$message({
                  message: '提交成功！',
                  type: 'success',
                })
                await this.getRedLetterList()
              } else {
                this.$message.error(responseInfo.msg)
              }
            }
          }
        }
      }
    },
    // 红字信息选择页面关闭
    redAddPageClose() {
      this.$refs.invoiceRedLetterAdd.cleanData()
    },
    // 编辑红字信息页面关闭
    redLetterEditShow() {
      this.isShowEdit = false
      this.getRedLetterList()
    },
    // 红字信息表打印
    redInvoicePrint(row) {
      let data = {
        requestId: row.requestId,
        redInfoNo: row.redInfoNo,
        createTime: row.createTime,
      }
      let pageInfo = this.$router.resolve({
        path: '/red_letter_info_print',
        query: { data: JSON.stringify(data) },
      })
      window.open(pageInfo.href, '_blank')
    },
    // 导出
    handleExport(data, row) {
      let objRedInvReqBill = INVOICE_RED_TABLE_XML.createObjRedInvReqBill()
      objRedInvReqBill.ReqBillNo = row.applyNo
      objRedInvReqBill.ResBillNo = row.redInfoNo
      objRedInvReqBill.StatusDM = row.applyStatus
      objRedInvReqBill.StatusMC = '审核通过'
      objRedInvReqBill.BillType = row.applyType
      objRedInvReqBill.TypeCode = row.invoiceCode
      objRedInvReqBill.InvNo = row.invoiceNumber
      objRedInvReqBill.Szlb = ''
      objRedInvReqBill.IsMutiRate = ''
      objRedInvReqBill.Date = row.createTime
      objRedInvReqBill.BuyerName = row.buyerEntName
      objRedInvReqBill.BuyTaxCode = row.buyerEntTaxId
      objRedInvReqBill.SellerName = row.sellerEntName
      objRedInvReqBill.SellTaxCode = row.sellerEntTaxId
      objRedInvReqBill.Amount = -Math.abs(row.totalAmount)
      objRedInvReqBill.TaxRate = ''
      objRedInvReqBill.Tax = -Math.abs(row.totalTaxes)
      objRedInvReqBill.ReqMemo = ''
      objRedInvReqBill.SPBMBBH = ''
      objRedInvReqBill.SLBZ = row.rateSign
      // 商品信息 待添加
      for (let i = 0; i < data.COMMON_FPKJ_XMXXS.COMMON_FPKJ_XMXX.length; i++) {
        const item = data.COMMON_FPKJ_XMXXS.COMMON_FPKJ_XMXX[i]
        let objGoodsMx = INVOICE_RED_TABLE_XML.createObjGoodsMx()
        objGoodsMx.GoodsName = item.XMMC
        objGoodsMx.GoodsUnit = item.DW
        objGoodsMx.GoodsPrice = item.XMDJ === null || item.XMDJ === '' ? '' : item.XMDJ
        objGoodsMx.GoodsNum = item.XMSL === null || item.XMSL === '' ? '' : -item.XMSL
        objGoodsMx.GoodsTaxRate = item.SL
        objGoodsMx.GoodsGgxh = item.GGXH
        objGoodsMx.GoodsJE = -item.XMJE
        objGoodsMx.GoodsSE = -item.SE
        objGoodsMx.HS_BZ = 'N'
        objGoodsMx.SPBM = item.SPBM
        objGoodsMx.QYSPBM = ''
        objGoodsMx.SYYHZCBZ = item.YHZCBS
        objGoodsMx.YHZC = item.ZZSTSGL
        objGoodsMx.LSLBZ = item.LSLBS === null || item.LSLBS === '' ? '' : item.LSLBS
        objRedInvReqBill.RedInvReqBillMx[i] = objGoodsMx
      }

      let xmlFileText = INVOICE_RED_TABLE_XML.createXMLFileText(
          objRedInvReqBill
      )
      try {
        var blob = new Blob([xmlFileText], {
          type: 'text/xml;',
        })
        FileSaver.saveAs(blob, '红字信息表.xml')
      } catch (e) {
        if (typeof console !== 'undefined') {
          console.log(e, blob)
        }
      }
    },
    // 读取数据
    async getRedLetterData(row) {
      if (this.token) {
        const url = '/sys/invoice/redInfo/findApplyDetail'
        let response = await AxiosRequestData(
            url,
            this.token,
            {
              requestId: row.requestId
            },
            false,
            2
        )
        if (response) {
          if (response.code === 0) {
            console.log(response)
            // this.buyerName = response.data.REQUEST_COMMON_HZSQ.SPF_MC
            // this.buyerTaxNumber = response.data.REQUEST_COMMON_HZSQ.SPF_NSRSBH
            // this.sellerName = response.data.REQUEST_COMMON_HZSQ.KPF_MC
            // this.sellerTaxNumber = response.data.REQUEST_COMMON_HZSQ.KPF_NSRSBH
            // this.invoiceCode = response.data.REQUEST_COMMON_HZSQ.FPDM
            // this.invoiceNumber = response.data.REQUEST_COMMON_HZSQ.FPHM
            // if (response.data.REQUEST_COMMON_HZSQ.SQLX === 1) {
            //   this.sellerType = '购买方申请'
            //   this.status = 1
            // } else {
            //   this.sellerType = '销售方申请'
            //   this.status = 2
            // }
            // if (response.data.REQUEST_COMMON_HZSQ.DKBZ) {
            //   this.deduction = true
            //   this.deductionFont = '已抵扣'
            // } else {
            //   this.deduction = false
            //   this.deductionFont = '未抵扣'
            // }
            // this.invoiceType = response.data.REQUEST_COMMON_HZSQ.FPZL
            // if (this.invoiceType === 1) {
            //   this.invoiceTypeName = '增值税普通电子发票'
            // }
            // if (this.invoiceType === 2) {
            //   this.invoiceTypeName = '增值税电子专用发票'
            // }
            // if (this.invoiceType === 3) {
            //   this.invoiceTypeName = '增值税普通纸质发票'
            // }
            // if (this.invoiceType === 4) {
            //   this.invoiceTypeName = '增值税专用纸质发票'
            // }
            // this.contactNumber = response.data.REQUEST_COMMON_HZSQ.LXDH
            // this.explain = response.data.REQUEST_COMMON_HZSQ.SQLY
            // let products = await RedLetterInfoProduct(response.data.REQUEST_COMMON_HZSQ
            //     .COMMON_FPKJ_XMXXS.COMMON_FPKJ_XMXX, this.entTaxId, this.token)
            // this.calculationTotalAmount(products)
            // this.productData.product = products
            this.handleExport(response.data.REQUEST_COMMON_HZSQ, row)
          }
        }
      }
    },
    // 状态刷新
    async statusRefresh(row) {
      if (this.token) {
        const url = '/sys/invoice/redInfo/getApplyStatus'
        let response = await AxiosRequestData(
            url,
            this.token,
            {
              requestId: row.requestId
            },
            false,
            2
        )
        if (response) {
          if (response.code === 0) {
            row.applyNo = response.data.redInfoApplyNo
            row.invoiceCode = response.data.invoiceCode
            row.invoiceNumber = response.data.invoiceNo
            row.redInfoNo = response.data.redInfoNo
            row.applyStatus = response.data.status
          } else {
            this.$message.error(response.msg)
          }
        }
      }
    },
    // 红字信息表撤销
    async redLetterRevoke(row) {
      if (this.token) {
        const url = '/sys/invoice/redInfo/revoke'
        let response = await AxiosRequestData(
            url,
            this.token,
            {
              requestId: row.requestId,
              reqChannel: 4
            },
            false,
            1
        )
        if (response) {
          if (response.code === 0) {
            this.$message({
              message: response.msg,
              type: 'success'
            })
          } else {
            this.$message.error(response.msg)
          }
        }
      }
    },
    // 红字信息表删除
    async redLetterDelete(row) {
      if (this.token) {
        const url = '/sys/invoice/redInfo/delete'
        let response = await AxiosRequestData(
            url,
            this.token,
            {
              mobile: this.account,
              delList: [row.infoId],
              reqChannel: 4
            },
            false,
            1
        )
        if (response) {
          if (response.code === 0) {
            this.$message({
              message: '删除成功！',
              type: 'success'
            })
            this.getRedLetterList()
          } else {
            this.$message.error(response.msg)
          }
        }
      }
    }
  }
}
</script>

<style scoped>
.search {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
}

.search_input {
  width: 250px;
  margin: 5px;
}
</style>
