Blame view

code/apps/goods/controllers/basegood.js 2.41 KB
weiqingting authored
1 2 3 4 5 6
/*weiqingting 4.5*/
module.exports=function(app) {
	/*基础商品列表*/
	app.get("/product/base/index","goods.basegoods.Index",function(){
		this.$extend={
			moduleName:'商品管理',
weiqingting authored
7
			pageName:'基础商品列表'
weiqingting authored
8 9 10 11 12 13 14 15 16 17
		}
	});

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

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

	/*添加基础商品页面*/
weiqingting authored
18
	app.get("/base/goods/add","goods.basegoods.Edit","basegoods_queryProductColors",function(colors,req,res){
weiqingting authored
19 20 21
		this.$extend={
			moduleName:'商品管理',
			pageName:'添加基础商品',
weiqingting authored
22
			action:"ADD",
weiqingting authored
23 24 25 26 27 28 29 30 31 32 33 34
			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:'添加基础商品',
weiqingting authored
35
			action:"UPDATE",
weiqingting authored
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
			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");

	/*获取(非)销售属性*/
weiqingting authored
58
	app.post("/product/querySortBySmallSort","basegoods_querySortBySmallSort");
weiqingting authored
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82


	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获取上传结果*/
weiqingting authored
83
	app.post("/product/queryBatchImportResult","basegoods_queryBatchImportResult");
weiqingting authored
84
}