<!-- BPO订单分配 -->
<template>
  <div>
    <up-down-layout :header="$t('bpoTask.orderAllocation')" :headerVisible="false" :handleFlag.sync="handleFlag">
      <search-form @clearParam="clearParam" @handleFilter="handleFilter" :formValue.sync="queryParas"
                   :componentList="searchList" slot="query"
                   :menuCode="menuId" searchPerms="search" resetPerms="reset"></search-form>
      <template slot="table">
        <data-table v-show="queryParas.operationType === '1'" :handleFlag.sync="handleFlag" :showPage="true" :menuFlag="true"
                    :queryParas="queryParas" :sourceData.sync="sourceData" :selectedRows.sync="pushData" :showSelection="true"
                    v-bind="elHeightObj" :tableId="tableId" :api="api" ref="pushTable" :row-style="setRowStyle" :selectTable="selectPushTable"
                    :loadCount.sync="loadCount" :operateBtnLayout="operateBtnLayout" :columns="pushCol" :headTitle="$t('bpoTask.bpoTaskTitle')">
          <template slot="headButton">
            <div class="headButton">
              <!--<auth-button :type="'primary'" :size="'medium'" :label="$t('common.export')" @click="exportFile"></auth-button>-->
              <Json-Excel :fetch="downloadFile" :name="fileName" class="excel">
                <el-button type="primary"  size="medium" icon="iconfont icondaochu">
                  {{$t('common.export')}}
                </el-button>
              </Json-Excel>
              <auth-button icon="iconfont icontuisong" :type="'primary'" :size="'medium'" :loading="pushLoad" :label="$t('common.push')" @click="pushFile"></auth-button>
            </div>
          </template>
        </data-table>
        <data-table v-show="queryParas.operationType === '2'" :handleFlag.sync="handleFlag" :showPage="true" :showSelection="true" :menuFlag="true"
                    :queryParas="queryParas" :sourceData.sync="sourceData" :selectedRows.sync="backData" :api="api" :selectTable="selectTable"
                    :loadCount.sync="loadCount" :operateBtnLayout="operateBtnLayout" :columns="recallCol" :headTitle="$t('bpoTask.bpoTaskTitle')"
                    v-bind="elHeightObj" :tableId="tableId" ref="recallTable" :row-style="setRowStyle">
          <template slot="headButton">
            <div class="headButton">
              <!--<auth-button :type="'primary'" :size="'medium'" :label="$t('common.export')" @click="exportFile"></auth-button>-->
              <Json-Excel :fetch="downloadFile" :name="fileName" class="excel">
                <el-button type="primary"  size="medium" icon="iconfont icondaochu">
                  {{$t('common.export')}}
                </el-button>
              </Json-Excel>
              <auth-button icon="iconfont icontuihui" :type="'primary'" :size="'medium'" :loading="backLoad" :label="$t('common.recall')" @click="backFile"></auth-button>
            </div>
          </template>
        </data-table>
      </template>
    </up-down-layout>
    <result-edit :visible.sync="showResult" :form="resultForm" editModel="V"></result-edit>
  </div>
</template>
<script>
import BasePage from '@/pages/basePage.js'
import { upDownLayout, searchForm, DataTable, authButton, SelectCoreEnterprise, SelectFinancialInstitutions, SelectDictionary,
  SelectPrimitiveRightsHolder, SelectSupplier, SelectProjectCompanyName } from 'newepoch-components'
import ResultEdit from '@/pages/renwufenpei/resultEdit.vue'
import SelectTaskStatus from '@/components/element/dataAduit/SelectTaskStatus.vue'
import SelectFactoringAmount from '@/components/element/renwufenpei/SelectFactoringAmount.vue'
import bpoTaskDistributionListApi from '@/api/renwufenpei/bpoTaskDistributionListApi.js'
import JsonExcel from 'vue-json-excel'
import * as format from '@/filters/index.js'
import { regExp } from '@/validator/index.js'
import mixin from '@/pages/mixin.js'

