import axios from 'axios'; import { CommonProvinceRes, CommonCityRes, CommonDistrictRes, AllProjectIdNameListRes, AllBuildingIdNameListRes, AllFloorIdNameListRes, AllInvoiceTypeIdNameListRes, AllFilingTypeIdNameListRes, UploadParam, BankListRes, } from '@/types/comm'; import { HttpResponse } from './interceptor'; export interface ProjectRecord { id: string; name: string; type: string; } // 省份列表 export function getProvinceList(): Promise { return axios.get(`common/getProvinceList`); } // 城市列表 export function getCityListByProvinceId(id: number): Promise { return axios.get(`common/getCityList?province_id=${id}`); } // 区域列表 export function getDistrictListByCityId( id: number ): Promise { return axios.get(`common/getDistrictList?city_id=${id}`); } // 全部项目(id,名称)列表 export function getAllProjectIdNameList(): Promise { return axios.get(`common/getAllProjectList`); } // 全部楼栋(id,名称)列表(根据项目id查询) export function getAllBuildingIdNameList( id: number ): Promise { return axios.get(`common/getAllBuildingList?project_id=${id}`); } // 全部楼层(id,名称)列表(根据楼栋id查询) export function getAllFloorIdNameList( id: number ): Promise { return axios.get(`common/getAllFloorList?building_id=${id}`); } // 发票类型列表 export function getInvoiceTypeList(): Promise { return axios.get(`common/getInvoiceTypeList`); } // 租客归档类型列表 export function getFilingTypeList(): Promise { return axios.get(`common/getFilingTypeList`); } // 上传文档 export function ossUpload( params: UploadParam | FormData ): Promise { return axios.post('common/ossUpload', params); } // 下载文档 export function ossDownload(key: string): Promise { return axios.get(`common/ossDownload?key=${key}`); } // 银行列表 export function getBanksList(keyword: string): Promise { return axios.post('common/getBanksList', { keyword }); } // 获取勾选部门的项目列表 export function getDeptProjectListFromDeptId(id: number): Promise { return axios.get(`common/getDeptProjectList?departmentId=${id}`); } // 审批流类型列表 export function getWorkflowsTypeList(): Promise { return axios.get(`common/getWorkflowsTypeList`); } // 公共接口-用户列表 export function getCommonUserList(): Promise { return axios.get(`common/getUserList`); }