import { loadingBillUrl } from '../api.js'
import { loadingBill } from '@/views/BMS/$common/model/searchBar/formConfig.js';


export const setSearchModal = (self) => {
  return {
    modalWidth: 1000,
    modalConfig: {
      mask: false,
    },
    toolBar: {
      labelCol: { span: 8 },
      wrapperCol: { span: 16 },
      items: loadingBill,
    },
    remoteUrl: {
      url: loadingBillUrl,
      method: 'post',
    },
    rowKey: 'id',
    title: '派车单信息',
    remoteBefore(vnode, remoteUrl) {


      remoteUrl.data.excludeFeeIdList=self?.recordList?.map(item => {
        return item.id
      })??[]
      // let expenseNoList = self.dataSource.map(item => item.expenseNo);
      // remoteUrl.data.settlementDepartment = self.record.settlementDepartment;
      // remoteUrl.data.settlementCompany = self.record.settlementCompany;
      // remoteUrl.data.carrierType = self.record.carrierType;
      // remoteUrl.data.affiliationName = self.record.affiliationName;
      // remoteUrl.data.carrierCode = self.record.carrierCode;
      // remoteUrl.data.expenseNos = expenseNoList;

      //config.data.cargoOwnerId = self.cargoOwnerId
    },
    //  selectId:self.disableItemId,
    tableConfig: {


      dragle: true,
      autoColWidth: true,
      scroll: { x: true },
      rowSelectType: 2,
      rowKey: 'id',

      getCheckboxProps(record) {
        let is = self.disableItemId.indexOf(record.id) > -1 ? true : false
        return {
          props: {
            disabled: is,
          },
        }
      },
      columns: [],



    },
  }
}
