basegood.js 2.41 KB
/*weiqingting 4.5*/
module.exports=function(app) {
	/*基础商品列表*/
	app.get("/product/base/index","goods.basegoods.Index",function(){
		this.$extend={
			moduleName:'商品管理',
			pageName:'基础商品列表'
		}
	});

	/*列表头部各个审核状态的数量*/
	app.post("/product/getbaseProductCountByStatus","basegoods_getbaseProductCountByStatus");

	/*获取列表数据*/
	app.post("/product/getBaseProductList","basegoods_getBaseProductList");

	/*添加基础商品页面*/
	app.get("/base/goods/add","goods.basegoods.Edit","basegoods_queryProductColors",function(colors,req,res){
		this.$extend={
			moduleName:'商品管理',
			pageName:'添加基础商品',
			action:"ADD",
			list:colors.data.list,
		}
	});

	/*添加基础商品*/
	app.post("/base/goods/add","basegoods_addBaseProduct");

	/*修改基础商品*/
	app.get("/base/goods/update/:productSkn/:isAuditing","goods.basegoods.Edit",["basegoods_queryProductColors","basegoods_getBaseProduct"],function(colors,goods,req,res){
		this.$extend={
			moduleName:'商品管理',
			pageName:'添加基础商品',
			action:"UPDATE",
			list:colors.data.list,
		}
		return goods;
	});

	/*删除基础商品*/
	// app.post("/product/deleteBaseProduct","basegoods_deleteBaseProduct");

	/*提交修改基础商品数据*/
	app.post("/product/updateBaseProduct","basegoods_updateBaseProduct");

	/*基础商品详情空页面*/
	app.get("/base/goods/info/:productSkn/:isAuditing","goods.basegoods.Info","basegoods_getBaseProduct");

	/*获取商品详情数据*/
	// app.post("/product/getBaseProduct","basegoods_getBaseProduct");

	/*获取颜色*/
	app.post("/productColor/queryProductColors","basegoods_queryProductColors");

	/*获取(非)销售属性*/

	app.post("/product/querySortBySmallSort","basegoods_querySortBySmallSort");


	app.post("/product/checkSkuBarCodeExist","basegoods_checkSkuBarCodeExist");

	/*批量导出页面*/
	app.get("/goods/piliang/batch","goods.basegoods.Batch",function(){
		this.$extend={
			moduleName:'商品管理',
			pageName:'批量功能',
			isPL:true
		}
	});

	app.get("/goods/base/batch","goods.basegoods.Batch",function(req,res){
		this.$extend={
			moduleName:'商品管理',
			pageName:'基础商品导入',
			isBase:true,
			shopName:req.session.user.auth.shopName,
			shopId:req.session.user.auth.shopId
		}
	});

	/*根据任务ID获取上传结果*/
	app.post("/product/queryBatchImportResult","basegoods_queryBatchImportResult");
}