const bpoArr = [1, 2, 3, 4, 5, 6, 7]
export default {
  name: 'orderAllocation',
  extends: new BasePage(),
  mixins: [mixin],
  components: {
    upDownLayout,
    searchForm,
    DataTable,
    authButton,
    JsonExcel,
    SelectTaskStatus,
    ResultEdit
  },
  data () {
    return {
      tableId: 'orderAllocation',
      pushLoad: false,
      backLoad: false,
      operateBtnLayout: ' ',
      fileName: '',
      searchParams: [],
      sourceData: [],
      pushData: [],
      backData: [],
      queryParas: {
        operationType: '1'
      },
      componentList: [
        // 操作类型
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.operationType,
          value: 'operationType',
          disabled: false,
          clearable: false,
          componentName: SelectTaskStatus,
          options: [
            {
              id: '1',
              name: 'BPO推送'
            },
            {
              id: '2',
              name: '撤回BPO推送'
            }
          ],
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          prop: 'operationType'
        },
        // 付款确认书编号
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.payCode,
          value: 'assetCode',
          disabled: false,
          componentName: 'el-input',
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          maxlength: '100',
          prop: 'assetCode',
          placeholder: this.$i18n.messages[this.$i18n.locale].common.input
        },
        // 保理金额
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.factoringAmount,
          value: 'factoringMoney',
          disabled: false,
          componentName: SelectFactoringAmount,
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          prop: 'factoringMoney',
          placeholder: this.$i18n.messages[this.$i18n.locale].common.input
        },
        // 供应商名称
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.supplierName,
          value: 'creditorId',
          disabled: false,
          componentName: SelectSupplier,
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          prop: 'creditorId'
        },
        // 项目公司名称
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.projectCompanyName,
          value: 'debtorId',
          disabled: false,
          componentName: SelectProjectCompanyName,
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          prop: 'debtorId'
        },
        // 核心企业
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.coreEnterprise,
          value: 'coreEnterpriseId',
          disabled: false,
          // componentName: 'el-select',
          componentName: SelectCoreEnterprise,
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          prop: 'coreEnterpriseId'
        },
        // 计划管理人/再保理银行
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.planningManagerName,
          value: 'planOrBankId',
          disabled: false,
          // componentName: 'el-select',
          componentName: SelectFinancialInstitutions,
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          prop: 'planOrBankId'
        },
        // 原始权益人
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.primitiveRightsHolder,
          value: 'initialOwnersId',
          disabled: false,
          componentName: SelectPrimitiveRightsHolder,
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          prop: 'initialOwnersId'
        },
        // 期数
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.periods,
          value: 'specialPlanPeriods',
          disabled: false,
          // componentName: 'el-select',
          componentName: 'el-input',
          placeholder: this.$i18n.messages[this.$i18n.locale].common.input,
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          prop: 'specialPlanPeriods'
        },
        // 是否推送BPO
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.ifPush,
          value: 'sendBpoFlag',
          disabled: false,
          componentName: SelectDictionary,
          dictTypeCode: 'ZDC0139',
          store: this.$store,
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          prop: 'sendBpoFlag'
        },
        // BPO状态
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.BPOStatus,
          value: 'bpoStatus',
          disabled: false,
          componentName: SelectDictionary,
          dictTypeCode: 'bpo_status',
          reload: false,
          cols: [8, 8, 8, 8],
          labelWidth: '170px'
        },
        // 是否急单
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.ifEmergency,
          value: 'ifsUrgent',
          disabled: false,
          componentName: SelectDictionary,
          reload: false,
          dictTypeCode: 'ZDC0139',
          cols: [8, 8, 8, 8],
          labelWidth: '170px'
        }
      ],
      recallSearchList: [
        // 操作类型
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.operationType,
          value: 'operationType',
          disabled: false,
          clearable: false,
          componentName: SelectTaskStatus,
          options: [
            {
              id: '1',
              name: 'BPO推送'
            },
            {
              id: '2',
              name: '撤回BPO推送'
            }
          ],
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          prop: 'operationType'
        },
        // 付款确认书编号
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.payCode,
          value: 'assetCode',
          disabled: false,
          componentName: 'el-input',
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          maxlength: '100',
          prop: 'assetCode',
          placeholder: this.$i18n.messages[this.$i18n.locale].common.input
        },
        // 保理金额
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.factoringAmount,
          value: 'factoringMoney',
          disabled: false,
          componentName: SelectFactoringAmount,
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          prop: 'factoringMoney',
          placeholder: this.$i18n.messages[this.$i18n.locale].common.input
        },
        // 供应商名称
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.supplierName,
          value: 'creditorId',
          disabled: false,
          componentName: SelectSupplier,
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          prop: 'creditorId'
        },
        // 项目公司名称
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.projectCompanyName,
          value: 'debtorId',
          disabled: false,
          componentName: SelectProjectCompanyName,
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          prop: 'debtorId'
        },
        // 核心企业
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.coreEnterprise,
          value: 'coreEnterpriseId',
          disabled: false,
          // componentName: 'el-select',
          componentName: SelectCoreEnterprise,
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          prop: 'coreEnterpriseId'
        },
        // 计划管理人/再保理银行
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.planningManagerName,
          value: 'planOrBankId',
          disabled: false,
          // componentName: 'el-select',
          componentName: SelectFinancialInstitutions,
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          prop: 'planOrBankId'
        },
        // 原始权益人
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.primitiveRightsHolder,
          value: 'initialOwnersId',
          disabled: false,
          componentName: SelectPrimitiveRightsHolder,
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          prop: 'initialOwnersId'
        },
        // 期数
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.periods,
          value: 'specialPlanPeriods',
          disabled: false,
          // componentName: 'el-select',
          componentName: 'el-input',
          placeholder: this.$i18n.messages[this.$i18n.locale].common.input,
          cols: [8, 8, 8, 8],
          labelWidth: '170px',
          prop: 'specialPlanPeriods'
        },
        // 是否急单
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.ifEmergency,
          value: 'ifsUrgent',
          disabled: false,
          componentName: SelectDictionary,
          dictTypeCode: 'ZDC0139',
          cols: [8, 8, 8, 8],
          labelWidth: '170px'
        },
        // BPO状态
        {
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.BPOStatus,
          value: 'bpoStatus',
          disabled: false,
          componentName: SelectDictionary,
          dictTypeCode: 'bpo_status',
          reload: false,
          cols: [8, 8, 8, 8],
          labelWidth: '170px'
        }
      ],
      pushCol: [
        // 付款确认书编号
        {
          prop: 'assetCode',
          align: 'left',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.payCode,
          width: '140px'
        },
        // 核心企业
        {
          prop: 'coreEnterpriseName',
          align: 'left',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.coreEnterprise,
          width: '120px'
        },
        // 供应商名称
        {
          prop: 'creditor',
          align: 'left',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.supplierName,
          width: '120px'
        },
        // 计划管理人/再保理银行
        {
          prop: 'planOrBankName',
          align: 'left',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.planningManagerName,
          width: '200px'
        },
        // 原始权益人
        {
          prop: 'initialOwnersName',
          align: 'left',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.primitiveRightsHolder,
          width: '100px'
        },
        // 应收账款金额
        {
          prop: 'factoringMoney',
          align: 'right',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.accountsReceivable,
          width: '120px',
          format: (row) => { return format.toThousandFilter(row.factoringMoney) }
        },
        // 项目公司名称
        {
          prop: 'debtor',
          align: 'left',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.projectCompanyName,
          width: '120px'
        },
        // 期数
        {
          prop: 'specialPlanPeriods',
          align: 'right',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.periods,
          width: '100px'
        },
        // 是否推送BPO
        {
          prop: 'sendBpoFlag',
          align: 'center',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.ifPush,
          width: '120px',
          format: (row) => { return format.formatDict(row.sendBpoFlag, 'ZDC0139') }
        },
        // BPO状态
        {
          prop: 'bpoStatus',
          align: 'center',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.BPOStatus,
          width: '100px',
          format: (row) => { return format.formatDict(row.bpoStatus, 'bpo_status') }
        },
        // 是否急单
        {
          prop: 'ifsUrgent',
          align: 'center',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.ifEmergency,
          format: (row) => { return format.formatDict(row.ifsUrgent, 'ZDC0139') }
        }
      ],
      recallCol: [
        // 付款确认书编号
        {
          prop: 'assetCode',
          align: 'left',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.payCode,
          width: '140px'
        },
        // 核心企业
        {
          prop: 'coreEnterpriseName',
          align: 'left',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.coreEnterprise,
          width: '100px'
        },
        // 供应商名称
        {
          prop: 'creditor',
          align: 'left',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.supplierName,
          width: '100px'
        },
        // 计划管理人/再保理银行
        {
          prop: 'planOrBankName',
          align: 'left',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.planningManagerName,
          width: '200px'
        },
        // 原始权益人
        {
          prop: 'initialOwnersName',
          align: 'left',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.primitiveRightsHolder,
          width: '100px'
        },
        // 应收账款金额
        {
          prop: 'factoringMoney',
          align: 'right',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.accountsReceivable,
          width: '120px',
          format: (row) => { return format.toThousandFilter(row.factoringMoney) }
        },
        // 项目公司名称
        {
          prop: 'debtor',
          align: 'left',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.projectCompanyName,
          width: '120px'
        },
        // 期数
        {
          prop: 'specialPlanPeriods',
          align: 'right',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.periods,
          width: '100px'
        },
        // 是否急单
        {
          prop: 'ifsUrgent',
          align: 'center',
          width: '100px',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.ifEmergency,
          format: (row) => { return format.formatDict(row.ifsUrgent, 'ZDC0139') }
        },
        // BPO状态
        {
          prop: 'bpoStatus',
          align: 'center',
          label: this.$i18n.messages[this.$i18n.locale].bpoTask.BPOStatus,
          width: '100px',
          format: (row) => { return format.formatDict(row.bpoStatus, 'bpo_status') }
        }
      ],
      searchList: [],
      showResult: false,
      resultForm: {}
    }
  },
  computed: {
    api () {
      return bpoTaskDistributionListApi.orderAllocationApi
    }
  },
  methods: {
    handleFilter () {
      if (!this.UtilJs.isEmpty(this.queryParas.specialPlanPeriods)) {
        if (!regExp.sequence.test(this.queryParas.specialPlanPeriods)) {
          this.warning('期数只能是自然数')
          return
        }
      }
      if (!this.UtilJs.isEmpty(this.queryParas.minFactoringMoney)) {
        if (!regExp.sequence.test(this.queryParas.minFactoringMoney)) {
          this.warning('保理金额只能是自然数')
          return
        }
      }
      if (!this.UtilJs.isEmpty(this.queryParas.maxFactoringMoney)) {
        if (!regExp.sequence.test(this.queryParas.maxFactoringMoney)) {
          this.warning('保理金额只能是自然数')
          return
        }
      }
      if (this.queryParas.operationType === '1') {
        this.$refs.pushTable.loadTableData()
      } else {
        this.$refs.recallTable.loadTableData()
      }
    },
    async downloadFile () {
      let newList = []
      let newObj = {}
      let paras = Object.assign({}, this.queryParas)
      paras.pageSize = 1000000
      await bpoTaskDistributionListApi.orderAllocationApi.getPage(paras).then(res => {
        if (res && res.data && res.data.datas) {
          if (res.data.datas.length === 0) {
            newObj = {
              '付款确认书编号': '',
              '核心企业': '',
              '供应商名称': '',
              '计划管理人/再保理银行': '',
              '原始权益人': '',
              '应收账款金额': '',
              '项目公司名称': '',
              '期数': '',
              '是否已分配BPO': '',
              'BPO状态': '',
              '是否急单': ''
            }
            newList.push(newObj)
          } else {
            res.data.datas.forEach(item => {
              newObj = {
                '付款确认书编号': item.assetCode,
                '核心企业': item.coreEnterpriseName,
                '供应商名称': item.creditor,
                '计划管理人/再保理银行': item.planOrBankName,
                '原始权益人': item.initialOwnersName,
                '应收账款金额': item.factoringMoney,
                '项目公司名称': item.debtor,
                '期数': item.specialPlanPeriods,
                '是否已分配BPO': format.formatDict(item.sendBpoFlag, 'ZDC0139'),
                'BPO状态': format.formatDict(item.bpoStatus, 'bpo_status'),
                '是否急单': format.formatDict(item.ifsUrgent, 'ZDC0139')
              }
              newList.push(newObj)
            })
          }
          this.fileName = 'BPO订单分配统计列表' + '-' + format.formatDatetime(new Date())
        } else {
          this.error(this.$i18n.messages[this.$i18n.locale].common.exportFail)
          return []
        }
      })
      return newList
    },
    pushFile () {
      let $this = this
      let assetCodeList = []
      if (this.pushData.length === 0) {
        $this.warning(this.$i18n.messages[this.$i18n.locale].bpoTask.pushSelectMsg)
        return
      }
      this.pushData.forEach(item => {
        if (item.bpoStatus !== '0') {
          assetCodeList.push(item.assetCode)
        }
      })
      if (assetCodeList.length > 0) {
        let msg = '付款确认书编号为：'
        assetCodeList.forEach(it => {
          msg = msg + it + '、'
        })
        msg = msg.substring(0, msg.length - 1)
        msg = msg + ' 的数据已经推送过了，是否继续推送？'
        $this.$confirm(msg, this.$i18n.messages[this.$i18n.locale].common.tip, {
          type: 'warning'
        }).then(() => {
          var newObj = []
          this.pushData.forEach(item => {
            newObj.push({
              assetInfoId: item.assetInfoId,
              assetCode: item.assetCode
            })
          })
          $this.pushLoad = true
          this.api.pushTask(newObj).then(res => {
            if (res && res.data) {
              $this.pushResultMsg(res.data)
            }
          }).finally(() => {
            $this.pushLoad = false
          })
        }).catch(() => {})
      } else {
        $this.$confirm(this.$i18n.messages[this.$i18n.locale].bpoTask.pushConfirmMsg, this.$i18n.messages[this.$i18n.locale].common.tip, {
          type: 'warning'
        }).then(() => {
          var newObj = []
          this.pushData.forEach(item => {
            newObj.push({
              assetInfoId: item.assetInfoId,
              assetCode: item.assetCode
            })
          })
          $this.pushLoad = true
          this.api.pushTask(newObj).then(res => {
            if (res && res.data) {
              $this.pushResultMsg(res.data)
            }
          }).finally(() => {
            $this.pushLoad = false
          })
        }).catch(() => {})
      }
    },
    pushResultMsg (data) {
      if (data.failCount === 0 && data.autoAuditHasClaimCount === 0) {
        this.$message.success(this.$i18n.messages[this.$i18n.locale].bpoTask.pushSuccess)
        this.handleFilter()
      } else {
        this.resultForm = Object.assign({}, data)
        this.showResult = true
      }
    },
    backFile () {
      let $this = this
      if (this.backData.length === 0) {
        $this.warning(this.$i18n.messages[this.$i18n.locale].bpoTask.recallSelectMsg)
        return
      }
      $this.$confirm(this.$i18n.messages[this.$i18n.locale].bpoTask.recallConfirmMsg, this.$i18n.messages[this.$i18n.locale].common.tip, {
        type: 'warning'
      }).then(() => {
        var newObj = []
        this.backData.forEach(item => {
          newObj.push({
            assetInfoId: item.assetInfoId,
            assetCode: item.assetCode
          })
        })
        $this.backLoad = true
        this.api.backTask(newObj).then(res => {
          if (res && res.data) {
            this.backResultMsg(res.data)
          }
        }).finally(() => {
          $this.backLoad = false
        })
      })
    },
    backResultMsg (data) {
      if (data.autoAuditHasClaimCount === 0) {
        this.$message.success(this.$i18n.messages[this.$i18n.locale].bpoTask.recallSuc)
        this.handleFilter()
      } else {
        this.resultForm = {
          recallAutoAuditHasClaimCount: data.autoAuditHasClaimCount,
          recallAutoAuditHasClaimDetailList: data.autoAuditHasClaimDetailList,
          backFlag: true
        }
        this.showResult = true
      }
    },
    selectPushTable (row) {
      return bpoArr.indexOf(+row.bpoStatus) === -1
    },
    selectTable (row) {
      return row.bpoStatus !== '0'
    },
    clearParam () {
      if (this.queryParas.operationType === '1') {
        this.queryParas = {
          pageIndex: 1,
          pageSize: 10,
          operationType: '1'
        }
      } else {
        this.queryParas = {
          pageIndex: 1,
          pageSize: 10,
          operationType: '2'
        }
      }
    },
    setRowStyle (rowData) {
      let ifsUrgent = rowData.row.ifsUrgent
      if (ifsUrgent === '1') {
        return 'color: #eb5648;'
      }
    }
  },
  watch: {
    'queryParas.factoringMoney' (val) {
      if (val && val.length > 0) {
        if (val[0]) {
          this.queryParas.minFactoringMoney = val[0]
        } else {
          this.queryParas.minFactoringMoney = ''
        }
        if (val[1]) {
          this.queryParas.maxFactoringMoney = val[1]
        } else {
          this.queryParas.maxFactoringMoney = ''
        }
      } else {
        this.queryParas.minFactoringMoney = ''
        this.queryParas.maxFactoringMoney = ''
      }
    },
    'queryParas.operationType': {
      handler (now, old) {
        this.queryParas = {
          pageIndex: 1,
          pageSize: 10,
          operationType: now
        }
        if (now === '2') {
          this.searchList = this.recallSearchList
          this.$nextTick(function () {
            this.$set(this.searchList[10], 'reload', !this.searchList[10].reload)
            this.handleFilter()
          })
        } else {
          this.searchList = this.componentList
          this.$nextTick(function () {
            this.$set(this.searchList[10], 'reload', !this.searchList[10].reload)
            if (old !== undefined) {
              this.handleFilter()
            }
          })
        }
      },
      immediate: true
    }
  }
}
</script>
<style scoped lang="scss" src="@/styles/renwufenpei/orderAllocation.scss">
</style>
