import fetch from './fetch'

export default {
    // 公共接口
    common: {
        login(params) {
            return fetch('/basic-info/v1/basic-info/basic-sys-user/login',
                params,
                'post',
                'json',
            )
        },
        fetchMedicalType(params) {//获取分类
            return fetch('/basic-info/v1/basic-info/basic-medical-breed/all', params)
        },
        fetchAllMedicalName(params) {//获取所有品种名称(单位端)
            return fetch('/basic-info/v1/basic-info/basic-medical-info/all', params)
        },
        fetchUnitInfo(params) {//获取单位（父级）
            return fetch(`/basic-info/v1/basic-info/basic-org-info/all-child/${params.id}`, params)
        },
        //供应商管理
        fetchAllSupply(params) {//获取所有供应商
            return fetch('/v1/folacin-admin/folacin-supplier-info/enable', params)
        },
        fetchAddSupply(params) {//新增供应商
            return fetch('/v1/folacin-admin/folacin-supplier-info', params, "post", "json")
        },
        fetchSupplyPageList(params) {//供应商分页查询
            return fetch('/v1/folacin-admin/folacin-supplier-info', params, "get")
        },
        fetchSupplyById(id) {//根据id获取
            return fetch(`/v1/folacin-admin/folacin-supplier-info/${id}`)
        },
        fetchSupplUpdate(params) {//供应商分页查询
            return fetch(`/v1/folacin-admin/folacin-supplier-info/${params.id}`, params, "put", 'json')
        },
        fetchSupplDelete(id) {//供应商分页查询
            return fetch(`/v1/folacin-admin/folacin-supplier-info/${id}`, {}, "delete")
        },
        fetchAllEnum(params) {//获取所有枚举值
            return fetch(`/basic-info/v1/basic-info/basic-sys-enum/all-enum`, params)
        },
        fetchAreaByCode(areaCode) {//根据区域编码获取下级地区
            return fetch(`/v1/folacin-admin/sys-dict-area/child-area/${areaCode}`)
        },
        //知情同意书
        fetchConsentInfo() {//查询单位的知情同意书
            return fetch(`/v1/folacin-admin/folacin-consent-info/consent`)
        },
        fetchAddConsentInfo(params) {//新增单位的知情同意书
            return fetch(`/v1/folacin-admin/folacin-consent-info`, params, "post", "json")
        },
        fetchUpdateConsentInfo(params) {//更新单位的知情同意书
            console.log(params)
            return fetch(`/v1/folacin-admin/folacin-consent-info/${params.id}`, params, "put", "json")
        }
    },
    //首页接口
    homeManage: {
        fetchPayAmount(params) { //获取发放量
            return fetch(`/stock-info/v1/stock-info/home/get-provide`, params)
        },
        fetchPayAmountMonth(params) {//每个月的发放量统计
            return fetch(`/stock-info/v1/stock-info/home/get-total-provide`, params)
        },
        fetchPayAmountYear(params) {//一年内药具发放量占比
            return fetch(`/stock-info/v1/stock-info/home/get-provide-proportion`, params);
        },
        fetchRemindWarn(params) {//首页消息提醒
            return fetch(`/stock-info/v1/stock-info/home/get-remind-and-waring`, params);
        },
        updatePwd(params) {//更新密码
            return fetch(`/basic-info/v1/basic-info/basic-sys-user/update-password`, params, 'post', 'json')
        },
        fetchVisitStatistic(params) {//回访统计接口
            return fetch(`/stock-info/v1/stock-info/home/get-visit-statistic`, params);
        },
        fetchDataQuality(params) {//数据质量控制、提醒以及预警接口
            return fetch(`/stock-info/v1/stock-info/home/get-data-quality`, params);
        },

    },
    //单位管理端-基础信息管理
    baseInfo: {
        /*药具基本信息管理*/
        fetchCondomInfoList(params) { // 药具信息管理列表
            return fetch('/basic-info/v1/basic-info/basic-medical-info', params)
        },
        fetchCondomInfoDetail(params) {//获取药具信息单条详情
            return fetch(`/basic-info/v1/basic-info/basic-medical-info/${params.id}`, params)
        },
        addCondomInfo(params) { //新增药具信息
            return fetch('/basic-info/v1/basic-info/basic-medical-info', params, 'post', 'json')
        },
        updateCondomInfo(params) { //修改药具信息
            return fetch(`/basic-info/v1/basic-info/basic-medical-info/${params.id}`, params, 'put', 'json')
        },
        /*药具品类信息管理*/
        fetchMedicalTypeInfoList(params) {//分类列表
            return fetch('/basic-info/v1/basic-info/basic-medical-breed', params)
        },
        fetchMedicalTypeDetail(params) {//获取分类单条详情
            return fetch(`/basic-info/v1/basic-info/basic-medical-breed/${params.id}`, params)
        },
        addMedicalType(params) {//新增分类
            return fetch('/basic-info/v1/basic-info/basic-medical-breed', params, 'post', 'json')
        },
        updateMedicalType(params) {//修改分类
            return fetch(`/basic-info/v1/basic-info/basic-medical-breed/${params.id}`, params, 'put', 'json')
        },
        /*供应商管理*/
        fetchSupplyInfoList(params) { // 供应商信息列表
            return fetch('/basic-info/v1/basic-info/basic-supply-info', params)
        },
        fetchSupplyInfoDetail(params) {//查看供应商详情
            return fetch(`/basic-info/v1/basic-info/basic-supply-info/${params.id}`, params)
        },
        addSupplyInfo(params) { //新增供应商
            return fetch('/basic-info/v1/basic-info/basic-supply-info', params, 'post', 'json')
        },
        updateSupplyInfo(params) { //修改供应商
            return fetch(`/basic-info/v1/basic-info/basic-supply-info/${params.id}`, params, 'put', 'json')
        },
        //合同管理（供应商端管理）
        fetchContractInfoList(params) {// 合同管理列表供应商端管理
            return fetch('/basic-info/v1/basic-contract-info', params)
        },
        fetchContractInfoDetail(params) {//合同主键查询（供应商端）
            return fetch(`/basic-info/v1/basic-contract-info/${params.id}`, params)
        },
        addContractInfo(params) { //新增合同（供应商端）
            return fetch('/basic-info/v1/basic-contract-info', params, 'post', 'json')
        },
        updateContractInfo(params) { //修改合同（供应商端）
            return fetch(`/basic-info/v1/basic-contract-info/${params.id}`, params, 'put', 'json')
        },
        // 生产批次管理
        fetchBatchInfoDetail(params) {//查看生产批次详情
            return fetch(`/basic-info/v1/basic-info/basic-medical-info/${params.id}`, params)
        },
        /*生产厂家基本信息管理*/
        fetchFactoryInfoList(params) { // 生产厂家信息管理列表
            return fetch('/basic-info/v1/basic-info/basic-factory-info', params)
        },
        fetchFactoryInfoDetail(params) {//获取生产厂家信息单条详情
            return fetch(`/basic-info/v1/basic-info/basic-factory-info/${params.id}`, params)
        },
        addFactoryInfo(params) { //新增生产厂家信息
            return fetch('/basic-info/v1/basic-info/basic-factory-info', params, 'post', 'json')
        },
        updateFactoryInfo(params) { //修改生产厂家信息
            return fetch(`/basic-info/v1/basic-info/basic-factory-info/${params.id}`, params, 'put', 'json')
        },
        delFactoryInfo(params) { //删除生产厂家信息
            return fetch(`/basic-info/v1/basic-info/basic-factory-info/${params.id}`, params, 'delete', 'json')
        },
    },
    //单位管理端-库存管理
    stockManage: {
        /*在库管理*/
        fetchInStockList(params) {//在库管理列表
            return fetch('/v1/folacin-admin/folacin-stock-record', params)
        },
        fetchInStockDetail(params) {//在库管理详情
            return fetch(`/v1/folacin-admin/folacin-stock-record/${params.id}`, params)
        },
        fetchMedicineByType(params) {//根据药具品类获取药具
            return fetch('/basic-info/v1/basic-info/basic-medical-info/query-breed', params)
        },
        fetchFactoryByTypeName(params) {//根据分类和名称获取生产厂家
            return fetch('/basic-info/v1/basic-info/basic-medical-info/query-factory', params)
        },
        fetchBatchByTypeAName(params) {//根据分类和品种名称获取生产批次
            return fetch('/basic-info/v1/basic-info/basic-batch-info/breed-medical', params)
        },
        addHistoryStock(params) {//在库管理-历史库存录入
            return fetch('/v1/folacin-admin/folacin-purchase-record', params, 'post', 'json')
        },
        fetchMedicalListByIds(params) {
            return fetch(`/v1/folacin-admin/folacin-stock-record/query-ids`, params)
        },

        /*入库管理*/
        fetchStockList(params) {//入库管理列表
            return fetch('/stock-info/v1/stock-info/stock-send-record/receive-order', params);
        },
        fetchTemplateByMedicalType(params) {//根据分类获取药具检查验收模板
            return fetch(`/basic-info/v1/basic-info/basic-template/query-breed/${params.breedId}`, params)
        },
        fetchStockDetail(params) {//查看入库详情
            return fetch(`/stock-info/v1/stock-info/stock-send-record/${params.id}`, params)
        },
        fetchConfimAddStock(params) {//入库管理-确认入库
            return fetch('/stock-info/v1/stock-info/stock-send-record/receive-goods', params, 'post', 'json');
        },
        /*物资分配*/
        fetchGoodsDistribution(params) {// 物资分配列表
            return fetch('/stock-info/v1/stock-info/stock-send-record', params);
        },
        fetchDispatchGoods(params) {//分配物资
            return fetch('/v1/folacin-admin/folacin-send-record', params, 'post', 'json');
        },
        fetchDispatchdeGoods(params) {//获取在库信息
            return fetch('/stock-info/v1/stock-info/stock-basic-info/basic-info', params);
        },
        fetchDisGoodsDetail(params) {//查看物资分配详情
            return fetch(`/stock-info/v1/stock-info/stock-send-record/${params.id}`, params);
        },
        fetchSendGoodsDetail(params) {//查看物资分配详情
            return fetch(`/stock-info/v1/stock-info/stock-send-record/send-detail/${params.id}`, params);
        },
        fetchInOrOutRecordList(params) {//出入库记录
            return fetch('/stock-info/v1/stock-info/stock-transfer-record', params)
        },
        fetchInOrOutRecordDetail(params) {//出入库记录详情
            return fetch(`/stock-info/v1/stock-info/stock-transfer-record/${params.id}`, params)
        },
        delInOrOutRecordRed(params) {//出入库记录红冲
            return fetch(`/stock-info/v1/stock-info/stock-transfer-record/red-operation/${params.id}`, params, 'put', 'json')
        },
        /*人工发放*/
        fetchManualDistributionist(params) {//人工发放记录列表
            return fetch('/stock-info/v1/stock-info/stock-provide-record', params);
        },
        fetchManualDistributionistDetail(params) {//人工发放详情
            return fetch(`/stock-info/v1/stock-info/stock-provide-record/${params.id}`, params);
        },
        addManualDistribution(params) {//新增人工发放
            return fetch('/stock-info/v1/stock-info/stock-provide-record', params, 'post', 'json');
        },
        //期初库存
        fetchBeginStock(params) {//期初库存列表
            return fetch('/stock-info/v1/stock-info/stock-opening-inventory', params);
        },
        //通过药具id和批次id判断是否有出入库记录（true:有）
        judgeInAndOutRecord(params) {
            return fetch(`/stock-info/v1/stock-info/stock-opening-inventory/check-transfer/${params.medicalId}/${params.batchId}`)
        },
        addBeginStock(params) {//新增期初库存
            return fetch('/stock-info/v1/stock-info/stock-opening-inventory/submit-data', params, 'post', 'json')
        },
        fetchBeginStockDetail(params) {//期初库存详情
            return fetch(`/stock-info/v1/stock-info/stock-opening-inventory/${params.id}`, params);
        },
        deleteBeginStock(params) {//期初库存删除
            return fetch(`/stock-info/v1/stock-info/stock-opening-inventory/${params.id}`, params, 'delete', 'json')
        },
        /*仓库盘点登记*/
        fetchStockInventoryList(params) {//仓库盘点列表
            return fetch('/stock-info/v1/stock-info/stock-inventory', params)
        },
        fetchStockInventoryDetail(params) {//仓库盘点详情
            return fetch(`/stock-info/v1/stock-info/stock-inventory/${params.id}`, params);
        },
        fetchNowStock(params) {//查询当前单位下属药具库存
            return fetch(`/stock-info/v1/stock-info/stock-inventory/query-stock-info`, params);
        },
        addStockInventory(params) {//新增仓库盘点登记
            return fetch('/stock-info/v1/stock-info/stock-inventory', params, 'post', 'json');
        },
    },
    //单位管理端-物资调拨管理
    allocationManagement: {
        /*调拨申请*/
        fetchAllotApplyList(params) {//调拨申请列表
            return fetch('/stock-info/v1/stock-info/stock-apply-record', params)
        },
        addAllotApply(params) { //新增调拨申请
            return fetch('/stock-info/v1/stock-info/stock-apply-record', params, 'post', 'json')
        },
        fetchIdApplyInfo(params) { //查询调拨申请
            return fetch(`/stock-info/v1/stock-info/stock-apply-record/${params.id}`, params)
        },
        updateAllotApply(params) { //修改调拨申请
            return fetch(`/stock-info/v1/stock-info/stock-apply-record/${params.id}`, params, 'put', 'json')
        },

        /*调拨审核 */
        fetchAllotCheckList(params) {//调拨审核列表
            return fetch('/stock-info/v1/stock-info/stock-apply-audit', params)
        },
        fetchApplyAudit(params) {// 审核
            return fetch('/stock-info/v1/stock-info/stock-apply-audit/add-examine', params, 'post', 'json');
        },
        fetchIdApplyAudit(params) {
            return fetch(`/stock-info/v1/stock-info/stock-apply-audit/${params.id}`, params);
        },
        fetchStockInfo(params) {
            return fetch(`/stock-info/v1/stock-info/stock-basic-info/unit-stock/${params.unitId}/${params.medicalIds}`);
        },
        fetchStockValidityWarn(params) {
            return fetch(`stock-info/v1/stock-info/stock-basic-info/stock-validity-warn`, params, "get");
        },
        // 调拨出库
        fetchAllotOutboundList(params) {//调拨出库列表
            return fetch('/stock-info/v1/stock-info/stock-apply-record/allocation', params);
        },
        fetchAllotOutbound(params) {//调拨出库
            return fetch('/stock-info/v1/stock-info/stock-send-record', params, 'post', 'json');
        }
    },
    //单位管理端-网点管理
    networkManage: {
        fetchNetworkList(params) {//列表
            return fetch('/basic-info/v1/basic-info/basic-network-info', params)
        },
        fetchAddNetwork(params) {//新增网点
            return fetch('/basic-info/v1/basic-info/basic-network-info', params, 'post', 'json')
        },
        fetchUpdateNetwork(params) {//停用网点
            return fetch(`/basic-info/v1/basic-info/basic-network-info/${params.id}`, params, 'put', 'json')
        },
        fetchNetworkDetail(params) {// 查看详情
            return fetch(`/basic-info/v1/basic-info/basic-network-info/${params.id}`, params)
        },
        fetchDownQRcode(params) {//下载二维码
            return fetch(`/v1/basic-info/basic-network-info/net-qrcode/${params.unitId}`, params)
        },
        fetchNetworkAuditList(params) {//网点审核列表
            return fetch('/basic-info/v1/basic-info/basic-network-info/get-network-info-audit-page', params)
        },
        fetchNetworkBatchAudit(params) {//网点批量审核通过
            return fetch(`/basic-info/v1/basic-info/basic-network-info/network-info-batch-audit`, params)
        },
        fetchNetworkListByAreaCode(params) {// 获取所属地区下辖可用网点
            return fetch(`/basic-info/v1/basic-info/basic-network-info/query-by-area-code`, params)
        },
        fetchNetworkStockInfoList(params) {//网点库存列表
            return fetch('/basic-info/v1/basic-info/basic-network-info/query-network-stock-page', params)
        },
        fetchNetworkStockDetail(params) {// 网点库存查看详情入库分页
            return fetch(`/stock-info/v1/stock-info/stock-transfer-record/get-network-change-list`, params)
        },
        fetchNetworkOutRecord(params) {// 网点库存查看详情手工调整分页
            return fetch(`/stock-info/v1/stock-info/stock-network-change-record`, params)
        },
        //网点调整库存
        fetchAdjustStockInfoList(params) {//网点调整库存列表
            return fetch('/basic-info/v1/basic-info/basic-network-info/get-network-change-list', params)
        },
        fetchAdjustStockInfoBatch(params) {//网点调整库存批量
            return fetch('/stock-info/v1/stock-info/stock-basic-info/network-batch-change', params, 'post', 'json')
        },
        fetchAdjustStockUpDown(params) {//网点调整库存上架下架
            return fetch('/stock-info/v1/stock-info/stock-basic-info/network-stock-load-unload', params)
        }


    },
    //单位管理端-预警管理
    warningManage: {
        fetchValidityWarnList(params) {//有效期预警列表
            return fetch('/medicalStockInfo/expired', JSON.stringify(params), 'post')
        },
        fetchStockWarnList(params) {//库存预警列表
            return fetch('/medicalStockInfo/inventoryWarn', JSON.stringify(params), 'post')
        }
    },
    //单位管理端-台账管理
    ledgerManage: {
        fetchLedgerList(params) {//台账管理列表
            return fetch('/stock-info/v1/stock-info/stock-provide-record/account', params);
        },
        addLedgerInfo(params) {// 人工发放
            return fetch('/stock-info/v1/stock-info/stock-provide-record', params, 'post', 'json');
        },
    },
    //随访管理
    followupManage: {
        fetchFollowUpList(params) {//随访列表
            return fetch('/stock-info/v1/stock-info/stock-visit-info', params);
        },
        fetchIdFollowUp(params) {
            return fetch(`/stock-info/v1/stock-info/stock-visit-info/${params.id}`, params);
        },
        addFollowUpInfo(params) {
            return fetch(`/stock-info/v1/stock-info/stock-visit-info`, params, 'post', 'json');
        },
    },
    //系统管理
    systemManage: {
        /*菜单管理*/
        getPageInfoList(params) {
            return fetch('/basic-info/v1/basic-info/basic-function-menu', params)
        },
        getOneById(params) {
            return fetch(`/basic-info/v1/basic-info/basic-function-menu/${params.id}`, '', 'get', 'json')
        },
        getAllMenuList() {
            return fetch('/basic-info/v1/basic-info/basic-function-menu/getAllMenuList', '', 'get', 'json')
        },
        addOne(params) {
            return fetch('/basic-info/v1/basic-info/basic-function-menu', params, 'post', 'json')
        },
        updateOne(params) {
            return fetch(`/basic-info/v1/basic-info/basic-function-menu/${params.id}`, params, 'put', 'json')
        },
        deleteById(params) {
            return fetch(`/basic-info/v1/basic-info/basic-function-menu/deleteById/${params.id}`, '', 'get', 'json')
        },
        /*角色管理*/
        getRolePageList(params) {
            return fetch('/basic-info/v1/basic-info/basic-sys-role', params)
        },
        getRoleOneById(params) {
            return fetch(`/basic-info/v1/basic-info/basic-sys-role/${params.id}`, '', 'get', 'json')
        },
        addRoleOne(params) {
            return fetch('/basic-info/v1/basic-info/basic-sys-role', params, 'post', 'json')
        },
        updateRoleOne(params) {
            return fetch(`/basic-info/v1/basic-info/basic-sys-role/${params.id}`, params, 'put', 'json')
        },
        deleteRoleOneById(params) {
            return fetch(`/basic-info/v1/basic-info/basic-sys-role/deleteById/${params.id}`, '', 'get', 'json')
        },
        /*药具有效期预警管理*/
        fetchValidityWarnManageList(params) { // 药具有效期预警管理列表
            return fetch('/basic-info/v1/basic-info/basic-medical-validity-warning', params)
        },
        fetchValidityWarnManageDetail(params) {//获取药具有效期预警单条详情
            return fetch(`/basic-info/v1/basic-info/basic-medical-validity-warning/${params.id}`, params)
        },
        addValidityWarnManage(params) { //新增药具有效期预警
            return fetch('/basic-info/v1/basic-info/basic-medical-validity-warning/insert-batch', params, 'post', 'json')
        },
        updateValidityWarnManage(params) { //修改药具有效期预警
            return fetch(`/basic-info/v1/basic-info/basic-medical-validity-warning/${params.id}`, params, 'put', 'json')
        },
        deleteValidityWarnManage(id) { //删除药具有效期预警
            return fetch(`/basic-info/v1/basic-info/basic-medical-validity-warning/${id}`, {}, "delete")
        },
        fetchLeftValidityWarnManage(params) {//选择未设置有效期预警的药具
            return fetch(`/basic-info/v1/basic-info/basic-medical-validity-warning/get-warning-medical`, params)
        },
        /*需求计划上报表单管理*/
        fetchDemandPlanFormManageList(params) { // 需求计划上报表单管理列表
            return fetch('/basic-info/v1/basic-info/basic-plan-report-tb', params)
        },
        fetchDemandPlanFormManageDetail(params) {//获取需求计划上报表单详情
            return fetch(`/basic-info/v1/basic-info/basic-plan-report-tb/${params.id}`, params)
        },
        deleteDemandPlanFormManageT(params) {//删除需求计划上报表单管理列表
            return fetch(`/basic-info/v1/basic-info/basic-plan-report-tb/${params.id}`, params, 'delete', 'json')
        },
        addDemandPlanFormManage(params) { //新增需求计划上报表单
            return fetch('/basic-info/v1/basic-info/basic-plan-report-tb', params, 'post', 'json')
        },
        /*入库验收模板管理-列表*/
        getTemplateList(params) {
            return fetch('/basic-info/v1/basic-info/basic-template', params)
        },
        /*入库验收模板管理-新增*/
        addTemplate(params) {
            return fetch('/basic-info/v1/basic-info/basic-template', params, "post", "json")
        },
        /*入库验收模板管理-详情*/
        getTemplateById(id) {
            return fetch(`/basic-info/v1/basic-info/basic-template/${id}`)
        },
        /*入库验收模板管理-更新*/
        updateTemplate(params) {
            return fetch(`/basic-info/v1/basic-info/basic-template/${params.id}`, params, "put", "json");
        },
        /*规格管理*/
        fetchSpecManageList(params) { // 规格管理列表
            return fetch('/basic-info/v1/basic-info/basic-medical-specs', params)
        },
        deleteSpecOneById(params) {// 删除规格
            return fetch(`/basic-info/v1/basic-info/basic-medical-specs/${params.id}`, '', 'delete', 'json')
        },
        judgeSpecRepeat(params) {//判断当前规格是否重复
            return fetch('/basic-info/v1/basic-info/basic-medical-specs/check-only-one', params, "post", "json")
        },
        addSpec(params) {  //新增规格型号
            return fetch('/basic-info/v1/basic-info/basic-medical-specs/batch-save', params, "post", "json")
        },
        // 枚举类型管理
        fetchEnumerationManageList(params) { // 枚举类型管理列表
            return fetch('/basic-info/v1/basic-info/basic-sys-enum', params)
        },
        fetchEnumerationTypeDetail(params) { // 枚举类型主键查询
            return fetch(`/basic-info/v1/basic-info/basic-sys-enum/${params.id}`, params)
        },
        updateEnumerationType(params) {//枚举类型修改
            return fetch(`/basic-info/v1/basic-info/basic-sys-enum/${params.id}`, params, "put", 'json')
        },
        addEnumerationType(params) {  //新增枚举类型
            return fetch('/basic-info/v1/basic-info/basic-sys-enum', params, "post", "json")
        },
        //枚举管理
        fetchEnumerationDetailList(params) { // 枚举管理列表
            return fetch('/basic-info/v1/basic-info/basic-sys-enum-value', params)
        },
        addEnumeration(params) {  //新增枚举
            return fetch('/basic-info/v1/basic-info/basic-sys-enum-value', params, "post", "json")
        },
        //发放机厂家设置
        fetchDispenserFactoryList(params) { // 发放机厂家列表
            return fetch('/basic-info/v1/basic-info/basic-machine-factory-info', params)
        },
        fetchDispenserFactoryDetail(params) { // 发放机厂家主键查询
            return fetch(`/basic-info/v1/basic-info/basic-machine-factory-info/${params.id}`)
        },
        addDispenserFactory(params) {  //新增发放机厂家
            return fetch('/basic-info/v1/basic-info/basic-machine-factory-info', params, "post", "json")
        },
        updateDispenserFactory(params) {//发放机厂家修改
            return fetch(`/basic-info/v1/basic-info/basic-machine-factory-info/${params.id}`, params, "put", 'json')
        },
        deleteDispenserFactory(params) {//发放机厂家删除
            return fetch(`/basic-info/v1/basic-info/basic-machine-factory-info/${params.id}`, params, "delete", 'json')
        },
        //机器类型设置
        fetchDispenserTypeList(params) { // 机器类型列表
            return fetch('/basic-info/v1/basic-info/basic-machine-type-info', params)
        },
        fetchDispenserTypeDetail(params) { // 发放机厂家主键查询
            return fetch(`/basic-info/v1/basic-info/basic-machine-type-info/${params.id}`)
        },
        addDispenserTypeInfo(params) {  //新增发机器类型
            return fetch('/basic-info/v1/basic-info/basic-machine-type-info', params, "post", "json")
        },
        updateDispenserType(params) {//机器类型修改
            return fetch(`/basic-info/v1/basic-info/basic-machine-type-info/${params.id}`, params, "put", 'json')
        },
        deleteDispenserTypeInfo(params) {//机器类型删除
            return fetch(`/basic-info/v1/basic-info/basic-machine-type-info/${params.id}`, params, "delete", 'json')
        },
        // 生产批次管理
        fetchBatchNumberInfoList(params) { // 生产批次管理列表
            return fetch('/basic-info/v1/basic-info/basic-batch-info/unit-query-page', params)
        },
        addBatchNumberInfo(params) {  //新增生产批次管理
            return fetch('/basic-info/v1/basic-info/basic-batch-info/unit-insert', params, "post", "json")
        },
        updateBatchNumberInfo(params) {  //修改生产批次管理
            return fetch(`/basic-info/v1/basic-info/basic-batch-info/${params.id}`, params, "put", "json")
        },
        fetchBatchNumberInfoDeatail(params) { // 生产批次管理主键查询
            return fetch(`/basic-info/v1/basic-info/basic-batch-info/${params.id}`, params)
        },
        deleteBatchNumberInfo(params) {//删除生产批次
            return fetch(`/basic-info/v1/basic-info/basic-batch-info/${params.id}`, params, 'delete', 'json')
        }
    },
    //需求计划管理
    demandPlanManage: {
        /*需求计划管理*/
        fetchDemandPlanList(params) { //获取需求计划列表
            return fetch('/stock-info/v1/stock-info/stock-plan-report', params);
        },
        addDemandPlanList(params) {
            return fetch('/stock-info/v1/stock-info/stock-plan-report', params, 'post', 'json')
        },
        fetchLatestDemandPlan(params) {//获取需求计划模板（最新）
            return fetch('/basic-info/v1/basic-info/basic-plan-report-tb/get-year-plan-report', params)
        },
        fetchTempalteById(params) {//根据模板id获取需求计划模板
            return fetch('/basic-info/v1/basic-info/basic-plan-report-tb/query-By-plan-report-id', params)
        },
        fetchDemandPlanDetailById(params) {//根据planid获取需求计划详情
            return fetch(`/stock-info/v1/stock-info/stock-plan-report/${params.id}`, params)
        },
        fetchUnitAuditTree(params) {//获取县级及以上审核树
            return fetch('/stock-info/v1/stock-info/stock-plan-report/get-report-unit-and-status', params)
        },
        onlyAddDemandPlan(params) {//批量保存
            return fetch(`/stock-info/v1/stock-info/stock-plan-report/batch-save`, params, 'post', 'json');
        },
        addDemandPlanAndCommit(params) {//批量保存并提交
            return fetch(`/stock-info/v1/stock-info/stock-plan-report/batch-save-submit`, params, 'post', 'json');
        },
        deleteDemandPlanList(params) {// 需求计划列表删除
            return fetch(`/stock-info/v1/stock-info/stock-plan-report/${params.id}`, params, 'delete')
        },
        fetchCheckReportStatus(params) {//校验单位上报状态
            return fetch('/stock-info/v1/stock-info/stock-plan-report/check-report', params)
        },
        fetchSummaryReport(params) {//汇总上报
            return fetch(`/stock-info/v1/stock-info/stock-plan-report/summary-report`, params, 'post', 'json');
        },
        fetchSummaryAndGenerateTransfer(params) {//省级汇总并生成物资分配单
            return fetch(`/stock-info/v1/stock-info/stock-plan-report/summary-and-generate-transfer`, params, 'post', 'json');
        },
        fetchSummaryReportTransfer(params) {//省级汇总并生成物资分配单(科)
            return fetch(`/stock-info/v1/stock-info/stock-plan-report/create-supply-distribution/${params.templateId}`, params, 'put');
        },
        updateDemandPlanInfo(params) { //修改需求计划
            return fetch(`/stock-info/v1/stock-info/stock-plan-report/${params.id}`, params, 'put', 'json')
        },
        fetchQueryDistribution(params) {//获取物资分配单
            return fetch(`/stock-info/v1/stock-info/supply-distribution/query-distribution`, params);
        },
        fetchSubmitSupply(params) {//提交供应商
            return fetch('/stock-info/v1/stock-info/supply-distribution/submit-supply', params, 'post', 'json')
        },
        updateDemandPlan(params) { //修改需求计划
            return fetch(`/stock-info/v1/stock-info/stock-plan-report/${params.id}`, params, 'put', 'json')
        },

    },
    fyManage: {
        //从妇幼系统获取菜单及用户信息
        fetchFYLoginUser(params) {
            return fetch('/v1/folacin-admin/sys-login/getLoginInfo', params);
        },
    },
    //常用工具
    utils: {
        //直接下载文件，不让浏览器直接打开
        downloadFile(url, fileName) {
            window.open(url)
        },
        //判断对象是否为空白
        isBlank(obj) {
            if (obj == undefined || obj == null || obj == "" || obj == " ") {
                return true;
            }
            return false;
        },
        isNoBlank(obj) {
            return !this.isBlank(obj);
        }
    }
}
