demo_b.html
8.73 KB
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
HTTP/1.1 200
Server: nginx/1.14.2
Date: Tue, 10 Aug 2021 07:09:53 GMT
Content-Type: text/html;charset=UTF-8
Connection: keep-alive
Access-Control-Expose-Headers: UAP_accessToken
Cache-Control: no-store
Content-Language: zh-CN
Content-Length: 8695
<style>
.table-chrgeitem td,
.table-chrgeitem th {
padding: .5rem .45rem;
height: auto;
}
</style>
<input type="hidden" id="marketFlag" name="marketFlag" value="sy">
<input type="hidden" id="goodsAllocationText" value="无">
<input type="hidden" id="checkItemAllZero" value="1">
<input type="hidden" id="itemFee" value="交易管理费:¥5.00 检测费:¥3.00 ">
<input type="hidden" id="receivedInWords" value="捌元整">
<input type="hidden" id="e" value="">
<input type="hidden" id="ctotal" value="8.00">
<input type="hidden" id="creceivable" value="13.00">
<input type="hidden" id="cdiscount" value="5.00">
<input type="hidden" id="ctotalLong" name="totalMoney" value="800">
<input type="hidden" id="creceivableLong" name="receivable" value="1300">
<input type="hidden" id="ccollectionLong" name="collectionPrice" value="0">
<input type="hidden" id="discountAmountLong" name="discountAmount" value="500">
<input type="hidden" id="handReceivableAmountLong" name="handReceivableAmount" value="0">
<input type="hidden" id="itemReceivableAmountLong" name="itemReceivableAmount" value="1300">
<input type="hidden" id="correctDiscount" name="correctDiscount" value="1">
<table class="table table-hover table-bordered mt-2 table-chrgeitem">
<tr class="row px-3">
<th class="col-3">收费项目应收<span id="gz-tag" style="display: none;color: red;">【已更正】</span></th>
<th class="col-3">收费项目优惠1</th>
<th class="col-3">收费项目优惠2</th>
<th class="col-3">收费项目实收</th>
</tr>
<input type="hidden" name="billItems" value=''>
<input type="hidden" name="billItemsDic" value=''>
<tr class="row px-3">
<td class="col-3">
<div class="itemwrap row">
<div class="col-auto item chargeitem">
<div class="form-group">
<div class="d-flex align-items-center">
<input type="checkbox" name="billItemCheckIds" value="103" data-name="交易管理费"
data-req="1" checked readonly onclick="return false">
<div class="input-group-prepend">
交易管理费:
</div>
<input type="text" title="规则ID:615,规则名:交易管理" class="form-control fees bold"
name="103" maxlength="15" data-old="10.00"
data-old-receivable="1000" value="10.00" readonly>
<input type="hidden" name="billItems" value='{"discount":500,"id":103,"name":"交易管理费","receivable":1000,"require":1}'>
</div>
</div>
</div>
</div>
</td>
<td class="col-3">
<div class="itemwrap row">
<div class="col-auto item offeritem red" data-req="0">
<div class="form-group">
<div class="d-flex align-items-center">
<input type="checkbox" name="billItemDicCheckIds" value="105" data-req="0"
checked>
<div class="input-group-prepend">
优惠收费:
</div>
<input type="text" 规则ID:619,规则名:卡账户匹配 class="form-control fees bold"
value="-5.00" readonly>
<input type="hidden" name="billItemsDic" value='{"discount":0,"id":105,"name":"优惠收费","receivable":500,"require":0}'>
</div>
</div>
</div>
</div>
</td>
<td class="col-3">
<div class="itemwrap row">
<div class="col-auto item offeritem" >
<div class="form-group">
<div class="d-flex align-items-center">
返点的钱 :
<input type="text" class="form-control fees bold"
value="0.00" readonly>
</div>
</div>
</div>
</div>
</td>
<td class="col-3">
<span class="bold singleRealfee">5.00</span>
</td>
</tr>
<tr class="row px-3">
<td class="col-3">
<div class="itemwrap row">
<div class="col-auto item chargeitem">
<div class="form-group">
<div class="d-flex align-items-center">
<input type="checkbox" name="billItemCheckIds" value="106" data-name="检测费"
data-req="1" checked readonly onclick="return false">
<div class="input-group-prepend">
检测费:
</div>
<input type="text" title="规则ID:499,规则名:固定检测费" class="form-control fees bold"
name="106" maxlength="15" data-old="3.00"
data-old-receivable="300" value="3.00" readonly>
<input type="hidden" name="billItems" value='{"discount":0,"id":106,"name":"检测费","receivable":300,"require":1}'>
</div>
</div>
</div>
</div>
</td>
<td class="col-3">
<div class="itemwrap row">
</div>
</td>
<td class="col-3">
<div class="itemwrap row">
<div class="col-auto item offeritem" >
</div>
</div>
</td>
<td class="col-3">
<span class="bold singleRealfee">3.00</span>
</td>
</tr>
</table>
<script>
$(function () {
/* 可选项的收费项目才能选择优惠项目 */
$('#feeitemedit .chargeitem [data-req="-1"]').each(function () {
// offeritem所有优惠项目,offeritemReq必填优惠项目
var offeritem = $(this).closest('tr').find('.offeritem :checkbox');
var offeritemReq = $(this).closest('tr').find('.offeritem [data-req="1"]');
if ($(this).is(':checked')) {
offeritem.not(offeritemReq).attr('disabled', false);
offeritemReq.prop('checked', true);
} else {
offeritem.not(offeritemReq).attr('disabled', true);
offeritem.prop('checked', false);
}
})
var uItem = $("#updateFeeItems").val();
if (uItem == 2) {
$("#gz-tag").show();
}
})
$('#feeitemedit :checkbox').change(function () {
calculate();
})
// 收费项目金额千位分隔符四舍五入显示2位小数.00
$('#feeitemedit .chargeitem .fees').on('blur', function () {
var old = $(this).attr("data-old");
var now = $(this).val();
//console.log("old:"+old+",new:"+now);
if (old == now) {
//没有变动
//console.log("没有变动old:"+old+",new:"+now);
return;
}
var fees = parseFloat($(this).val().replace(/[^\d\.]/g, ''));
var feesThousand;
if (fees === '' || isNaN(fees) || fees < 0) {
fees = 0
$(this).val('0.00')
} else {
fees = Math.round(fees).toFixed(2);
feesThousand = fees.replace(/(\d{1,3})(?=(\d{3})+(?:$|\.))/g, "$1,");
$(this).val(feesThousand)
}
var price = new Number(fees);
var temp1 = new Number(100);
var receivable = price.mul(temp1);
var old = $(this).attr("data-old-receivable");
if (old == receivable) {
//没有变动
//console.log("没有变动old:"+old+",new:"+receivable);
return;
}
var info = $(this).siblings()[0];
var req = $(info).attr("data-req");
var dateid = $(info).val();
var itemName = $(info).attr("data-name");
var feeItemParamHtml = new Object();
feeItemParamHtml.id = dateid;
feeItemParamHtml.name = itemName;
feeItemParamHtml.require = req;
feeItemParamHtml.receivable = receivable;
var result = JSON.stringify(feeItemParamHtml);
$(this).next().val(result);
if ($("#correctInfo").val() == 2) {
$("#updateFeeItems").val(2);
}
calculate();
})
</script>