kts-component-invoice-operate 3.0.16 → 3.0.18
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/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.d.ts +4 -0
- package/dist/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.d.ts +1 -1
- package/dist/index.esm.js +129 -130
- package/dist/index.js +129 -130
- package/package.json +1 -1
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.ts +6 -0
- package/src/Invoice/ui/EndowCodeDrawer/index.tsx +0 -39
- package/src/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.ts +32 -26
- package/src/Invoice/ui/GoodsList/hook/useColumns/index.tsx +1 -0
- package/src/Invoice/ui/GoodsList/ui/Statistics/index.tsx +8 -0
|
@@ -41,6 +41,10 @@ export default class GoodsListState {
|
|
|
41
41
|
goodsMap: Map<string, IGood>;
|
|
42
42
|
/** 货物菜单扩展 */
|
|
43
43
|
goodsMenuExpand: ((index: string, controller: InvoiceController) => React.ReactNode)[];
|
|
44
|
+
/** 金额含税(受控,输入后不再自动计算) */
|
|
45
|
+
amountIncludeTax?: number;
|
|
46
|
+
/** 金额不含税(受控,输入后不再自动计算) */
|
|
47
|
+
amountExcludeTax?: number;
|
|
44
48
|
/** 列表选中的货物索引列表 */
|
|
45
49
|
selectedGoodIndex: string[];
|
|
46
50
|
/** 准备添加折扣的货物索引列表 */
|
|
@@ -18,7 +18,7 @@ export declare const onChangeLineAmountIncludeTax: (...par: any[]) => void;
|
|
|
18
18
|
/** 金额(不含税) */
|
|
19
19
|
export declare const onChangeLineAmountExcludeTax: (...par: any[]) => void;
|
|
20
20
|
/** 税率 */
|
|
21
|
-
export declare const onChangeTaxRate: (
|
|
21
|
+
export declare const onChangeTaxRate: (...par: any[]) => void;
|
|
22
22
|
/** 小规模纳税人 1% 和 3% 自动赋码免税 */
|
|
23
23
|
export declare function dutyFree(controller: InvoiceController, taxRate: number, form: WrappedFormUtils<any>, record: IGood): number | undefined;
|
|
24
24
|
/** 含税 => 更新(不含税) */
|
package/dist/index.esm.js
CHANGED
|
@@ -1001,6 +1001,8 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
|
|
|
1001
1001
|
this.goodsList = [];
|
|
1002
1002
|
this.goodsMap = new Map();
|
|
1003
1003
|
this.goodsMenuExpand = [];
|
|
1004
|
+
this.amountIncludeTax = void 0;
|
|
1005
|
+
this.amountExcludeTax = void 0;
|
|
1004
1006
|
this.selectedGoodIndex = [];
|
|
1005
1007
|
this.discountGoodIndex = [];
|
|
1006
1008
|
this.endowCode = new EndowCode();
|
|
@@ -1948,6 +1950,10 @@ var Statistics = (function () {
|
|
|
1948
1950
|
var lineAmountIncludeTax = controller.useMemo(function (s) {
|
|
1949
1951
|
var _s$goodsListState$for, _s$goodsListState$for2;
|
|
1950
1952
|
|
|
1953
|
+
if (typeof s.goodsListState.amountIncludeTax === 'number') {
|
|
1954
|
+
return s.goodsListState.amountIncludeTax;
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1951
1957
|
var sum = chain$1(bignumber(0));
|
|
1952
1958
|
var editGood = s.goodsListState.editGood; // 正在编辑的货物
|
|
1953
1959
|
|
|
@@ -1968,6 +1974,10 @@ var Statistics = (function () {
|
|
|
1968
1974
|
var lineAmountExcludeTax = controller.useMemo(function (s) {
|
|
1969
1975
|
var _s$goodsListState$for3, _s$goodsListState$for4;
|
|
1970
1976
|
|
|
1977
|
+
if (typeof s.goodsListState.amountExcludeTax === 'number') {
|
|
1978
|
+
return s.goodsListState.amountExcludeTax;
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1971
1981
|
var sum = chain$1(bignumber(0));
|
|
1972
1982
|
var editGood = s.goodsListState.editGood; // 正在编辑的货物
|
|
1973
1983
|
|
|
@@ -8957,26 +8967,26 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
|
|
|
8957
8967
|
}, 1000);
|
|
8958
8968
|
/** 税率 */
|
|
8959
8969
|
|
|
8960
|
-
var onChangeTaxRate = function
|
|
8970
|
+
var onChangeTaxRate = lazyFn(function (controller, form, record) {
|
|
8961
8971
|
form.validateFields( /*#__PURE__*/function () {
|
|
8962
|
-
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
8972
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(err, values) {
|
|
8963
8973
|
var taxRate;
|
|
8964
|
-
return _regeneratorRuntime().wrap(function
|
|
8974
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
8965
8975
|
while (1) {
|
|
8966
|
-
switch (
|
|
8976
|
+
switch (_context12.prev = _context12.next) {
|
|
8967
8977
|
case 0:
|
|
8968
8978
|
err = err || {};
|
|
8969
8979
|
|
|
8970
8980
|
if (!(promptErr(err.taxRate) || !values.taxRate && values.taxRate !== 0)) {
|
|
8971
|
-
|
|
8981
|
+
_context12.next = 3;
|
|
8972
8982
|
break;
|
|
8973
8983
|
}
|
|
8974
8984
|
|
|
8975
|
-
return
|
|
8985
|
+
return _context12.abrupt("return");
|
|
8976
8986
|
|
|
8977
8987
|
case 3:
|
|
8978
8988
|
taxRate = parseFloat(values.taxRate);
|
|
8979
|
-
|
|
8989
|
+
_context12.next = 6;
|
|
8980
8990
|
return controller.setEditGood({
|
|
8981
8991
|
taxRate: taxRate
|
|
8982
8992
|
});
|
|
@@ -9000,21 +9010,43 @@ var onChangeTaxRate = function onChangeTaxRate(controller, form, record) {
|
|
|
9000
9010
|
updateUnitPriceExcludingTax(controller, form);
|
|
9001
9011
|
} else {
|
|
9002
9012
|
updateUnitPriceTax(controller, form);
|
|
9003
|
-
}
|
|
9013
|
+
} // 清楚 计算中启动字段
|
|
9014
|
+
|
|
9015
|
+
|
|
9016
|
+
controller.run( /*#__PURE__*/function () {
|
|
9017
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(s) {
|
|
9018
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
9019
|
+
while (1) {
|
|
9020
|
+
switch (_context11.prev = _context11.next) {
|
|
9021
|
+
case 0:
|
|
9022
|
+
return _context11.abrupt("return", s.calculating = '');
|
|
9023
|
+
|
|
9024
|
+
case 1:
|
|
9025
|
+
case "end":
|
|
9026
|
+
return _context11.stop();
|
|
9027
|
+
}
|
|
9028
|
+
}
|
|
9029
|
+
}, _callee11);
|
|
9030
|
+
}));
|
|
9031
|
+
|
|
9032
|
+
return function (_x18) {
|
|
9033
|
+
return _ref12.apply(this, arguments);
|
|
9034
|
+
};
|
|
9035
|
+
}());
|
|
9004
9036
|
|
|
9005
|
-
case
|
|
9037
|
+
case 9:
|
|
9006
9038
|
case "end":
|
|
9007
|
-
return
|
|
9039
|
+
return _context12.stop();
|
|
9008
9040
|
}
|
|
9009
9041
|
}
|
|
9010
|
-
},
|
|
9042
|
+
}, _callee12);
|
|
9011
9043
|
}));
|
|
9012
9044
|
|
|
9013
9045
|
return function (_x16, _x17) {
|
|
9014
9046
|
return _ref11.apply(this, arguments);
|
|
9015
9047
|
};
|
|
9016
9048
|
}());
|
|
9017
|
-
};
|
|
9049
|
+
}, 1000);
|
|
9018
9050
|
/** 小规模纳税人 1% 和 3% 自动赋码免税 */
|
|
9019
9051
|
|
|
9020
9052
|
function dutyFree(controller, taxRate, form, record) {
|
|
@@ -9050,11 +9082,11 @@ function dutyFree(controller, taxRate, form, record) {
|
|
|
9050
9082
|
|
|
9051
9083
|
var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controller, form, record) {
|
|
9052
9084
|
form.validateFields( /*#__PURE__*/function () {
|
|
9053
|
-
var
|
|
9085
|
+
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(err, values) {
|
|
9054
9086
|
var taxAmount, lineAmountExcludeTax, priceExcludeTax, deduction;
|
|
9055
|
-
return _regeneratorRuntime().wrap(function
|
|
9087
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
9056
9088
|
while (1) {
|
|
9057
|
-
switch (
|
|
9089
|
+
switch (_context13.prev = _context13.next) {
|
|
9058
9090
|
case 0:
|
|
9059
9091
|
err = err || {};
|
|
9060
9092
|
/** 税额 */
|
|
@@ -9066,7 +9098,7 @@ var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controlle
|
|
|
9066
9098
|
taxAmount = countTaxAmount(values.lineAmountIncludeTax, deduction, values.taxRate);
|
|
9067
9099
|
}
|
|
9068
9100
|
|
|
9069
|
-
|
|
9101
|
+
_context13.next = 5;
|
|
9070
9102
|
return controller.setEditGood({
|
|
9071
9103
|
taxAmount: taxAmount
|
|
9072
9104
|
});
|
|
@@ -9080,7 +9112,7 @@ var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controlle
|
|
|
9080
9112
|
form.setFieldsValue({
|
|
9081
9113
|
lineAmountExcludeTax: lineAmountExcludeTax
|
|
9082
9114
|
});
|
|
9083
|
-
|
|
9115
|
+
_context13.next = 9;
|
|
9084
9116
|
return controller.setEditGood({
|
|
9085
9117
|
lineAmountExcludeTax: lineAmountExcludeTax
|
|
9086
9118
|
});
|
|
@@ -9094,21 +9126,21 @@ var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controlle
|
|
|
9094
9126
|
form.setFieldsValue({
|
|
9095
9127
|
priceExcludeTax: priceExcludeTax
|
|
9096
9128
|
});
|
|
9097
|
-
|
|
9129
|
+
_context13.next = 13;
|
|
9098
9130
|
return controller.setEditGood({
|
|
9099
9131
|
priceExcludeTax: priceExcludeTax
|
|
9100
9132
|
});
|
|
9101
9133
|
|
|
9102
9134
|
case 13:
|
|
9103
9135
|
case "end":
|
|
9104
|
-
return
|
|
9136
|
+
return _context13.stop();
|
|
9105
9137
|
}
|
|
9106
9138
|
}
|
|
9107
|
-
},
|
|
9139
|
+
}, _callee13);
|
|
9108
9140
|
}));
|
|
9109
9141
|
|
|
9110
|
-
return function (
|
|
9111
|
-
return
|
|
9142
|
+
return function (_x19, _x20) {
|
|
9143
|
+
return _ref13.apply(this, arguments);
|
|
9112
9144
|
};
|
|
9113
9145
|
}());
|
|
9114
9146
|
};
|
|
@@ -9116,35 +9148,35 @@ var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controlle
|
|
|
9116
9148
|
|
|
9117
9149
|
var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
|
|
9118
9150
|
form.validateFields( /*#__PURE__*/function () {
|
|
9119
|
-
var
|
|
9151
|
+
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(err, values) {
|
|
9120
9152
|
var lineAmountExcludeTax, lineAmountIncludeTax, priceIncludeTax, taxAmount;
|
|
9121
|
-
return _regeneratorRuntime().wrap(function
|
|
9153
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
9122
9154
|
while (1) {
|
|
9123
|
-
switch (
|
|
9155
|
+
switch (_context14.prev = _context14.next) {
|
|
9124
9156
|
case 0:
|
|
9125
9157
|
err = err || {};
|
|
9126
9158
|
|
|
9127
9159
|
if (!(!err.taxRat && (values.taxRate || values.taxRate === 0) && !promptErr(err.lineAmountExcludeTax) && (values.lineAmountExcludeTax || values.lineAmountExcludeTax === 0))) {
|
|
9128
|
-
|
|
9160
|
+
_context14.next = 16;
|
|
9129
9161
|
break;
|
|
9130
9162
|
}
|
|
9131
9163
|
|
|
9132
9164
|
// 金额(含税)= 金额(不含税)* (1+ 税率)
|
|
9133
9165
|
lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
|
|
9134
9166
|
lineAmountIncludeTax = format2(evaluate("".concat(lineAmountExcludeTax, " * (1+(").concat(values.taxRate, "/100))")));
|
|
9135
|
-
|
|
9167
|
+
_context14.next = 6;
|
|
9136
9168
|
return controller.setEditGood({
|
|
9137
9169
|
lineAmountIncludeTax: lineAmountIncludeTax
|
|
9138
9170
|
});
|
|
9139
9171
|
|
|
9140
9172
|
case 6:
|
|
9141
9173
|
if (!(!err.quantity && values.quantity)) {
|
|
9142
|
-
|
|
9174
|
+
_context14.next = 10;
|
|
9143
9175
|
break;
|
|
9144
9176
|
}
|
|
9145
9177
|
|
|
9146
9178
|
priceIncludeTax = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(values.quantity)));
|
|
9147
|
-
|
|
9179
|
+
_context14.next = 10;
|
|
9148
9180
|
return controller.setEditGood({
|
|
9149
9181
|
priceIncludeTax: priceIncludeTax
|
|
9150
9182
|
});
|
|
@@ -9155,221 +9187,221 @@ var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
|
|
|
9155
9187
|
form.setFieldsValue({
|
|
9156
9188
|
taxAmount: taxAmount
|
|
9157
9189
|
});
|
|
9158
|
-
|
|
9190
|
+
_context14.next = 14;
|
|
9159
9191
|
return controller.setEditGood({
|
|
9160
9192
|
taxAmount: taxAmount
|
|
9161
9193
|
});
|
|
9162
9194
|
|
|
9163
9195
|
case 14:
|
|
9164
|
-
|
|
9196
|
+
_context14.next = 19;
|
|
9165
9197
|
break;
|
|
9166
9198
|
|
|
9167
9199
|
case 16:
|
|
9168
9200
|
form.setFieldsValue({
|
|
9169
9201
|
taxAmount: undefined
|
|
9170
9202
|
});
|
|
9171
|
-
|
|
9203
|
+
_context14.next = 19;
|
|
9172
9204
|
return controller.setEditGood({
|
|
9173
9205
|
taxAmount: undefined
|
|
9174
9206
|
});
|
|
9175
9207
|
|
|
9176
9208
|
case 19:
|
|
9177
9209
|
case "end":
|
|
9178
|
-
return
|
|
9210
|
+
return _context14.stop();
|
|
9179
9211
|
}
|
|
9180
9212
|
}
|
|
9181
|
-
},
|
|
9213
|
+
}, _callee14);
|
|
9182
9214
|
}));
|
|
9183
9215
|
|
|
9184
|
-
return function (
|
|
9185
|
-
return
|
|
9216
|
+
return function (_x21, _x22) {
|
|
9217
|
+
return _ref14.apply(this, arguments);
|
|
9186
9218
|
};
|
|
9187
9219
|
}());
|
|
9188
9220
|
};
|
|
9189
9221
|
/** 单调赋码 */
|
|
9190
9222
|
|
|
9191
9223
|
var endowCode = /*#__PURE__*/function () {
|
|
9192
|
-
var
|
|
9193
|
-
return _regeneratorRuntime().wrap(function
|
|
9224
|
+
var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(controller, goods) {
|
|
9225
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
9194
9226
|
while (1) {
|
|
9195
|
-
switch (
|
|
9227
|
+
switch (_context17.prev = _context17.next) {
|
|
9196
9228
|
case 0:
|
|
9197
|
-
|
|
9229
|
+
_context17.next = 2;
|
|
9198
9230
|
return controller.wait();
|
|
9199
9231
|
|
|
9200
9232
|
case 2:
|
|
9201
|
-
|
|
9233
|
+
_context17.next = 4;
|
|
9202
9234
|
return controller.saveEditGood();
|
|
9203
9235
|
|
|
9204
9236
|
case 4:
|
|
9205
|
-
|
|
9237
|
+
_context17.next = 6;
|
|
9206
9238
|
return controller.pipeline( /*#__PURE__*/function () {
|
|
9207
|
-
var
|
|
9239
|
+
var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(s) {
|
|
9208
9240
|
var err, key, g, i;
|
|
9209
|
-
return _regeneratorRuntime().wrap(function
|
|
9241
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
9210
9242
|
while (1) {
|
|
9211
|
-
switch (
|
|
9243
|
+
switch (_context16.prev = _context16.next) {
|
|
9212
9244
|
case 0:
|
|
9213
9245
|
if (!s.goodsListState.form) {
|
|
9214
|
-
|
|
9246
|
+
_context16.next = 11;
|
|
9215
9247
|
break;
|
|
9216
9248
|
}
|
|
9217
9249
|
|
|
9218
9250
|
err = s.goodsListState.form.getFieldsError();
|
|
9219
|
-
|
|
9251
|
+
_context16.t0 = _regeneratorRuntime().keys(err);
|
|
9220
9252
|
|
|
9221
9253
|
case 3:
|
|
9222
|
-
if ((
|
|
9223
|
-
|
|
9254
|
+
if ((_context16.t1 = _context16.t0()).done) {
|
|
9255
|
+
_context16.next = 11;
|
|
9224
9256
|
break;
|
|
9225
9257
|
}
|
|
9226
9258
|
|
|
9227
|
-
key =
|
|
9259
|
+
key = _context16.t1.value;
|
|
9228
9260
|
|
|
9229
9261
|
if (err[key]) {
|
|
9230
|
-
|
|
9262
|
+
_context16.next = 7;
|
|
9231
9263
|
break;
|
|
9232
9264
|
}
|
|
9233
9265
|
|
|
9234
|
-
return
|
|
9266
|
+
return _context16.abrupt("continue", 3);
|
|
9235
9267
|
|
|
9236
9268
|
case 7:
|
|
9237
9269
|
message.error(err[key][0]);
|
|
9238
|
-
return
|
|
9270
|
+
return _context16.abrupt("return");
|
|
9239
9271
|
|
|
9240
9272
|
case 11:
|
|
9241
9273
|
g = s.goodsListState.goodsMap.get(goods.$index);
|
|
9242
9274
|
i = s.goodsListState.goodsList.indexOf(g);
|
|
9243
|
-
|
|
9244
|
-
|
|
9275
|
+
_context16.t2 = goods.lineAttribute;
|
|
9276
|
+
_context16.next = _context16.t2 === LineAttributeType$1.正常 ? 16 : _context16.t2 === LineAttributeType$1.折扣行 ? 18 : _context16.t2 === LineAttributeType$1.被折扣行 ? 20 : 22;
|
|
9245
9277
|
break;
|
|
9246
9278
|
|
|
9247
9279
|
case 16:
|
|
9248
9280
|
s.goodsListState.endowCode.endowcodeGoodIndex = [goods.$index];
|
|
9249
|
-
return
|
|
9281
|
+
return _context16.abrupt("break", 22);
|
|
9250
9282
|
|
|
9251
9283
|
case 18:
|
|
9252
9284
|
s.goodsListState.endowCode.endowcodeGoodIndex = [goods.$index, s.goodsListState.goodsList[i - 1].$index];
|
|
9253
|
-
return
|
|
9285
|
+
return _context16.abrupt("break", 22);
|
|
9254
9286
|
|
|
9255
9287
|
case 20:
|
|
9256
9288
|
s.goodsListState.endowCode.endowcodeGoodIndex = [goods.$index, s.goodsListState.goodsList[i + 1].$index];
|
|
9257
|
-
return
|
|
9289
|
+
return _context16.abrupt("break", 22);
|
|
9258
9290
|
|
|
9259
9291
|
case 22:
|
|
9260
9292
|
case "end":
|
|
9261
|
-
return
|
|
9293
|
+
return _context16.stop();
|
|
9262
9294
|
}
|
|
9263
9295
|
}
|
|
9264
|
-
},
|
|
9296
|
+
}, _callee16);
|
|
9265
9297
|
}));
|
|
9266
9298
|
|
|
9267
|
-
return function (
|
|
9268
|
-
return
|
|
9299
|
+
return function (_x27) {
|
|
9300
|
+
return _ref17.apply(this, arguments);
|
|
9269
9301
|
};
|
|
9270
9302
|
}())();
|
|
9271
9303
|
|
|
9272
9304
|
case 6:
|
|
9273
9305
|
case "end":
|
|
9274
|
-
return
|
|
9306
|
+
return _context17.stop();
|
|
9275
9307
|
}
|
|
9276
9308
|
}
|
|
9277
|
-
},
|
|
9309
|
+
}, _callee17);
|
|
9278
9310
|
}));
|
|
9279
9311
|
|
|
9280
|
-
return function endowCode(
|
|
9281
|
-
return
|
|
9312
|
+
return function endowCode(_x25, _x26) {
|
|
9313
|
+
return _ref16.apply(this, arguments);
|
|
9282
9314
|
};
|
|
9283
9315
|
}();
|
|
9284
9316
|
/** 修改了 货物名称 */
|
|
9285
9317
|
|
|
9286
9318
|
var onChangeItemName = /*#__PURE__*/function () {
|
|
9287
|
-
var
|
|
9288
|
-
return _regeneratorRuntime().wrap(function
|
|
9319
|
+
var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(controller, form, record) {
|
|
9320
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
9289
9321
|
while (1) {
|
|
9290
|
-
switch (
|
|
9322
|
+
switch (_context19.prev = _context19.next) {
|
|
9291
9323
|
case 0:
|
|
9292
9324
|
controller.run( /*#__PURE__*/function () {
|
|
9293
|
-
var
|
|
9325
|
+
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(s) {
|
|
9294
9326
|
var _getSN$shorthand, _getSN;
|
|
9295
9327
|
|
|
9296
9328
|
var value, shorthand;
|
|
9297
|
-
return _regeneratorRuntime().wrap(function
|
|
9329
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
9298
9330
|
while (1) {
|
|
9299
|
-
switch (
|
|
9331
|
+
switch (_context18.prev = _context18.next) {
|
|
9300
9332
|
case 0:
|
|
9301
9333
|
value = form.getFieldsValue().itemName;
|
|
9302
9334
|
shorthand = (_getSN$shorthand = (_getSN = getSN(value)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand) !== null && _getSN$shorthand !== void 0 ? _getSN$shorthand : '';
|
|
9303
9335
|
|
|
9304
9336
|
if (!s.goodsListState.isMyShow) {
|
|
9305
|
-
|
|
9337
|
+
_context18.next = 11;
|
|
9306
9338
|
break;
|
|
9307
9339
|
}
|
|
9308
9340
|
|
|
9309
|
-
|
|
9341
|
+
_context18.next = 5;
|
|
9310
9342
|
return controller.setEditGood({
|
|
9311
9343
|
itemNameSelf: value
|
|
9312
9344
|
});
|
|
9313
9345
|
|
|
9314
9346
|
case 5:
|
|
9315
|
-
|
|
9347
|
+
_context18.t0 = record.itemName;
|
|
9316
9348
|
|
|
9317
|
-
if (!
|
|
9318
|
-
|
|
9349
|
+
if (!_context18.t0) {
|
|
9350
|
+
_context18.next = 9;
|
|
9319
9351
|
break;
|
|
9320
9352
|
}
|
|
9321
9353
|
|
|
9322
|
-
|
|
9354
|
+
_context18.next = 9;
|
|
9323
9355
|
return controller.setEditGood({
|
|
9324
9356
|
itemName: setShorthand(record.itemName, shorthand)
|
|
9325
9357
|
});
|
|
9326
9358
|
|
|
9327
9359
|
case 9:
|
|
9328
|
-
|
|
9360
|
+
_context18.next = 17;
|
|
9329
9361
|
break;
|
|
9330
9362
|
|
|
9331
9363
|
case 11:
|
|
9332
|
-
|
|
9364
|
+
_context18.next = 13;
|
|
9333
9365
|
return controller.setEditGood({
|
|
9334
9366
|
itemName: value
|
|
9335
9367
|
});
|
|
9336
9368
|
|
|
9337
9369
|
case 13:
|
|
9338
|
-
|
|
9370
|
+
_context18.t1 = record.itemNameSelf;
|
|
9339
9371
|
|
|
9340
|
-
if (!
|
|
9341
|
-
|
|
9372
|
+
if (!_context18.t1) {
|
|
9373
|
+
_context18.next = 17;
|
|
9342
9374
|
break;
|
|
9343
9375
|
}
|
|
9344
9376
|
|
|
9345
|
-
|
|
9377
|
+
_context18.next = 17;
|
|
9346
9378
|
return controller.setEditGood({
|
|
9347
9379
|
itemNameSelf: setShorthand(record.itemNameSelf, shorthand)
|
|
9348
9380
|
});
|
|
9349
9381
|
|
|
9350
9382
|
case 17:
|
|
9351
9383
|
case "end":
|
|
9352
|
-
return
|
|
9384
|
+
return _context18.stop();
|
|
9353
9385
|
}
|
|
9354
9386
|
}
|
|
9355
|
-
},
|
|
9387
|
+
}, _callee18);
|
|
9356
9388
|
}));
|
|
9357
9389
|
|
|
9358
|
-
return function (
|
|
9359
|
-
return
|
|
9390
|
+
return function (_x31) {
|
|
9391
|
+
return _ref19.apply(this, arguments);
|
|
9360
9392
|
};
|
|
9361
9393
|
}());
|
|
9362
9394
|
|
|
9363
9395
|
case 1:
|
|
9364
9396
|
case "end":
|
|
9365
|
-
return
|
|
9397
|
+
return _context19.stop();
|
|
9366
9398
|
}
|
|
9367
9399
|
}
|
|
9368
|
-
},
|
|
9400
|
+
}, _callee19);
|
|
9369
9401
|
}));
|
|
9370
9402
|
|
|
9371
|
-
return function onChangeItemName(
|
|
9372
|
-
return
|
|
9403
|
+
return function onChangeItemName(_x28, _x29, _x30) {
|
|
9404
|
+
return _ref18.apply(this, arguments);
|
|
9373
9405
|
};
|
|
9374
9406
|
}();
|
|
9375
9407
|
|
|
@@ -10279,7 +10311,8 @@ var useColumns = (function (form) {
|
|
|
10279
10311
|
width: '100%'
|
|
10280
10312
|
},
|
|
10281
10313
|
onChange: function onChange() {
|
|
10282
|
-
|
|
10314
|
+
setChangeField('taxRate');
|
|
10315
|
+
onChangeTaxRate(controller, form, record);
|
|
10283
10316
|
}
|
|
10284
10317
|
}, taxRateList.map(function (e, i) {
|
|
10285
10318
|
return React.createElement(Select.Option, {
|
|
@@ -13351,9 +13384,7 @@ var DrawerBody$3 = function DrawerBody(props) {
|
|
|
13351
13384
|
endowCodeGood.forEach(function (good) {
|
|
13352
13385
|
if (!good) return;
|
|
13353
13386
|
good.itemName = setShorthand(good.itemName, values.shorthand);
|
|
13354
|
-
good.itemNameSelf = setShorthand(good.itemNameSelf, values.shorthand);
|
|
13355
|
-
// good.itemName = getItemName(good.itemName, values.shorthand); // `*${values.shorthand}*${name}`;
|
|
13356
|
-
|
|
13387
|
+
good.itemNameSelf = setShorthand(good.itemNameSelf, values.shorthand);
|
|
13357
13388
|
good.taxClassificationCode = values.taxClassificationCode;
|
|
13358
13389
|
good.taxRate = values.taxRate;
|
|
13359
13390
|
good.taxFreeType = values.taxFreeType;
|
|
@@ -13364,41 +13395,9 @@ var DrawerBody$3 = function DrawerBody(props) {
|
|
|
13364
13395
|
var lineAmountExcludeTax = chain$1(bignumber(good.lineAmountIncludeTax)).dotDivide(taxRate).done();
|
|
13365
13396
|
var priceExcludeTax = good.priceIncludeTax ? chain$1(bignumber(good.priceIncludeTax)).dotDivide(taxRate).done() : undefined;
|
|
13366
13397
|
good.lineAmountExcludeTax = lineAmountExcludeTax.toNumber().toFixed(2);
|
|
13367
|
-
good.priceExcludeTax = (priceExcludeTax ? format15(priceExcludeTax.toNumber()) : undefined) || undefined;
|
|
13368
|
-
// const lineAmountExcludeTax = chain(bignumber(good.lineAmountIncludeTax)).dotDivide(taxRate).done();
|
|
13369
|
-
// const priceExcludeTax = good.priceIncludeTax ? chain(bignumber(good.priceIncludeTax)).dotDivide(taxRate).done() : undefined
|
|
13370
|
-
// good.lineAmountExcludeTax = lineAmountExcludeTax.toNumber().toFixed(2);
|
|
13371
|
-
// good.priceExcludeTax = (priceExcludeTax ? format15(priceExcludeTax.toNumber()) : undefined) || undefined;
|
|
13372
|
-
// } else {
|
|
13373
|
-
// const lineAmountIncludeTax = chain(bignumber(good.lineAmountExcludeTax)).multiply(taxRate).done();
|
|
13374
|
-
// const priceIncludeTax = good.priceExcludeTax ? chain(bignumber(good.priceExcludeTax)).multiply(taxRate).done() : undefined
|
|
13375
|
-
// good.lineAmountIncludeTax = lineAmountIncludeTax.toNumber().toFixed(2);
|
|
13376
|
-
// good.priceIncludeTax = (priceIncludeTax ? format15(priceIncludeTax.toNumber()) : undefined) || undefined;
|
|
13377
|
-
// }
|
|
13378
|
-
|
|
13398
|
+
good.priceExcludeTax = (priceExcludeTax ? format15(priceExcludeTax.toNumber()) : undefined) || undefined;
|
|
13379
13399
|
good.taxAmount = countTaxAmount(good.lineAmountIncludeTax || 0, s.goodsListState.deduction, values.taxRate);
|
|
13380
|
-
});
|
|
13381
|
-
// if (endowCodeGood.some(e => bytesLnegth(e?.itemName || '') > 92)) {
|
|
13382
|
-
// await (() => new Promise<void>(resolve => {
|
|
13383
|
-
// confirm({
|
|
13384
|
-
// title: '温馨提示',
|
|
13385
|
-
// content: '商品名称长度过长,是否截取名称',
|
|
13386
|
-
// okText: '确定',
|
|
13387
|
-
// cancelText: '取消',
|
|
13388
|
-
// onOk() {
|
|
13389
|
-
// endowCodeGood.forEach(e => {
|
|
13390
|
-
// if (e && e.itemName) { e.itemName = cutStr(e.itemName, 91) }
|
|
13391
|
-
// })
|
|
13392
|
-
// message.success('商品名称截取成功!')
|
|
13393
|
-
// resolve()
|
|
13394
|
-
// },
|
|
13395
|
-
// onCancel() {
|
|
13396
|
-
// resolve()
|
|
13397
|
-
// },
|
|
13398
|
-
// });
|
|
13399
|
-
// }))()
|
|
13400
|
-
// }
|
|
13401
|
-
|
|
13400
|
+
});
|
|
13402
13401
|
s.goodsListState.goodsList = s.goodsListState.goodsList.slice();
|
|
13403
13402
|
s.goodsListState.endowCode.endowcodeGoodIndex = [];
|
|
13404
13403
|
|