product.js 9.75 KB
//exports.domain = require('../config/common.js').domain;

exports.domain = require('../config/common.js').domain;

//路由配置
exports.res = [
    {
        //商品管理【品类列表】页面渲染
        route: '/erpproduct/sort/index',
        method: 'GET',
        view: 'pages/product/index',
        src: '/product/index',
        url: '/product/queryAllProductSortList',
        isJsonRaw:true
    },{
        //商品管理【ajax查询所有品类】
        route: '/product/class/queryAllProductSortList',
        method: 'POST',
        url: '/product/queryAllProductSortList',
        isJsonRaw:true
    },{
        //商品管理【根据ID ajax查询子品类列表】
        route: '/product/class/queryProductSortList',
        method: 'POST',
        url: '/product/queryProductSortList',
        isJsonRaw:true,
        params: [
            {
                name: 'param',
                type: 'Number'
            }
        ]
    },{
        //商品管理>【品类列表ajax更新】
        route: '/product/sort/update',
        method: 'POST',
        url: '/product/updateProductSort',
        isJsonRaw:true,
        params: [
            {
                name: 'param',
                type: 'Number'
            },{
                name: 'sortName',
                type: 'String'
            },{
                name: 'sortInitials',
                type: 'String'
            },{
                name:'parentId',
                type: 'Number'
            },{
                name: 'orderBy',
                type: 'Number'
            },{
                name: 'status',
                type: 'Number'
            }
        ]
    },{
        //商品管理>【添加品类】页面渲染
        route: '/product/class/new',
        method: 'GET',
        view: 'pages/product/new-class',
        noApi:true,
        src: '/product/add',
        data: {
            data: {
                status: 1
            }
        }
    },{
        //商品管理>【添加品类】ajax请求接口
        route: '/product/sort/addProductSort',
        method: 'POST',
        url: '/product/addProductSort',
        isJsonRaw:true,
        params: [
            {
                name: 'param',
                type: 'Number'
            },{
                name: 'sortName',
                type: 'String'
            },{
                name: 'sortInitials',
                type: 'String'
            },{
                name:'parentId',
                type: 'Number'
            },{
                name: 'orderBy',
                type: 'Number'
            },{
                name: 'status',
                type: 'Number'
            }
        ]
    },{
        //商品管理>【编辑品类】页面
        route: '/product/class/edit/:param',
        method: 'GET',
        view: 'pages/product/new-class',
        url: '/product/getProductSort',
        src: '/product/add',
        isJsonRaw:true,
        params: [
            {
                name: 'param',
                type: 'Number'
            }
        ]
    },{
        //商品管理>【产品属性】页面渲染
        route: '/erpproduct/attribute/index',
        method: 'GET',
        view: 'pages/product/product-attr',
        url: '/product/queryAllProductSortList',
        isJsonRaw:true,
        src: '/product/attr'
    },{
        //商品管理>【产品属性ajax获取】
        route: '/product/attr/get',
        method: 'POST',
        url: '/product/getAttr',
        isJsonRaw:true
    },{
        //商品管理>【添加产品属性ajax】
        route: '/product/attr/add',
        method: 'POST',
        url: '/product/addProductAttribute',
        isJsonRaw:true,
        params: [
            {
                name: 'attributeName',
                type: 'String'
            },{
                name: 'saleType',
                type: 'Number'
            },{
                name: 'inputType',
                type: 'String'
            },{
                name: 'attributeType',
                type: 'String'
            },{
                name: 'isMust',
                type: 'String'
            },{
                name: 'isSearch',
                type: 'String'
            },{
                name: 'maxValueLen',
                type: 'Number'
            },{
                name: 'isAllowAlias',
                type: 'String'
            },{
                name: 'orderBy',
                type: 'Number'
            },{
                name: 'state',
                type: 'Number'
            },{
                name: 'remark',
                type: 'String'
            },{
                name: 'attributeValues',
                type: 'String'
            },{

                name: 'displayPosition',
                type: 'Number'
            },{
                name: 'categoryId',
                type: 'Number'
            }
        ]
    },{
        //商品管理>【更新产品属性ajax】
        route: '/product/attr/update',
        method: 'POST',
        url: '/product/updateProductAttribute',
        isJsonRaw:true,
        params: [
            {
                name: 'attributeName',
                type: 'String'
            },{
                name: 'saleType',
                type: 'Number'
            },{
                name: 'inputType',
                type: 'String'
            },{
                name: 'attributeType',
                type: 'String'
            },{
                name: 'isMust',
                type: 'String'
            },{
                name: 'isSearch',
                type: 'String'
            },{
                name: 'maxValueLen',
                type: 'Number'
            },{
                name: 'isAllowAlias',
                type: 'String'
            },{
                name: 'orderBy',
                type: 'Number'
            },{
                name: 'state',
                type: 'Number'
            },{
                name: 'remark',
                type: 'String'
            },{
                name: 'attributeValues',
                type: 'String'
            },{

                name: 'displayPosition',
                type: 'Number'
            },{
                name: 'attributeId',
                type: 'Number'
            }
        ]
    },{
        //商品管理【根据类目ID ajax查询属性列表】
        route: '/product/attr/queryProductAttributeList',
        method: 'POST',
        url: '/product/queryProductAttributeList',
        isJsonRaw:true,
        params: [
            {
                name: 'categoryId',
                type: 'Number'
            }
        ]
    },{
        //商品管理【根据类目ID ajax查询属性的详细信息】
        route: '/product/attr/getProductAttribute',
        method: 'POST',
        url: '/product/getProductAttribute',
        isJsonRaw:true,
        params: [
            {
                name: 'attributeId',
                type: 'Number'
            }
        ]
    }, {
        //商品管理 -> 代销变价
        route: '/erpproduct/price/index',
        method: 'GET',
        view: 'pages/product/price',
        src: '/product/price',
        noApi:true,
        data: {
            bottons:'{"edit":true,"columnsHidisFr":true}',
            gridurl:'/product/price/list',
            domain: exports.domain
        }
    }, {
        //商品管理 -> 代销变价 -> 列表数据
        route: '/product/price/list',   
        method: 'POST',
        url: '/product/queryProductPriceList',
        isJsonRaw:true,
        params: [
            {name: 'product_skn', type: 'Number'},
            {name: 'shop_id', type: 'Number'},
            {name: 'brand_id', type: 'Number'},
            {name: 'supplier_id', type: 'Number'},
            {name: 'is_jit', type: 'String'},
            {name: 'is_auditing', type: 'Number'},
            {name: 'stock', type: 'Number'},
            {name: 'gender', type: 'Number'},
            {name: 'max_sort_id', type: 'Number'},
            {name: 'middle_sort_id', type: 'Number'},
            {name: 'small_sort_id', type: 'Number'},
            {name: 'page', type: 'Number'},
            {name: 'size', type: 'Number'}
        ]
    }, {
        //商品管理 -> 代销变价 -> 获得单个变价详情
        route: '/product/getPrice',
        method: 'POST',
        url: '/product/getProductPrice',
        isJsonRaw: true,
        params: [
            {name: 'param', type: 'Number'}
        ]
    }, {
        route: '/product/query/shop',
        method: 'POST',
        url: '/ShopsRest/queryAllShops',
        isJsonRaw: true,
        params: []
    }, {
        route: '/product/query/brand',
        method: 'POST',
        url: '/erpproduct/brands/queryAllBrands',
        isJsonRaw: true,
        params: []
    }, {
        route: '/product/query/supplier',
        method: 'POST',
        url: '/supplier/supplier/queryAllSupplier',
        isJsonRaw: true,
        params: []
    }, {
        route: '/product/query/maxSort',
        method: 'POST',
        url: '/product/queryAllMaxSortList',
        isJsonRaw: true,
        params: []
    }, {
        //单个变价接口
        route: '/product/updatePrice',
        method: 'POST',
        url: '/product/updateProductPrice',
        isJsonRaw: true,
        params: [
            {name: 'product_skn', type: 'number'},
            {name: 'sales_price', type: 'number'},
            {name: 'vip_discount_type', type: 'number'},
            {name: 'return_coin', type: 'number'},
            {name: 'vip_price', type: 'number'},
            {name: 'vip1_price', type: 'number'},
            {name: 'vip2_price', type: 'number'},
            {name: 'vip3_price', type: 'number'}
        ]
    }, {
        //批量变价接口
        route: '/product/batchUpdatePrice',
        method: 'POST',
        url: '/product/batchUpdateProductPrice',
        isJsonRaw: true,
        params: []
    }
];