productMaterial.js
1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
module.exports = function (app) {
// 首页
app.get('/goods/material/index', "product.productMaterial.Index", "select_selectAllMaxSort", function(rs) {
this.$extend = {
moduleName: "产品管理",
pageName: "产品材质管理",
maxSortIds: rs.data
}
return rs.data;
});
// 查询列表
app.post('/product/material/list', 'productMaterial_getMaterialList');
// 编辑
app.get('/goods/material/edit/:materialId', 'product.productMaterial.Edit', ['productMaterial_getMaterialDetail', 'select_selectAllMaxSort'],
function(materialrs, sortrs) {
this.$extend = {
moduleName: "产品管理",
pageName: "产品材质编辑",
material: materialrs.data,
maxSortIds: sortrs.data,
title: '编辑材质信息',
action: '/product/material/update'
}
});
// 新增
app.get('/goods/material/add', 'product.productMaterial.Edit', 'select_selectAllMaxSort', function(rs) {
this.$extend = {
moduleName: "产品管理",
pageName: "产品材质创建",
maxSortIds: rs.data,
material: {id: 0},
title: '新增材质信息',
action: '/product/material/add'
}
});
// 新增
app.post('/product/material/add', 'productMaterial_addMaterial');
// 更新
app.post('/product/material/update', 'productMaterial_updateMaterial');
// 删除
app.post('/product/material/delete', 'productMaterial_deleteMaterial');
app.post('/product/material/getBindProductInfo', 'productMaterial_getBindProductInfo');
// 查看绑定该材质的商品列表
app.get('/goods/material/bindinfo/:materialId', 'product.productMaterial.Bind', function(req, res) {
this.$extend = {
moduleName: "产品管理",
pageName: "产品材质绑定信息"
}
});
}