mitao
2024-07-08 022a7ff7abf82cd2546e18071ade5228b4e2339f
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
@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal">
            <input type="hidden" id="id" value="${id}">
            <div class="row">
                @if(isNotEmpty(classifyIdOne)){
                    <input type="hidden" id="classifyIdOne" value="${classifyIdOne!}">
                    <#select id="classifyIdTwo" name="请选择二级分类">
                        @for(info in classifyList) {
                            <option value="${info.id}">${info.classifyName}</option>
                        @}
                    </#select>
                @}else{
                    <#select id="classifyIdOne" name="请选择一级分类">
                        @for(info in classifyList) {
                        <option value="${info.id}">${info.classifyName}</option>
                        @}
                    </#select>
                @}
            </div>
            <div class="row text-center">
                <button class="btn btn-primary" onclick="DialogInfo.addSubmit()">确定</button>
            </div>
        </div>
    </div>
</div>
<script>
    var DialogInfo = {
        $parent: window.parent.DialogInfo,
        validFields: {
 
        }
    }
    DialogInfo.get = function( key) {
        return $( "#" + key).val();
    }
    DialogInfo.close = function ( nodes) {
        this.$parent.refresh_tree( nodes);
        window.parent.layer.close( this.$parent.layerIndex);
    }
    // 获取提交数据
    DialogInfo.get_submit_data = function() {
        return {
            merchantId: this.get( "id"),
            classifyIdOne: this.get( "classifyIdOne"),
            classifyIdTwo: this.get( "classifyIdTwo")
        }
    }
    // 提交
    DialogInfo.addSubmit = function () {
        Feng.base_ajax_data( "/memMerchant/addMallClassifyMerchant", this.get_submit_data(), function ( data) {
            Feng.success( "添加成功");
            DialogInfo.close( data);
        });
    }
 
    $(function () {
        Feng.initValidator( "formId", DialogInfo.validFields);
    })
</script>
@}