cy
2022-06-21 129904537f66509f97b285e7eb4f42b3dc349dd0
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!doctype html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <title>供货商管理</title>
[#include "/business/pages/include/static.html" /]
</head>
 
<body>
 
<div class="fs_main clearfix">
    <div class="event_fill list_common_select">
        <form id="myform" action="">
            <table>
                <tr>
                    <th width="70%">
                        <div class="fill_item"><label>备件分类:</label><input class="general" type="text" id="cate_name" name="cate_name"/></div>
                        <div class="fill_item"><label>分类编码:</label><input class="general" type="text" id="code" name="code"/></div>
                    </th>
                    <td width="30%">
                        <a class="retrievebtn" id="reset">重置</a><a class="retrievebtn focus" href="javascript:query();">查询</a>
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>
 
 
<div class="fs_main clearfix">
    <table class="display_form common_list_table">
        <tr class="title">
            <td width="7%"><input type="checkbox" id="selAll"></td>
            <td width="30%">备件分类</td>
            <td width="30%">分类编码</td>
            <td width="30%">报价(元)</td>
        </tr>
    [#if cateList?? && cateList?size>0]
    [#list cateList as item]
        <tr>
            <td><input type="checkbox" name="ids" class="ids" value="${item.id}"></td>
            <td>${item.lv1_name}-${item.lv2_name}-${item.lv3_name}</td>
            <td>${item.code1}-${item.code2}-${item.code}</td>
            <td><input type="text" name="offer_price" class="general"/></td>
        </tr>
    [/#list]
    [/#if]
    </table>
</div>
 
 
 
<script type="text/javascript">
    $(function () {
 
        $("input[name=offer_price]").blur(function () {
            if(!/(^[0-9]{1,7}$)|(^[0-9]{1,7}[\.]{1}[0-9]{1,2}$)/.test($.trim($(this).val()))){
                popupTips("请输入正确的报价(整数最多七位,小数最多两位)");
                $(this).focus();
            }
        })
 
        $("#reset").click(function () {
            $("#myform")[0].reset();
        });
 
        $("#selAll").click(function () {
            if($(this).prop("checked")==true){
                $(".ids:checkbox").prop("checked",true);
            }else{
                $(".ids:checkbox").prop("checked",false);
            }
        });
    })
    
    function query() {
        $("#myform").submit();
    }
 
    function onDialogBtnClick(btnID, dialogID, config) {
        if (btnID == "btnSure") {
            var flag = true;
            var cateAry = [];
            $(".ids:checkbox:checked").each(function (i) {
                var cate = {};
                var cate_id = $(this).val();
                var name = $(this).parent().next("td").text();
                var code = $(this).parent().next("td").next("td").text();
                var offer_price = $.trim($(this).parent().parent().find("input[name=offer_price]").val());
                cate["cate_id"] = cate_id;
                cate["name"] = name;
                cate["code"] = code;
                cate["offer_price"] = offer_price;
 
                cateAry.push(cate);
 
                if($.util.isEmpty(offer_price)){
                    flag = false;
                    return false;
                }
 
            })
 
            if(cateAry.length>0) {
                if(flag){
                    window.top.frames["dialogIframe0"].selCate(cateAry);
                    window.top.hideDialog(1);
                }else {
                    popupTips("报价不能为空");
                }
            }else {
                popupTips("请填写供货信息");
            }
        }
    }
 
</script>
 
</body>
</html>