username@email.com
2024-12-24 a0d38325a97957b37dd755bf732b63f6f7e2a5ff
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
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProcurementEdit.aspx.cs" Inherits="CY.WebForm.Pages.procurement.ProcurementEdit" %>
 
<!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="tableStyle1" style=" width:98%;">
        <tr>
            <td class="ali03  w100px">
                货品类别:
            </td>
            <td>
                <asp:DropDownList runat="server" ID="dwCommity" class="Sreq w120px" AutoPostBack="true" keepDefaultStyle="true" OnSelectedIndexChanged="dwCommity_SelectedIndexChanged" msg="请选择货品类别">
                </asp:DropDownList>
            </td>
            <td class="ali03  w100px">
                供应商:
            </td>
            <td>
                <select id="selSuppliers" runat="server" class="w160px" datatextfield="Name" keepdefaultstyle="true" datavaluefield="Keyid" msg="请选择供应商">
                </select>
            </td>
            
        </tr>
        <tr>
            <td class="ali03 w100px">
                货品名称:
            </td>
            <td>
                <asp:DropDownList runat="server" ID="dwGoodsList" class="Sreq w120px" AutoPostBack="true" keepDefaultStyle="true" OnSelectedIndexChanged="dwGoodsList_SelectedIndexChanged" msg="请选择货品名称">
                </asp:DropDownList>
            </td>
            <td class="ali03 ">
                货品品牌:
            </td>
            <td>
                <asp:DropDownList runat="server" ID="dwBrand" class="Sreq w120px" AutoPostBack="false" keepDefaultStyle="true" msg="请选择货品品牌">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="ali03 ">
                货品规格:
            </td>
            <td>
                <asp:DropDownList runat="server" ID="dwSpecification" class="Sreq w120px" AutoPostBack="false" keepDefaultStyle="true" msg="请选择货品规格">
                </asp:DropDownList>
            </td>
            <asp:Panel ID="div_td" runat="server">
                <td class="ali03 w100px" runat="server" id="trWeight">
                    纸张克重:
                </td>
                <td>
                    <asp:DropDownList runat="server" ID="dwPaperWeight" class="Sreq w120px" AutoPostBack="false" keepDefaultStyle="true" msg="请选择纸张克重">
                    </asp:DropDownList>
                </td>
            </asp:Panel>
            <asp:Panel ID="div_td1" runat="server">
            </asp:Panel>
        </tr>
        <tr>
            <td class="ali03 ">
                采购数量:
            </td>
            <td>
                <input type="text" runat="server" class="req int w120px" id="txtQuantity"  msg="请填写采购数量"/>
            </td>
            <td class="ali03 ">
                单价(元):
            </td>
            <td>
                <input type="text" runat="server" class="req float w120px" id="txtPrice"  msg="请填写单价"/>
            </td>
            
        </tr>
        <tr>
            <asp:Panel ID="tanDiv" runat="server">
                <td class="ali03 ">
                    吨价(元):
                </td>
                <td>
                    <input type="text" runat="server" class=" float w120px" id="txtTenPrice"  msg="请填写吨价"/>
                </td>
            </asp:Panel>
            <td class="ali03 ">
                金额(元):
            </td>
            <td>
                <input type="text" runat="server" class="req float w120px" id="txtAllMoney"  msg="请填写金额"/>
            </td>
            <asp:Panel ID="tanDiv1" runat="server">
            </asp:Panel>
        </tr>
         <tr>
                    <td class="ali03">
                        备注:
                    </td>
                    <td colspan="5">
                        <textarea id="txtRemark" runat="server" style="width: 460px; height: 40px;"></textarea>
                    </td>
                </tr>
        <tr>
            <td colspan="6" 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").val();
                    var PaperWeight = parseFloat($("#dwPaperWeight  option:selected").text());
                    var aa = (Width * Height * PaperWeight * TenPrice / 1000000000000).toFixed(4);
                    if (isNaN(aa)) {
                        $("#txtPrice").val(0);
                    }
                    else {
                        $("#txtPrice").val(aa);
                        var quantity = parseFloat($("#txtQuantity").val());
                        if (isNaN(quantity)) {
                            $("#txtAllMoney").val("0");
                        }
                        else {
                            var eda = (aa * 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>