import { ResultInfo } from "@/common/methods/request";
import {getAddress} from "@/services/go/adress";

/**
 * 仓库状态名称 - 1:正常 2:注销 3:待审核 4:审核拒绝
 * @param status
 */
export function gerWareHouseStatusName(status: number): string {
    let result = "--";
    switch (status) {
        case 1:
            result = "正常";
            break
        case 2:
            result = "注销";
            break
        case 3:
            result = "待审核";
            break
        case 4:
            result = "审核拒绝";
            break
    }
    return result
}

/**
 * 仓库类型 - 1 厂库 2 自有库 3 合作库
 * @param type
 */
export function getWareHouseTypeName(type: number): string {
    let result = "--";
    switch (type) {
        case 1:
            result = "厂库";
            break
        case 2:
            result = "自有库";
            break
        case 3:
            result = "合作库";
            break
    }
    return result
}

/**
 * 获取地址信息
 */
export function getAddressInfo(provinceId: number, cityId: number, districId: number): string{
   const {getProvinceName, getCityName, getDistrictName} = getAddress();
   return getProvinceName(provinceId) + getCityName(cityId) + getDistrictName(districId);
}


/************** 接口相关提示 **************** /
 *
 */
// 仓库信息请求 操作类型 1 新增 2 修改
export const warehouseApplyRequestResultMsg = new Map<number, ResultInfo>([
    [1, ['新增仓库信息成功', '新增仓库信息失败:']],
    [2, ['修改仓库信息成功', '修改仓库信息失败:']],
])