david-PC\david
2018-06-12 f240ac3ccd37c541cab2c21cfc433d3510999a3c
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>协议列表</title>
    <link href="../../../css/common.css" rel="stylesheet" type="text/css">
    <link href="../../../css/control.css" rel="stylesheet" />
    <link href="../../../css/grid.css" rel="stylesheet" type="text/css">
    <script src="../../../js/jquery-1.7.2.min.js"></script>
    
    <script src="../../../js/foundation-2.0.js"></script>
    <script src="../../../js/grid.js"></script>
    
    <script type="text/javascript" >
        var grid, filter, param = "";
        
        function Clear(){
            filter.clear();
        }
        
        function Query(){
            param = filter.toFilter();
            
            var url = "root/data/aggrement/getSetByPage?pageno=1&pagesize=10&" + param;
            grid.setURL(url);
        }
        
        function deleteDoc() {
            var line = grid.getSelected();
            
            if (!line) {
                Dialog.alert("请选择一条记录");
                return;
            }
            alert("确定删除协议编号为:'" + line.no + "'的申请?");
        }
        
        function showApproval() {
            var line = grid.getSelected();
            
            if (!line) {
                Dialog.alert("请选择一条记录");
                return;
            }
            
            setLocalData("rowdata", line);
            setLocalData("readonly", false);
            windowTo("root/page/fine/business/application.html");
        }
        
        function showEdit(readonly) {
 
            
            
            
        
            windowTo("root/page/fine/business/application.html");
        }
        
        function showOneApplication(code) {
            var line = grid.getSelected();
            
            if ("new" != code && !line) {
                Dialog.alert("请选择一条记录");
                return;
            }
            
            setLocalData("operator", code);
            setLocalData("rowdata", line);
            
            windowTo("root/page/fine/business/application.html");
        }
        
        function showWorkflow(index) {
            Win.popup({
                width: 800,
                height: 500,
                url: "root/page/fine/business/workflowChart.html",
                data: grid.rows[index]
            });
        }
        
        function renderApplicationType(element, value) {
            if ("PurchaseAndSell" == value) {
                value = "底价备案";
            }
            else if ("Agency" == value) {
                value = "拥金备案";
            }
            
            element.html(value);
        }
        
        var idx = 0;
        function renderApplicationStatus(element, value) {
            if ("open" == value) {
                value = "<a href='javascript:showWorkflow(" + idx + ");'>审批通过</a>";
            }
            else if ("commit" == value) {
                value = "<a href='javascript:showWorkflow(" + idx + ");'>审批中</a>";
            }
            else if ("close" == value) {
                value = "已作废";
            }            
            else if ("input" == value) {
                value = "录入";
            }
            
            idx++;
            element.html(value);
        }
        
        $(document).ready(function() {
            grid = new $.fm.Grid({
                element: "sheet",
                showPage:true,
                url: "root/data/procedure/getAgreementList?pageno=1&pagesize=10",
                limit: 12,
                columns: [
                    {field: "typecode", caption: "备案类型", width: 100, render: renderApplicationType},
                    {field: "statuscode", caption: "状态", width: 80, render: renderApplicationStatus},
                    {field: "no", caption: "协议编号", width: 80},
                    {field: "customercode", caption: "乙方编码", width: 80},
                    {field: "customername", caption: "乙方名称", width: 250, align: "left"},
                    {field: "provincename", caption: "乙方省份", width: 100},
                    {field: "cityname", caption: "乙方城市", width: 100},
                    {field: "begindate", caption: "开始时间", width: 80},
                    {field: "enddate", caption: "结束时间", width: 80},
                    {field: "manager", caption: "负责人", width: 100},
                    {field: "operator", caption: "申请人", width: 100},
                    {field: "updatetime", caption: "修改时间", width: 160}
                ]
            });
            
            filter = new Filter({
                element: "query"
            });
        });
    </script>    
</head>
 
<body style="overflow: hidden;">
    <div id="query" class="query">
        <table>
            <tr height="16px">
                <td>
                    <img class="query_img" src="../../../image/query.png">
                </td>
                <td><div class='lbl_query'>终端编码:</div></td>
                <td><input name='code' operator='like' class='edt_query' type="text"/></td>
                
                <td><div class='lbl_query'>终端名称:</div></td>
                <td><input name='name' operator='like' class='edt_query' type="text"/></td>
                
                <td><div class='lbl_query'>省份</div></td>
                <td><input name='province' operator='like' class='edt_query' type="text"/></td>
                
                <td><div class='lbl_query'>城市:</div></td>
                <td><input name='city' operator='like' class='edt_query' type="text"/></td>
                
                <td><div class='lbl_query'>申请人:</div></td>
                <td><input name='operator' class='edt_query' type="text"/></td>
                
                <td><div class='btn_query' onclick='Query();'>查询</div></td>
                <td><div class='btn_query' onclick='Clear();'>清空</div></td>
            </tr>
        </table>
    </div>
    <div id="sheet" style="margin: 0px 15px"></div>
    
    <div style="height: 30px; line-height: 30px; margin-top: 15px;" align="center">
        <div class="btn btn-green" onclick="showOneApplication('new');">备案申请</div>
        <div class="btn btn-green" onclick="showOneApplication('readonly');">查看</div>
        <div class="btn btn-green" onclick="showOneApplication('edit');">修改</div>
        <div class="btn btn-green" onclick="deleteDoc();">删除</div>
        <div class="btn btn-green" onclick="showOneApplication('change');" style="margin-left: 30px; background-color: #3c8dbc">变更申请</div>
    </div>
    
</body>
</html>