sale-client 4.2.14 → 4.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -56,11 +56,16 @@
|
|
|
56
56
|
value.stairEndDate = `'${a.data.stairEndDate}'`
|
|
57
57
|
let jt = a.data.chargeprice.length
|
|
58
58
|
if (jt > 1) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
// 转换为数字进行比较,避免字符串比较问题
|
|
60
|
+
const sumAmount = parseFloat(value.sumamount)
|
|
61
|
+
const stair1Ceiling = parseFloat(value.f_stair1ceiling)
|
|
62
|
+
const stair2Ceiling = parseFloat(value.f_stair2ceiling)
|
|
63
|
+
const stair3Ceiling = parseFloat(value.f_stair3ceiling)
|
|
64
|
+
value.f_hasuse1 = (sumAmount >= stair1Ceiling ? stair1Ceiling : sumAmount).toFixed(4)
|
|
65
|
+
value.f_hasuse2 = (sumAmount >= stair2Ceiling ? stair2Ceiling - stair1Ceiling : sumAmount - stair1Ceiling).toFixed(4)
|
|
66
|
+
value.f_hasuse3 = (sumAmount >= stair3Ceiling ? stair3Ceiling - stair2Ceiling : sumAmount - stair2Ceiling).toFixed(4)
|
|
67
|
+
if (parseFloat(value.f_hasuse2) < 0) value.f_hasuse2 = 0
|
|
68
|
+
if (parseFloat(value.f_hasuse3) < 0) value.f_hasuse3 = 0
|
|
64
69
|
} else {
|
|
65
70
|
let parm1 = {
|
|
66
71
|
items: 'f_pregas',
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<validator name='v'>
|
|
9
9
|
<form class="form-horizontal select-overspread">
|
|
10
10
|
<div class="row" style="display: flex;justify-content: center;" id='reissue-bill'>
|
|
11
|
-
|
|
11
|
+
<div v-html="bill.data"></div>
|
|
12
12
|
</div>
|
|
13
13
|
<div class="row" v-if="config.hasBillManage">
|
|
14
14
|
<div v-if="!messShow">
|
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
v-model="model.f_bill_type"
|
|
58
58
|
:options='printtypes'
|
|
59
59
|
placeholder='请选择'
|
|
60
|
-
v-model="model.f_bill_type"
|
|
61
60
|
@change="useTypeChange"
|
|
62
61
|
:value-single="true"
|
|
63
62
|
close-on-select v-ref:billtype>
|
|
@@ -73,7 +72,6 @@
|
|
|
73
72
|
v-model="model.f_use_type"
|
|
74
73
|
:options='usetypes'
|
|
75
74
|
placeholder='请选择'
|
|
76
|
-
v-model="model.f_use_type"
|
|
77
75
|
@change="useTypeChange"
|
|
78
76
|
:value-single="true"
|
|
79
77
|
close-on-select v-ref:usetype>
|
|
@@ -209,11 +207,17 @@
|
|
|
209
207
|
let jt = a.data.chargeprice.length
|
|
210
208
|
console.log('value', value)
|
|
211
209
|
if (jt > 1) {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
210
|
+
// 转换为数字进行比较,避免字符串比较问题
|
|
211
|
+
const sumAmount = parseFloat(value.sumamount)
|
|
212
|
+
const stair1Ceiling = parseFloat(value.f_stair1ceiling)
|
|
213
|
+
const stair2Ceiling = parseFloat(value.f_stair2ceiling)
|
|
214
|
+
const stair3Ceiling = parseFloat(value.f_stair3ceiling)
|
|
215
|
+
value.f_hasuse1 = (sumAmount >= stair1Ceiling ? stair1Ceiling : sumAmount).toFixed(4)
|
|
216
|
+
value.f_hasuse2 = (sumAmount >= stair2Ceiling ? stair2Ceiling - stair1Ceiling : sumAmount - stair1Ceiling).toFixed(4)
|
|
217
|
+
value.f_hasuse3 = (sumAmount >= stair3Ceiling ? stair3Ceiling - stair2Ceiling : sumAmount - stair2Ceiling).toFixed(4)
|
|
218
|
+
if (parseFloat(value.f_hasuse2) < 0) value.f_hasuse2 = 0
|
|
219
|
+
if (parseFloat(value.f_hasuse3) < 0) value.f_hasuse3 = 0
|
|
220
|
+
console.log('111value', value)
|
|
217
221
|
} else {
|
|
218
222
|
let parm1 = {
|
|
219
223
|
items: 'f_pregas',
|
|
@@ -228,10 +232,33 @@
|
|
|
228
232
|
value.f_stair2price = 0
|
|
229
233
|
value.f_stair3price = 0
|
|
230
234
|
}
|
|
231
|
-
|
|
232
235
|
billParam = Object.assign(billParam, value)
|
|
233
236
|
}
|
|
234
|
-
|
|
237
|
+
// 确保所有参数值都是合法的JavaScript表达式
|
|
238
|
+
const sanitizeParams = (params) => {
|
|
239
|
+
const sanitized = {}
|
|
240
|
+
for (const [key, val] of Object.entries(params)) {
|
|
241
|
+
if (typeof val === 'string' && val.startsWith("'") && val.endsWith("'")) {
|
|
242
|
+
// 字符串参数,保持原样
|
|
243
|
+
sanitized[key] = val
|
|
244
|
+
} else if (typeof val === 'number' || typeof val === 'boolean') {
|
|
245
|
+
// 数值和布尔值,转换为字符串
|
|
246
|
+
sanitized[key] = val.toString()
|
|
247
|
+
} else if (val === null || val === undefined) {
|
|
248
|
+
// null 或 undefined,转换为空字符串
|
|
249
|
+
sanitized[key] = "''"
|
|
250
|
+
} else if (typeof val === 'object') {
|
|
251
|
+
// 对象,转换为JSON字符串
|
|
252
|
+
sanitized[key] = `'${JSON.stringify(val)}'`
|
|
253
|
+
} else {
|
|
254
|
+
// 其他情况,转换为字符串
|
|
255
|
+
sanitized[key] = `'${String(val)}'`
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return sanitized
|
|
259
|
+
}
|
|
260
|
+
const safeBillParam = sanitizeParams(billParam)
|
|
261
|
+
self.bill = new DataModel(self.data.billUrl, safeBillParam, 'af-revenue')
|
|
235
262
|
await self.bill.search(self.data.id)
|
|
236
263
|
// self.bill.data = '我是补打发票'
|
|
237
264
|
await getBillGen(self)
|