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
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OutOfStorageEdit.aspx.cs" Inherits="CY.WebForm.Pages.procurement.OutOfStorageEdit" %>
 
<!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 runat="server">
    <title>产品入库信息编辑</title>
    <uc:CMSHead ID="CMSHead1" runat="server" />
</head>
<body>
    <form runat="server" id="form1" class="form2">
    <table class="tableStyle">
        <tr>
            <td class="ali03 ">
                所在仓库:
            </td>
            <td>
                <asp:DropDownList runat="server" ID="dwWarehouse" class="Sreq" keepDefaultStyle="true" msg="所在仓库不能为空">
                </asp:DropDownList>
            </td>
            <td class="ali03 ">
                货品类别:
            </td>
            <td>
                <asp:DropDownList runat="server" ID="dwCommity" class="Sreq" AutoPostBack="true" keepDefaultStyle="true" OnSelectedIndexChanged="dwCommity_SelectedIndexChanged" msg="货品类别不能为空">
                </asp:DropDownList>
            </td>
            <td class="ali03 w100px">
                货品名称:
            </td>
            <td>
                <asp:DropDownList runat="server" ID="dwGoodsList" class="Sreq" AutoPostBack="true" keepDefaultStyle="true" OnSelectedIndexChanged="dwGoodsList_SelectedIndexChanged" msg="货品名称不能为空">
                </asp:DropDownList>
            </td>
            <div id="div_none" runat="server">
                <td>
                </td>
                <td>
                </td>
            </div>
        </tr>
        <tr>
            <td class="ali03 ">
                供应商:
            </td>
            <td>
                <select id="selSuppliers" runat="server" class="Sreq" datatextfield="Name" keepdefaultstyle="true" datavaluefield="Keyid" msg="供应商不能为空">
                </select>
            </td>
            <td class="ali03 ">
                货品品牌:
            </td>
            <td>
                <asp:DropDownList runat="server" ID="dwBrand" class="Sreq" AutoPostBack="false" keepDefaultStyle="true" msg="货品品牌不能为空">
                </asp:DropDownList>
            </td>
            <td class="ali03 ">
                货品规格:
            </td>
            <td>
                <asp:DropDownList runat="server" ID="dwSpecification" class="Sreq" AutoPostBack="false" keepDefaultStyle="true" msg="货品规格不能为空">
                </asp:DropDownList>
            </td>
            <div id="div_td" runat="server">
                <td class="ali03 ">
                    纸张克重:
                </td>
                <td>
                    <asp:DropDownList runat="server" ID="dwPaperWeight" class="Sreq" AutoPostBack="false" keepDefaultStyle="true">
                    </asp:DropDownList>
                </td>
            </div>
        </tr>
        <tr>
            <td class="ali03 ">
                数量:
            </td>
            <td>
                <input type="text" runat="server" class="req int w60px" id="txtQuantity" />
            </td>
            <td class="ali03 ">
                单价(元):
            </td>
            <td>
                <input type="text" runat="server" class="req float w60px" id="txtPrice" />
            </td>
            <div runat="server" id="div_tanPrice">
                <td class="ali03 ">
                    吨价(元):
                </td>
                <td>
                    <input type="text" runat="server" class="req float w80px" id="txtTenPrice" />
                </td>
            </div>
            <td class="ali03 ">
                金额(元):
            </td>
            <td>
                <input type="text" runat="server" class="req float w80px" id="txtAllMoney" />
            </td>
        </tr>
        <tr>
            <td colspan="8" align="center">
                <asp:Button runat="server" Text="提交" ID="btn_config" OnClick="btn_config_Click" />
            </td>
        </tr>
    </table>
    </form>
    <script type="text/javascript">
        $(function () {
            $("#dwCommity option").each(function (ii, vv) {
                $(this).html($(this).html().replace(/[.]/g, "&nbsp;&nbsp;"));
            });
 
            GetAllPrice();
 
            $("#txtPrice").blur(function () {
                GetAllPrice();
            });
            $("#txtQuantity").blur(function () {
 
                var price = parseFloat($("#txtPrice").val());
                var quantity = parseFloat($("#txtQuantity").val());
                if (isNaN(price) || isNaN(quantity)) {
                    $("#txtAllMoney").val("0");
                } else {
                    var eda = (price * quantity).toFixed(2);
                    $("#txtAllMoney").val(eda);
                }
            });
 
            $("#txtTenPrice").blur(function () {
                var TenPrice = parseFloat($("#txtTenPrice").val());
                if (!isNaN(TenPrice)) {
                    var PaperSize = $("#dwSpecification  option:selected").text();
                    var PaperSizes = PaperSize.split("*");
                    var Width = PaperSizes[0];
                    var Height = PaperSizes[1];
                    var PaperWeight = $("#dwPaperWeight option:selected").text();
                    var aa = ((Width * Height * PaperWeight * TenPrice) / 1000000000000).toFixed(2);
                    if (isNaN(aa)) {
                        $("#txtPrice").val(0);
                    }
                    else {
                        $("#txtPrice").val(aa);
                    }
                }
                var price = parseFloat($("#txtPrice").val());
                var quantity = parseFloat($("#txtQuantity").val());
                var eda = (price * quantity).toFixed(2);
                $("#txtAllMoney").val(eda);
            });
            function GetAllPrice() {
                var price = parseFloat($("#txtPrice").val());
                if (!isNaN(price)) {
                    var TenPrice = parseFloat($("#txtTenPrice").val());
                    var PaperSize = $("#dwSpecification option:selected").text();
                    var PaperSizes = PaperSize.split("*");
                    var Width = PaperSizes[0];
                    var Height = PaperSizes[1];
                    var quantity = parseFloat($("#txtQuantity").val());
                    var PaperWeight = $("#dwPaperWeight  option:selected").text();
 
                    var aa = (price * 1000000000000 / PaperWeight / Width / Height).toFixed(2);
                    if (isNaN(aa)) {
                        $("#txtTenPrice").val(0);
                    }
                    else {
                        $("#txtTenPrice").val(aa);
                    }
                }
                if (isNaN(price) || isNaN(quantity)) {
                    $("#txtAllMoney").val("0");
                } else {
                    var eda = (price * quantity).toFixed(2);
                    $("#txtAllMoney").val(eda);
                }
            }
        });
    </script>
</body>
</html>