<template>
  <template-page ref="pageRef" :getList="getList" :exportList="exportList" :columnParsing="columnParsing"
    :tableAttributes="tableAttributes" :tableEvents="tableEvents">
  </template-page>
</template>

<script>
import TemplatePage from '@/components/template/template-page-1.vue'
import import_mixin from '@/components/template/import_mixin.js'
import operation_mixin from '@/components/template/operation_mixin.js'
import { increOrderSettleList2, increOrderSettleListExport2 } from "@/api/orderSettleManag.js"
export default {
  components: {
    TemplatePage,
  },
  mixins: [import_mixin, operation_mixin],
  props: {
    workerId: {
      type: [String, Number],
      default: ""
    },
    detailParams: {
      type: Array,
      default: () => []
    },
  },
  data() {
    return {
      formBool: false,
      // 表格属性
      tableAttributes: {
        // 启用勾选列
        selectColumn: false,
      },
      // 表格事件
      tableEvents: {
        'selection-change': this.selectionChange
      },
    }
  },
  methods: {
    // 列表请求函数
    getList(p, cb) {
      try {
        var pam = JSON.parse(JSON.stringify(p))
        if (this.workerId) {
          pam.params.push({ "param": "worker_id", "compare": "=", "value": this.workerId })
        }
        if (this.detailParams.length) {
          pam.params = [...pam.params.filter(item => item.param !== "a.pay_time"), ...this.detailParams,]
        }
        return increOrderSettleList2(pam)
      } catch (err) {
        console.log(err)
      }
    },

    exportList: increOrderSettleListExport2,

    // 表格列解析渲染数据更改
    columnParsing(item, defaultData) {
      return defaultData
    },

    // 监听勾选变化
    selectionChange(data) {
      this.recordSelected = data
    },

  }
}
</script>

<style lang="scss" scoped>
.neibuview {
  box-sizing: border-box;
  padding-left: 16px;

  ::v-deep &>.zj-page-fill-scroll {
    box-sizing: border-box;
    padding-right: 16px;

    &>div:nth-child(1) {
      margin-top: 20px;
    }
  }
}
</style>
