

export default {
  components: {
    mainTable: require('../mainTable/index.mainTable.vue').default,
    searchBar: require(/* webpackChunkName: "[request]" */ '../searchBar/index.searchBar.vue').default,
    feeTable: require(/* webpackChunkName: "[request]" */ '../childrenTable/feeTable.vue').default,
    logTable: require(/* webpackChunkName: "[request]" */ '../childrenTable/logTable.vue').default,

  },
  data() {
    return {
      mainId: '',
      childrenId:'',
      mainCurrent: null,
      mainsSelectedRowKeys: [],
      tableExtendedField: [],
    }
  },

  methods: {
    $searchSubmit(data) {
      this.$refs.mainTable.reload({ data })
    },
    clearChildrenTableAll(isClearCurrent = false) {
      if (isClearCurrent) {
        this.mainCurrent = null
        this.mainId = ''
      }
      const { childrenTable_0, childrenTable_1 } = this.$refs
      if (childrenTable_0) {
        childrenTable_0.dataSource = []
      }
      if (childrenTable_1) {
        childrenTable_1.dataSource = []
      }
    },
    onBack(formName, id, isReload) {
      this.detailsState = 0
      this.currentMainData = null

      if (isReload) {

        this.clearChildrenTableAll()
        this.$refs[formName + 'Table'].reload().then(() => {
          if (id) {
            if (formName == 'min') {
              this.mainId = id
            } else {
              this.childrenId = id
            }
          }
        })
      }
    },
    $handleView(data) {
      this.detailsState = 1;
      this.mainCurrent = { ...data };
    },
    handPrint(url) {
      console.log(url)
    },
    viewRemoteBefore(vnode, config) {
      config.data.shipbillIds = [config.data.shipbillId]
      delete config.data.shipbillId
    },
  },
}
