|
|
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
|
|
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/goods.spec'], function ($, undefined, Backend, Table, Form, Spec) {
|
|
|
|
|
|
var Controller = {
|
|
|
index: function () {
|
...
|
...
|
@@ -66,7 +66,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin |
|
|
},
|
|
|
add: function () {
|
|
|
Controller.api.bindevent();
|
|
|
require(["backend/goods.spec"],function(){
|
|
|
// 规格
|
|
|
var specMany = new GoodsSpec({
|
|
|
container: '.goods-spec-many'
|
|
|
});
|
...
|
...
|
@@ -91,7 +91,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin |
|
|
}
|
|
|
return true;
|
|
|
});
|
|
|
});
|
|
|
|
|
|
// 切换单/多规格
|
|
|
$('select[name="row[spec_type]"]').change(function (e) {
|
...
|
...
|
@@ -106,7 +105,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin |
|
|
},
|
|
|
edit: function () {
|
|
|
Controller.api.bindevent();
|
|
|
require(["backend/goods.spec"],function(){
|
|
|
|
|
|
setTimeout(function () {
|
|
|
$('select[name="row[spec_type]"]').trigger("change");
|
|
|
}, 100);
|
|
|
// 规格
|
|
|
var specMany = new GoodsSpec({
|
|
|
container: '.goods-spec-many'
|
|
|
}, Config.specData);
|
...
|
...
|
@@ -131,7 +134,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin |
|
|
}
|
|
|
return true;
|
|
|
});
|
|
|
});
|
|
|
|
|
|
// 切换单/多规格
|
|
|
$('select[name="row[spec_type]"]').change(function (e) {
|
...
|
...
|
|