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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Soft_SellRecordAdd.aspx.cs" Inherits="CY.WebForm.Pages.adminclient.Soft_SellRecordAdd" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>新增/修改软件销售记录</title>
    <uc:CMSHead ID="CMSHead1" runat="server" />
    <script type="text/javascript">
        ///新增客户
        function showCustomer() {
            top.Dialog.open({ URL: "/Pages/adminclient/CorporateClientsEdit.aspx", Title: "新增客户", Width: 900, Height: 680 });
        }
 
        //为Select新增过滤功能
        function SelectAddSearch() {
            $("select[SelInputHtml='True']").each(function (i, v) {
                $(this).unbind("blur");
                var old = $(this).html();
                var oldObject = $(this).clone();
                var sign = "selectS" + i;
                $(v).attr("sign", sign);
 
                var inputClass = "input_" + sign;
                var html = "<span style='margin-left:10px'>过滤:</span><input type='text' class='" + inputClass + "' style='width:80px;height:18px;line-height:18px;'/><span onclick='showCustomer()' style=\"padding-left:10px;\" class=\"a_under\">新增客户</span>";
                $(v).after(html);
                $("." + inputClass).blur(function () {
                    var nowval = $(this).val().trim();
                    var output = "";
                    if (nowval == "" || nowval == null) {
                        output = old;
                    } else {
                        output += "<option value=''>请选择</option>";
                        var valueArr = new Array();
                        oldObject.find("option").each(function (ii, vv) {
 
                            var value = $.trim($(vv).attr("value"));
                            var text = $.trim($(vv).text());
 
                            if (text.indexOf(nowval) >= 0)
                                valueArr.push(value + "|||" + text);
                        });
                        for (var ss in valueArr) {
                            var s = valueArr[ss];
                            if (s.split("|||").length == 2) {
                                var value1 = s.split("|||")[0];
                                var text1 = s.split("|||")[1];
                                output += "<option value='" + value1 + "'>" + text1 + "</option>";
                            }
                        }
                    }
                    $(v).html(output);
                });
            });
        }
 
        function custormerChange(sel) {
            if (!sel.value) return;
            $.ajax({
                url: '/Pages/common/CommonAjax.aspx',
                async: false,
                type: "POST",
                data: { dateType: "getsoftclirntInfo", id: sel.value },
                success: function (msg) {
                    var jnone = [];
                    eval("jnone=" + msg);
                    if (jnone.msg == 'err') {
                        CommObj.Msg(jnone.alt);
                    } else {
                        document.getElementById('txtDegreeImportanId').value = jnone.DegreeImportanId;
                        document.getElementById('selCustormerManagers').value = jnone.AccountManagerId;
                        document.getElementById('selBusinessManagers').value = jnone.BusinessManagerId;
                        document.getElementById('txtMobile').value = (jnone.CompanyPhone == "" ? jnone.Mobile : jnone.CompanyPhone);
                        document.getElementById('txtQQ').value = jnone.QQ;
                        document.getElementById('txtMKMdG').value = jnone.BusinessManagers;
                    }
                }
            });
        }
    </script>
    <script type="text/javascript">
        $(function () {
            SelectAddSearch();
            $("#txtSoftQuantity").change(function () {
                var price = parseInt($("#txtSoftUnitprice").val());
                var quantity = parseInt($("#txtSoftQuantity").val());
                if (isNaN(price) || isNaN(quantity)) {
                    $("#txtOrderMoney").val("0");
                } else {
                    $("#txtOrderMoney").val(price * quantity);
                }
            });
        });
    </script>
</head>
<body>
    <%--<textarea id="txtExaminedRecore" runat="server" style="width: 370px; height: 50px;" class=""></textarea>--%>
    <form id="form1" class="form2" runat="server">
    <div>
        <table class="tableStyle" style="margin: 10px auto;" cellpadding="0" cellspacing="0">
            <tr>
                <td class="ali03 w100px">
                    订单号:
                </td>
                <td>
                    <span id="spanOrderNum" runat="server"></span>
                </td>
                <td class="ali03 w100px">
                    产品名称:
                </td>
                <td colspan="3">
                    <asp:DropDownList runat="server" ID="txtSoftId" keepdefaultstyle="true" class="Sreq w120px" msg="请选择软件" OnSelectedIndexChanged="txtSoftTypeId_SelectedIndexChanged" AutoPostBack="true">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="ali03 w100px">
                    软件单价:
                </td>
                <td>
                    <input id="txtSoftUnitprice" type="text" class="req int w100px" min="0" value="0" runat="server" msg="请填写大于0的整数" readonly="readonly" />元
                </td>
                <td class="ali03 w100px">
                    购买数量:
                </td>
                <td>
                    <input id="txtSoftQuantity" type="text" class="req int w120px" min="0" value="0" maxlength="8" runat="server" msg="请填写大于0的整数" />
                </td>
                <td class="ali03 w100px">
                    订单金额:
                </td>
                <td>
                    <input id="txtOrderMoney" type="text" class="req int w100px" min="0" value="0" runat="server" msg="请填写大于0的整数" />元
                </td>
            </tr>
            <tr>
                <td class="ali03 w100px">
                    客户名称:
                </td>
                <td colspan="5">
                    <input type="hidden" id='txtCustormer' runat="server" />
                    <input id='txtCustormerName' runat="server" readonly="readonly" /><span id='spnCustormerControl'><select id='selCustormer' runat="server" keepdefaultstyle='true' datavaluefield='Keyid' datatextfield='CompanyName' onchange='custormerChange(this)' class='Sreq w120px' SelInputHtml='True'  sign="" msg="请选择软件"></select>
                    </span>
                    <input type='hidden' runat="server" id='txtCompanyName' />
                </td>
            </tr>
            <tr>
                <td class="ali03 w100px">
                    业务经理:
                </td>
                <td>
                    <select id='selBusinessManagers' runat="server" class="w120px" keepdefaultstyle='true' datavaluefield="Keyid" datatextfield='Name'>
                    </select>
                </td>
                <td class="ali03 w100px">
                    客户经理:
                </td>
                <td>
                    <select id='selCustormerManagers' runat="server" class="w120px" keepdefaultstyle='true' datavaluefield="Keyid" datatextfield='Name'>
                    </select>
                </td>
                <td class="ali03 w100px">
                    客户级别:
                </td>
                <td>
                    <select id='txtDegreeImportanId' class='Sreq w120px' msg="请选择客户级别" runat="server" datatextfield="Name" datavaluefield="Keyid" keepdefaultstyle='true'>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="ali03 w100px">
                    联系人:
                </td>
                <td>
                    <input id="txtMKMdG" type="text" class="w120px" runat="server" />
                </td>
                <td class="ali03 w100px">
                    联系电话:
                </td>
                <td>
                    <input id="txtMobile" type="text" class="w120px" runat="server" />
                </td>
                <td class="ali03 w100px">
                    联系QQ:
                </td>
                <td>
                    <input id="txtQQ" type="text" class="w120px" runat="server"/>
                </td>
            </tr>
            <tr>
                <td class="ali03 w100px">
                    备注:
                </td>
                <td colspan="5" >
                    <textarea id="txtOrderRemark" runat="server" style=" width:640px; height:50px;" maxlength="200" ></textarea>
                </td>
            </tr>
            <tr>
                <td colspan="6" style="text-align: center;">
                    <asp:Button ID="btn_submit" runat="server" OnClick="btn_submit_form" Text="提交" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>