cy
2022-06-23 b83c40548208609d0d6826be13d742c28a784806
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
[#macro cub_cus id="" name="" cusConId="" value="" text="" iframe="{'lv1_id':'','lv2_id':''}" back=""]
[#assign iframe_json=iframe?eval/]
<input class="general" type="text" id="${name}" name="${name}" value="${text}" onclick="showSub();" readOnly/>
<input type="hidden" id="${id}" name="${id}" value="${value}"/>
 
<script>
$(function(){
    $("#${cusConId}").change(function(){
        $("#${id}").val("");
        $("#${name}").val("");
    })
})
 
function showSub(){
    var iframe_lv1_id = '${iframe_json.lv1_id}';
    var iframe_lv2_id = '${iframe_json.lv2_id}';
    if($("#${cusConId}").length<=0){
        return;
    }else{
        var cusId = $("#${cusConId}").val();
        if(cusId==''){
            window.top.popupTips("请选择${Constants.CUSTOMER_CONSTANTS}");
            return;
        }
        var value = $("#${id}").val();
        var text = $.util.encode($.util.encode($("#${name}").val()));
        var url = "${base}/common/subCusSelector.html?cusId="+cusId+"&value="+value+"&text="+text
                +"&iframe_lv1_id=" + iframe_lv1_id + "&iframe_lv2_id="+iframe_lv2_id;
        window.top.openDialog("selectSubCus","操作",
                 {},
                 {"width":60,"height":70},
                 [{btnId:"btnSure", btnName:"确定", btnStyle:"bluebtn"}],url);
    }
}
 
function selSubCus(id,name){
    $("#${id}").val(id);
    $("#${name}").val(name);
    [#if back??&&back!=""]
    ${back}(id,name);
    [/#if]
}
</script>
[/#macro]