/**
 * Copyright (c) 2013-Now http://aidex.vip All rights reserved.
 */
// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作
const install = (Vue, vm) => {

    // 参数配置对象
    const config = vm.vuex_config;
	

    // 将各个定义的接口名称，统一放进对象挂载到vm.$u.api(因为vm就是this，也即this.$u.api)下
    vm.$u.api = {
        // 基础服务：登录登出、身份信息、菜单授权、切换系统、字典数据等
        login: (params = {}) => vm.$u.postJson(config.adminPath + '/login', params),
        // 上海环境
        // getInfo: (params = {}) => vm.$u.get('http://192.168.1.128:8088' + '/getInfo'),
        // 外网环境
        getInfo: (params = {}) => vm.$u.get('http://182.140.132.45:9011' + '/getInfo'),
        changepassword: (params = {}) => vm.$u.postJson(config.adminPath + '/cmsmv/changepassword', params),
		// 到货条码打印查询
        getforprint: (params = {}) => vm.$u.postJson(config.adminPath + '/purcc/getforprint', params),
		// 到货条码打印
        purccprint: (params = {}) => vm.$u.postJson(config.adminPath + '/purcc/print', params),
		// 到货检验查询
		getforcheck: (params = {}) => vm.$u.postJson(config.adminPath + '/purcc/getforcheck', params),
		// 到货检验确认
        purcccheck: (params = {}) => vm.$u.postJson(config.adminPath + '/purcc/check', params),
        // 查询进货单创建列表
        getforcreate: (params = {}) => vm.$u.postJson(config.adminPath + '/purtg/getforcreate', params),
        // 创建进货单
        purtgcreate: (params = {}) => vm.$u.postJson(config.adminPath + '/purtg/create', params),
        // 委外进货打印查询
        mocthgetforprint: (params = {}) => vm.$u.postJson(config.adminPath + '/mocth/getforprint', params),
		// 委外进货打印
        mocthprint: (params = {}) => vm.$u.postJson(config.adminPath + '/mocth/print', params),
        // 委外检验查询
		mocthgetforcheck: (params = {}) => vm.$u.postJson(config.adminPath + '/mocth/getforcheck', params),
		// 委外检验确认
        mocthcheck: (params = {}) => vm.$u.postJson(config.adminPath + '/mocth/check', params),
        // 委外扫码上架
		mocthgetforputon: (params = {}) => vm.$u.postJson(config.adminPath + '/mocth/getforputon', params),
		// 委外扫码上架
        mocthputon: (params = {}) => vm.$u.postJson(config.adminPath + '/mocth/puton', params),
        // 领料单查询
		moctcgetforcreate: (params = {}) => vm.$u.postJson(config.adminPath + '/moctc/getforcreate', params),
		// 领料单创建
        moctccreate: (params = {}) => vm.$u.postJson(config.adminPath + '/moctc/create', params),
        // 品号信息
        getforinvmbinfo: (params = {}) => vm.$u.postJson(config.adminPath + '/invmb/getforinvmbinfo', params),
        // 入库单创建
        createforstorage: (params = {}) => vm.$u.postJson(config.adminPath + '/sfctb/createforstorage', params),
		// 查询产品库存
		getforinvmlinfoApi: (params = {}) => vm.$u.postJson(config.adminPath + '/invml/getforinvmlinfo', params),
		// 新增库存交易单
		stockConfirmApi: (params = {}) => vm.$u.postJson(config.adminPath + '/stockTaking/confirm', params),
		// 调拨确认
		transferConfirmApi: (params = {}) => vm.$u.postJson(config.adminPath + '/stockAllocate/confirm', params),
		// 仓库查询
		getWarehouseListApi: (params = {}) => vm.$u.postJson(config.adminPath + '/cmsmc/getCmsmcList', params),
		// 库位查询
		getStorageListApi: (params = {}) => vm.$u.postJson(config.adminPath + '/cmsni/getCmsniList', params),
    };

}

export default {
    install
}
