import http from "@/http/http";
import { ResultInterface } from "../base/BaseDataModel";
import {
  ApiArrearsReminderDto,
  ArrearsReminderParam,
} from "./notificationModel";
import axios from "axios";

enum Api {
  getArrears = "/api/arrears/getArrears",
  downloadArrearsData = "/api/arrears/downloadArrearsData",
}
const VUE_APP_BASE_API = "http://120.24.149.148/api";

/**
 * 欠费提醒查询
 * @param data
 * @returns
 */
export const GetArrears = async (data: Recordable) => {
  return axios({
    url: VUE_APP_BASE_API + "/finance/GetArrears",
    data,
    method: "post",
    timeout: 60 * 1000,
    headers: {
      "Content-Type": "application/json",
      Token: "132A7468DE079C6CEB59F383A661E612",
    },
  })
};
// export const api_GetArrears = async (parms: ArrearsReminderParam) => {
//   return await http.post(Api.getArrears, parms);
// };

/**
 * 欠费提醒下载
 * @param parms
 * @returns
 */
// export const api_downloadArrearsData = async (parms: Recordable) => {
//   return await http.download(Api.downloadArrearsData, parms);
// };

/**
 * 欠费提醒下载
 * @param parms
 * @returns
 */
export const DownloadArrearsData = async (data: Recordable) => {
  return axios({
    method: "post",
    url: VUE_APP_BASE_API + "/finance/DownloadArrearsData",
    data,
    responseType: "blob",
    headers: {
      "Content-Type": "application/json",
      Token: "132A7468DE079C6CEB59F383A661E612",
    },
  });
};

export const GetTransferWarehouseLogs = async (data: Recordable) => {
  return axios({
    url: VUE_APP_BASE_API + "/finance/GetTransferWarehouseLogs",
    data,
    method: "post",
    timeout: 60 * 1000,
    headers: {
      "Content-Type": "application/json",
      Token: "132A7468DE079C6CEB59F383A661E612",
    },
  })
};

/**
 * 欠费提醒
 */

export function SendArrearsFile(data){
    return axios({
      url: VUE_APP_BASE_API + '/finance/SendArrearsFile',
      method: 'post',
      timeout: 60 * 1000,
      data,
      headers: {
        "Content-Type": "application/json",
        Token: "132A7468DE079C6CEB59F383A661E612",
      },
    })
  }
  
export const GetReComputeVerType = async () => {
  return axios({
    url: VUE_APP_BASE_API + "/BaseInfo/GetReComputeVerType",
    method: "get",
    timeout: 60 * 1000,
    headers: {
      "Content-Type": "application/json",
      Token: "132A7468DE079C6CEB59F383A661E612",
    },
  })
};

export const GetReCustomerComputeType = async () => {
  return axios({
    url: VUE_APP_BASE_API + "/BaseInfo/GetReCustomerComputeType",
    method: "get",
    timeout: 60 * 1000,
    headers: {
      "Content-Type": "application/json",
      Token: "132A7468DE079C6CEB59F383A661E612",
    },
  })
};

export function GetReCustomerComputeNew(data) {
  return axios({
    url: VUE_APP_BASE_API + '/Finance/ReCustomerComputeNew?systemno='+data.systemNo+'&reCustomerCompute='+data.reCustomerComputeType+'&reComputeVerType='+data.reComputeVerType,
    data,
    method: "get",
    timeout: 60 * 1000,
    headers: {
      "Content-Type": "application/json",
      Token: "132A7468DE079C6CEB59F383A661E612",
    },
  })
}


/**
 * 导入结算
 */
export function GetArtificialSaveBranchCompanyFee(data) {
  return axios({
    url: VUE_APP_BASE_API + "/finance/GetArtificialSaveBranchCompanyFee",
    data,
    method: "post",
    timeout: 60 * 1000,
    headers: {
      "Content-Type": "multipart/form-data;charset=UTF-8",
      Token: "132A7468DE079C6CEB59F383A661E612",
    },
  })
}

/**
 * 保存结算入账的数据
 * @param {*} data
 * @returns
 */
export function GetAsyncArtificialSaveBranchCompanyFee(data) {
  return axios({
    url: VUE_APP_BASE_API + "/finance/AsyncArtificialSaveBranchCompanyFee",
    data,
    method: "post",
    timeout: 60 * 1000,
    headers: {
      "Content-Type": "application/json",
      Token: "132A7468DE079C6CEB59F383A661E612",
    },
  })
}
