kts-component-invoice-operate 3.2.181-13 → 3.2.181-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/dist/index.esm.js +12 -10
- package/dist/index.js +12 -10
- package/package.json +1 -1
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/autoFillFn/index.ts +5 -5
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/index.tsx +12 -8
- package/src/Invoice/ui/default/ImportGoodsDrawer/index.tsx +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -8946,7 +8946,7 @@ var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
|
|
|
8946
8946
|
}
|
|
8947
8947
|
|
|
8948
8948
|
quantity = format15(values.quantity, calculatingDigits);
|
|
8949
|
-
priceIncludeTax = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(quantity)),
|
|
8949
|
+
priceIncludeTax = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(quantity)), 6);
|
|
8950
8950
|
form.setFieldsValue({
|
|
8951
8951
|
priceIncludeTax: priceIncludeTax
|
|
8952
8952
|
});
|
|
@@ -8965,7 +8965,7 @@ var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
|
|
|
8965
8965
|
break;
|
|
8966
8966
|
}
|
|
8967
8967
|
|
|
8968
|
-
_priceIncludeTax = format15(values.priceIncludeTax,
|
|
8968
|
+
_priceIncludeTax = format15(values.priceIncludeTax, 6);
|
|
8969
8969
|
_quantity3 = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(_priceIncludeTax)), calculatingDigits);
|
|
8970
8970
|
form.setFieldsValue({
|
|
8971
8971
|
quantity: _quantity3
|
|
@@ -9050,7 +9050,7 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
|
|
|
9050
9050
|
}
|
|
9051
9051
|
|
|
9052
9052
|
quantity = format15(values.quantity, calculatingDigits);
|
|
9053
|
-
priceExcludeTax = format15(evaluate("".concat(lineAmountExcludeTax, " / ").concat(quantity)),
|
|
9053
|
+
priceExcludeTax = format15(evaluate("".concat(lineAmountExcludeTax, " / ").concat(quantity)), 6);
|
|
9054
9054
|
form.setFieldsValue({
|
|
9055
9055
|
priceExcludeTax: priceExcludeTax
|
|
9056
9056
|
});
|
|
@@ -9069,7 +9069,7 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
|
|
|
9069
9069
|
break;
|
|
9070
9070
|
}
|
|
9071
9071
|
|
|
9072
|
-
_priceExcludeTax = format15(values.priceExcludeTax,
|
|
9072
|
+
_priceExcludeTax = format15(values.priceExcludeTax, 6);
|
|
9073
9073
|
_quantity4 = format15(evaluate("".concat(lineAmountExcludeTax, " / ").concat(_priceExcludeTax)), calculatingDigits);
|
|
9074
9074
|
form.setFieldsValue({
|
|
9075
9075
|
quantity: _quantity4
|
|
@@ -9354,7 +9354,7 @@ var updateUnitPriceTax = /*#__PURE__*/function () {
|
|
|
9354
9354
|
break;
|
|
9355
9355
|
}
|
|
9356
9356
|
|
|
9357
|
-
priceIncludeTax = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(values.quantity)),
|
|
9357
|
+
priceIncludeTax = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(values.quantity)), 6);
|
|
9358
9358
|
_context11.next = 11;
|
|
9359
9359
|
return controller.setEditGood({
|
|
9360
9360
|
priceIncludeTax: priceIncludeTax
|
|
@@ -14038,9 +14038,10 @@ var useColumns = (function (form) {
|
|
|
14038
14038
|
// callback('请输入单价');
|
|
14039
14039
|
quantity = getFieldValue('quantity');
|
|
14040
14040
|
isQuantityValid = quantity !== undefined && quantity !== null && quantity !== '';
|
|
14041
|
-
isValueValid = value !== undefined && value !== null && value !== '';
|
|
14041
|
+
isValueValid = value !== undefined && value !== null && value !== ''; // if (isValueValid && isQuantityValid) return;
|
|
14042
|
+
// 允许两者都为空
|
|
14042
14043
|
|
|
14043
|
-
if (!(isValueValid && isQuantityValid)) {
|
|
14044
|
+
if (!(!isValueValid && !isQuantityValid)) {
|
|
14044
14045
|
_context9.next = 7;
|
|
14045
14046
|
break;
|
|
14046
14047
|
}
|
|
@@ -14132,9 +14133,10 @@ var useColumns = (function (form) {
|
|
|
14132
14133
|
// callback('请输入单价');
|
|
14133
14134
|
quantity = getFieldValue('quantity');
|
|
14134
14135
|
isQuantityValid = quantity !== undefined && quantity !== null && quantity !== '';
|
|
14135
|
-
isValueValid = value !== undefined && value !== null && value !== '';
|
|
14136
|
+
isValueValid = value !== undefined && value !== null && value !== ''; // if (isValueValid && isQuantityValid) return;
|
|
14137
|
+
// 允许两者都为空
|
|
14136
14138
|
|
|
14137
|
-
if (!(isValueValid && isQuantityValid)) {
|
|
14139
|
+
if (!(!isValueValid && !isQuantityValid)) {
|
|
14138
14140
|
_context10.next = 7;
|
|
14139
14141
|
break;
|
|
14140
14142
|
}
|
|
@@ -27020,7 +27022,7 @@ var DrawerBody$1 = function DrawerBody() {
|
|
|
27020
27022
|
editGood.priceIncludeTax = undefined;
|
|
27021
27023
|
editGood.priceExcludeTax = undefined;
|
|
27022
27024
|
} else {
|
|
27023
|
-
editGood.priceExcludeTax = editGood.priceExcludeTax || getPriceExcludeTax$1(editGood, record,
|
|
27025
|
+
editGood.priceExcludeTax = editGood.priceExcludeTax || getPriceExcludeTax$1(editGood, record, 6);
|
|
27024
27026
|
}
|
|
27025
27027
|
|
|
27026
27028
|
if (editGood.quantity && editGood.priceIncludeTax) {
|
package/dist/index.js
CHANGED
|
@@ -8956,7 +8956,7 @@ var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
|
|
|
8956
8956
|
}
|
|
8957
8957
|
|
|
8958
8958
|
quantity = format15(values.quantity, calculatingDigits);
|
|
8959
|
-
priceIncludeTax = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(quantity)),
|
|
8959
|
+
priceIncludeTax = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(quantity)), 6);
|
|
8960
8960
|
form.setFieldsValue({
|
|
8961
8961
|
priceIncludeTax: priceIncludeTax
|
|
8962
8962
|
});
|
|
@@ -8975,7 +8975,7 @@ var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
|
|
|
8975
8975
|
break;
|
|
8976
8976
|
}
|
|
8977
8977
|
|
|
8978
|
-
_priceIncludeTax = format15(values.priceIncludeTax,
|
|
8978
|
+
_priceIncludeTax = format15(values.priceIncludeTax, 6);
|
|
8979
8979
|
_quantity3 = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(_priceIncludeTax)), calculatingDigits);
|
|
8980
8980
|
form.setFieldsValue({
|
|
8981
8981
|
quantity: _quantity3
|
|
@@ -9060,7 +9060,7 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
|
|
|
9060
9060
|
}
|
|
9061
9061
|
|
|
9062
9062
|
quantity = format15(values.quantity, calculatingDigits);
|
|
9063
|
-
priceExcludeTax = format15(evaluate("".concat(lineAmountExcludeTax, " / ").concat(quantity)),
|
|
9063
|
+
priceExcludeTax = format15(evaluate("".concat(lineAmountExcludeTax, " / ").concat(quantity)), 6);
|
|
9064
9064
|
form.setFieldsValue({
|
|
9065
9065
|
priceExcludeTax: priceExcludeTax
|
|
9066
9066
|
});
|
|
@@ -9079,7 +9079,7 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
|
|
|
9079
9079
|
break;
|
|
9080
9080
|
}
|
|
9081
9081
|
|
|
9082
|
-
_priceExcludeTax = format15(values.priceExcludeTax,
|
|
9082
|
+
_priceExcludeTax = format15(values.priceExcludeTax, 6);
|
|
9083
9083
|
_quantity4 = format15(evaluate("".concat(lineAmountExcludeTax, " / ").concat(_priceExcludeTax)), calculatingDigits);
|
|
9084
9084
|
form.setFieldsValue({
|
|
9085
9085
|
quantity: _quantity4
|
|
@@ -9364,7 +9364,7 @@ var updateUnitPriceTax = /*#__PURE__*/function () {
|
|
|
9364
9364
|
break;
|
|
9365
9365
|
}
|
|
9366
9366
|
|
|
9367
|
-
priceIncludeTax = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(values.quantity)),
|
|
9367
|
+
priceIncludeTax = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(values.quantity)), 6);
|
|
9368
9368
|
_context11.next = 11;
|
|
9369
9369
|
return controller.setEditGood({
|
|
9370
9370
|
priceIncludeTax: priceIncludeTax
|
|
@@ -14048,9 +14048,10 @@ var useColumns = (function (form) {
|
|
|
14048
14048
|
// callback('请输入单价');
|
|
14049
14049
|
quantity = getFieldValue('quantity');
|
|
14050
14050
|
isQuantityValid = quantity !== undefined && quantity !== null && quantity !== '';
|
|
14051
|
-
isValueValid = value !== undefined && value !== null && value !== '';
|
|
14051
|
+
isValueValid = value !== undefined && value !== null && value !== ''; // if (isValueValid && isQuantityValid) return;
|
|
14052
|
+
// 允许两者都为空
|
|
14052
14053
|
|
|
14053
|
-
if (!(isValueValid && isQuantityValid)) {
|
|
14054
|
+
if (!(!isValueValid && !isQuantityValid)) {
|
|
14054
14055
|
_context9.next = 7;
|
|
14055
14056
|
break;
|
|
14056
14057
|
}
|
|
@@ -14142,9 +14143,10 @@ var useColumns = (function (form) {
|
|
|
14142
14143
|
// callback('请输入单价');
|
|
14143
14144
|
quantity = getFieldValue('quantity');
|
|
14144
14145
|
isQuantityValid = quantity !== undefined && quantity !== null && quantity !== '';
|
|
14145
|
-
isValueValid = value !== undefined && value !== null && value !== '';
|
|
14146
|
+
isValueValid = value !== undefined && value !== null && value !== ''; // if (isValueValid && isQuantityValid) return;
|
|
14147
|
+
// 允许两者都为空
|
|
14146
14148
|
|
|
14147
|
-
if (!(isValueValid && isQuantityValid)) {
|
|
14149
|
+
if (!(!isValueValid && !isQuantityValid)) {
|
|
14148
14150
|
_context10.next = 7;
|
|
14149
14151
|
break;
|
|
14150
14152
|
}
|
|
@@ -27030,7 +27032,7 @@ var DrawerBody$1 = function DrawerBody() {
|
|
|
27030
27032
|
editGood.priceIncludeTax = undefined;
|
|
27031
27033
|
editGood.priceExcludeTax = undefined;
|
|
27032
27034
|
} else {
|
|
27033
|
-
editGood.priceExcludeTax = editGood.priceExcludeTax || getPriceExcludeTax$1(editGood, record,
|
|
27035
|
+
editGood.priceExcludeTax = editGood.priceExcludeTax || getPriceExcludeTax$1(editGood, record, 6);
|
|
27034
27036
|
}
|
|
27035
27037
|
|
|
27036
27038
|
if (editGood.quantity && editGood.priceIncludeTax) {
|
package/package.json
CHANGED
|
@@ -284,11 +284,11 @@ export const onChangeLineAmountIncludeTax = lazyFn(
|
|
|
284
284
|
// 是否有数量
|
|
285
285
|
if (!err.quantity && values.quantity) {
|
|
286
286
|
const quantity = format15(values.quantity, calculatingDigits);
|
|
287
|
-
const priceIncludeTax = format15(evaluate(`${lineAmountIncludeTax} / ${quantity}`),
|
|
287
|
+
const priceIncludeTax = format15(evaluate(`${lineAmountIncludeTax} / ${quantity}`), 6);
|
|
288
288
|
form.setFieldsValue({ priceIncludeTax });
|
|
289
289
|
await controller.setEditGood({ priceIncludeTax });
|
|
290
290
|
} else if (!err.priceIncludeTax && (values.priceIncludeTax || values.priceIncludeTax === 0)) {
|
|
291
|
-
const priceIncludeTax = format15(values.priceIncludeTax,
|
|
291
|
+
const priceIncludeTax = format15(values.priceIncludeTax, 6);
|
|
292
292
|
const quantity = format15(evaluate(`${lineAmountIncludeTax} / ${priceIncludeTax}`), calculatingDigits);
|
|
293
293
|
form.setFieldsValue({ quantity });
|
|
294
294
|
await controller.setEditGood({ quantity });
|
|
@@ -324,11 +324,11 @@ export const onChangeLineAmountExcludeTax = lazyFn(
|
|
|
324
324
|
// 是否有数量
|
|
325
325
|
if (!err.quantity && values.quantity) {
|
|
326
326
|
const quantity = format15(values.quantity, calculatingDigits);
|
|
327
|
-
const priceExcludeTax = format15(evaluate(`${lineAmountExcludeTax} / ${quantity}`),
|
|
327
|
+
const priceExcludeTax = format15(evaluate(`${lineAmountExcludeTax} / ${quantity}`), 6);
|
|
328
328
|
form.setFieldsValue({ priceExcludeTax });
|
|
329
329
|
await controller.setEditGood({ priceExcludeTax });
|
|
330
330
|
} else if (!err.priceExcludeTax && values.priceExcludeTax) {
|
|
331
|
-
const priceExcludeTax = format15(values.priceExcludeTax,
|
|
331
|
+
const priceExcludeTax = format15(values.priceExcludeTax, 6);
|
|
332
332
|
const quantity = format15(evaluate(`${lineAmountExcludeTax} / ${priceExcludeTax}`), calculatingDigits);
|
|
333
333
|
form.setFieldsValue({ quantity });
|
|
334
334
|
await controller.setEditGood({ quantity });
|
|
@@ -491,7 +491,7 @@ export const updateUnitPriceTax = async (controller: InvoiceController, form: Wr
|
|
|
491
491
|
// 单价(含税) = 金额(含税) / (數量)
|
|
492
492
|
// 是否有数量
|
|
493
493
|
if (!err.quantity && values.quantity) {
|
|
494
|
-
const priceIncludeTax = format15(evaluate(`${lineAmountIncludeTax} / ${values.quantity}`),
|
|
494
|
+
const priceIncludeTax = format15(evaluate(`${lineAmountIncludeTax} / ${values.quantity}`), 6);
|
|
495
495
|
await controller.setEditGood({ priceIncludeTax });
|
|
496
496
|
}
|
|
497
497
|
|
|
@@ -326,9 +326,9 @@ export default (form: WrappedFormUtils) => {
|
|
|
326
326
|
...getReplenishRules('priceIncludeTax'),
|
|
327
327
|
// { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '单价必须为数字' },
|
|
328
328
|
// { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '金额必须为数字' },
|
|
329
|
-
{
|
|
330
|
-
pattern: /^[+-]?(0|([1-9]\d*))(\.\d{1,6})?$/,
|
|
331
|
-
message: '单价必须为数字且最多保留6位小数'
|
|
329
|
+
{
|
|
330
|
+
pattern: /^[+-]?(0|([1-9]\d*))(\.\d{1,6})?$/,
|
|
331
|
+
message: '单价必须为数字且最多保留6位小数'
|
|
332
332
|
},
|
|
333
333
|
{
|
|
334
334
|
validator: async (_, value, callback) => {
|
|
@@ -341,7 +341,9 @@ export default (form: WrappedFormUtils) => {
|
|
|
341
341
|
const isQuantityValid = quantity !== undefined && quantity !== null && quantity !== '';
|
|
342
342
|
const isValueValid = value !== undefined && value !== null && value !== '';
|
|
343
343
|
|
|
344
|
-
if (isValueValid && isQuantityValid) return;
|
|
344
|
+
// if (isValueValid && isQuantityValid) return;
|
|
345
|
+
// 允许两者都为空
|
|
346
|
+
if (!isValueValid && !isQuantityValid) return;
|
|
345
347
|
|
|
346
348
|
if (!isValueValid) return callback('金额不能为空');
|
|
347
349
|
if (!isQuantityValid) return callback('数量不能为空');
|
|
@@ -382,9 +384,9 @@ export default (form: WrappedFormUtils) => {
|
|
|
382
384
|
rules: [
|
|
383
385
|
...getReplenishRules('priceExcludeTax'),
|
|
384
386
|
// { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '单价必须为数字' },
|
|
385
|
-
{
|
|
386
|
-
pattern: /^[+-]?(0|([1-9]\d*))(\.\d{1,6})?$/,
|
|
387
|
-
message: '单价必须为数字且最多保留6位小数'
|
|
387
|
+
{
|
|
388
|
+
pattern: /^[+-]?(0|([1-9]\d*))(\.\d{1,6})?$/,
|
|
389
|
+
message: '单价必须为数字且最多保留6位小数'
|
|
388
390
|
},
|
|
389
391
|
{
|
|
390
392
|
validator: async (_, value, callback) => {
|
|
@@ -397,7 +399,9 @@ export default (form: WrappedFormUtils) => {
|
|
|
397
399
|
const isQuantityValid = quantity !== undefined && quantity !== null && quantity !== '';
|
|
398
400
|
const isValueValid = value !== undefined && value !== null && value !== '';
|
|
399
401
|
|
|
400
|
-
if (isValueValid && isQuantityValid) return;
|
|
402
|
+
// if (isValueValid && isQuantityValid) return;
|
|
403
|
+
// 允许两者都为空
|
|
404
|
+
if (!isValueValid && !isQuantityValid) return;
|
|
401
405
|
|
|
402
406
|
if (!isValueValid) return callback('金额不能为空');
|
|
403
407
|
if (!isQuantityValid) return callback('数量不能为空');
|
|
@@ -112,7 +112,7 @@ const DrawerBody = () => {
|
|
|
112
112
|
editGood.priceIncludeTax = undefined;
|
|
113
113
|
editGood.priceExcludeTax = undefined;
|
|
114
114
|
} else {
|
|
115
|
-
editGood.priceExcludeTax = editGood.priceExcludeTax || getPriceExcludeTax(editGood, record,
|
|
115
|
+
editGood.priceExcludeTax = editGood.priceExcludeTax || getPriceExcludeTax(editGood, record, 6) as number;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
if (editGood.quantity && editGood.priceIncludeTax) {
|