operations.salecategory.Edit.js
1.75 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
webpackJsonp([120],[
/* 0 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $ = __webpack_require__(1),
common = __webpack_require__(2);
var e = new common.edit('#basicForm', {
bucket: 'taobaocms'
});
e.init();
/*new common.dropDown({
el: '#maxsort',
ajax: 'sortlist'
});
new common.dropDown({
el: '#middlesort',
ajax: 'sortSubList',
params: function() {
return {param: $('#maxsort').val()}//common.util.__input('maxsort')
}
});*/
var tabTree = new common.tabTree(".sortTree");
tabTree.init();
var tabTreeArr = [];
tabTreeArr.push(tabTree);
//添加物理类目
$(document).on('click', '.add-sort-btn',function() {
var $sortGroup = $($('#sortWrap').html());
$('.sort-wrap').find('.row:last').find('.add-sort-btn').hide().end().find('.del-sort-btn').show();
$sortGroup.appendTo($('.sort-wrap'));
tabTree = new common.tabTree(".sortTree:last");
tabTreeArr.push(tabTree);
tabTree.init();
});
//删除物理类目
$(document).on('click', '.del-sort-btn', function() {
$(this).parents('.row').remove();
$('.sort-wrap').find('.row:last').find('.add-sort-btn').show().end().find('.del-sort-btn').show();
if ($('.sort-wrap').find('.row').size() == 1) {
$('.sort-wrap').find('.row:last').find('.add-sort-btn').show().end().find('.del-sort-btn').hide();
}
});
$('#save_brand').on('click', function() {
e.submit($('#basicForm').attr('action'), function(option) {
console.log(option.data);
$.each(tabTreeArr, function(i, item) {
});
option.success = function(res) {
res = res.data;
if (res.code == '200') {
e.$tip(res.message, function() {
history.go(-1);
}, 'growl-success');
} else {
e.$tip(res.message);
}
return false;
}
});
})
/***/ }
]);