kts-component-invoice-operate 3.1.11 → 3.1.13
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/ui/GoodsList/hook/useColumns/autoFillFn/index.d.ts +2 -0
- package/dist/index.esm.js +295 -312
- package/dist/index.js +295 -312
- package/package.json +1 -1
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/EndowCode/index.tsx +1 -1
- package/src/Invoice/InvoiceController/fns/saveEditGood.ts +1 -1
- package/src/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.ts +26 -9
- package/src/Invoice/ui/GoodsList/hook/useColumns/index.tsx +12 -0
package/dist/index.js
CHANGED
|
@@ -830,7 +830,7 @@ var EndowCode = /*#__PURE__*/_createClass(function EndowCode() {
|
|
|
830
830
|
label: '出口免税和其他免税优惠政策(免税)',
|
|
831
831
|
value: 1
|
|
832
832
|
}, {
|
|
833
|
-
label: '
|
|
833
|
+
label: '不征增值税(不征税)',
|
|
834
834
|
value: 2
|
|
835
835
|
}, {
|
|
836
836
|
label: '普通零税率(0%)',
|
|
@@ -1297,7 +1297,7 @@ var saveEditGood = /*#__PURE__*/(function () {
|
|
|
1297
1297
|
case 0:
|
|
1298
1298
|
editGood = state.goodsListState.editGood;
|
|
1299
1299
|
form = state.goodsListState.form;
|
|
1300
|
-
if (!(!editGood || !form || state.goodsListState.importGoods.isVisibleDrawer)) {
|
|
1300
|
+
if (!(!editGood || !form || state.goodsListState.importGoods.isVisibleDrawer || state.calculating)) {
|
|
1301
1301
|
_context.next = 4;
|
|
1302
1302
|
break;
|
|
1303
1303
|
}
|
|
@@ -8079,49 +8079,87 @@ var promptErr = function promptErr(err) {
|
|
|
8079
8079
|
}
|
|
8080
8080
|
return true;
|
|
8081
8081
|
};
|
|
8082
|
+
/** 清除计算中启动字段 */
|
|
8083
|
+
var clearCalculatingField = /*#__PURE__*/function () {
|
|
8084
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(controller) {
|
|
8085
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
8086
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
8087
|
+
case 0:
|
|
8088
|
+
return _context2.abrupt("return", controller.run( /*#__PURE__*/function () {
|
|
8089
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
8090
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8091
|
+
while (1) switch (_context.prev = _context.next) {
|
|
8092
|
+
case 0:
|
|
8093
|
+
return _context.abrupt("return", s.calculating = '');
|
|
8094
|
+
case 1:
|
|
8095
|
+
case "end":
|
|
8096
|
+
return _context.stop();
|
|
8097
|
+
}
|
|
8098
|
+
}, _callee);
|
|
8099
|
+
}));
|
|
8100
|
+
return function (_x2) {
|
|
8101
|
+
return _ref2.apply(this, arguments);
|
|
8102
|
+
};
|
|
8103
|
+
}()));
|
|
8104
|
+
case 1:
|
|
8105
|
+
case "end":
|
|
8106
|
+
return _context2.stop();
|
|
8107
|
+
}
|
|
8108
|
+
}, _callee2);
|
|
8109
|
+
}));
|
|
8110
|
+
return function clearCalculatingField(_x) {
|
|
8111
|
+
return _ref.apply(this, arguments);
|
|
8112
|
+
};
|
|
8113
|
+
}();
|
|
8082
8114
|
/** 数量改变了 */
|
|
8083
8115
|
var onChangeQuantity = lazyFn(function (controller, form, record) {
|
|
8084
8116
|
form.validateFields( /*#__PURE__*/function () {
|
|
8085
|
-
var
|
|
8117
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(err, values) {
|
|
8086
8118
|
var calculatingDigits, quantity, priceIncludeTax, lineAmountIncludeTax, _lineAmountIncludeTax, _priceIncludeTax, priceExcludeTax, lineAmountExcludeTax, _lineAmountExcludeTax, _priceExcludeTax;
|
|
8087
|
-
return _regeneratorRuntime().wrap(function
|
|
8088
|
-
while (1) switch (
|
|
8119
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
8120
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
8089
8121
|
case 0:
|
|
8090
8122
|
err = err || {};
|
|
8091
8123
|
if (!(!values.quantity && values.quantity !== 0)) {
|
|
8092
|
-
|
|
8124
|
+
_context3.next = 7;
|
|
8093
8125
|
break;
|
|
8094
8126
|
}
|
|
8095
|
-
|
|
8127
|
+
_context3.next = 4;
|
|
8096
8128
|
return controller.setEditGood({
|
|
8097
8129
|
quantity: undefined
|
|
8098
8130
|
});
|
|
8099
8131
|
case 4:
|
|
8100
|
-
|
|
8101
|
-
|
|
8132
|
+
_context3.next = 6;
|
|
8133
|
+
return clearCalculatingField(controller);
|
|
8134
|
+
case 6:
|
|
8135
|
+
return _context3.abrupt("return");
|
|
8136
|
+
case 7:
|
|
8102
8137
|
if (!err.quantity) {
|
|
8103
|
-
|
|
8138
|
+
_context3.next = 11;
|
|
8104
8139
|
break;
|
|
8105
8140
|
}
|
|
8106
|
-
|
|
8107
|
-
|
|
8141
|
+
_context3.next = 10;
|
|
8142
|
+
return clearCalculatingField(controller);
|
|
8143
|
+
case 10:
|
|
8144
|
+
return _context3.abrupt("return");
|
|
8145
|
+
case 11:
|
|
8108
8146
|
calculatingDigits = controller.state.calculatingDigits;
|
|
8109
8147
|
quantity = format15(values.quantity, calculatingDigits);
|
|
8110
|
-
|
|
8148
|
+
_context3.next = 16;
|
|
8111
8149
|
return controller.setEditGood({
|
|
8112
8150
|
quantity: quantity
|
|
8113
8151
|
});
|
|
8114
|
-
case
|
|
8152
|
+
case 16:
|
|
8115
8153
|
form.setFieldsValue({
|
|
8116
8154
|
quantity: quantity
|
|
8117
8155
|
});
|
|
8118
8156
|
// 是否含税
|
|
8119
8157
|
if (!controller.state.goodsListState.isTaxIncluded) {
|
|
8120
|
-
|
|
8158
|
+
_context3.next = 35;
|
|
8121
8159
|
break;
|
|
8122
8160
|
}
|
|
8123
8161
|
if (!(!err.priceIncludeTax && values.priceIncludeTax)) {
|
|
8124
|
-
|
|
8162
|
+
_context3.next = 26;
|
|
8125
8163
|
break;
|
|
8126
8164
|
}
|
|
8127
8165
|
// 可以找到 单价(含税)
|
|
@@ -8130,16 +8168,16 @@ var onChangeQuantity = lazyFn(function (controller, form, record) {
|
|
|
8130
8168
|
form.setFieldsValue({
|
|
8131
8169
|
lineAmountIncludeTax: lineAmountIncludeTax
|
|
8132
8170
|
});
|
|
8133
|
-
|
|
8171
|
+
_context3.next = 24;
|
|
8134
8172
|
return controller.setEditGood({
|
|
8135
8173
|
lineAmountIncludeTax: lineAmountIncludeTax
|
|
8136
8174
|
});
|
|
8137
|
-
case
|
|
8138
|
-
|
|
8175
|
+
case 24:
|
|
8176
|
+
_context3.next = 32;
|
|
8139
8177
|
break;
|
|
8140
|
-
case
|
|
8178
|
+
case 26:
|
|
8141
8179
|
if (!(!err.lineAmountIncludeTax && values.lineAmountIncludeTax)) {
|
|
8142
|
-
|
|
8180
|
+
_context3.next = 32;
|
|
8143
8181
|
break;
|
|
8144
8182
|
}
|
|
8145
8183
|
// 可以找到 金额(含税)
|
|
@@ -8148,18 +8186,18 @@ var onChangeQuantity = lazyFn(function (controller, form, record) {
|
|
|
8148
8186
|
form.setFieldsValue({
|
|
8149
8187
|
priceIncludeTax: _priceIncludeTax
|
|
8150
8188
|
});
|
|
8151
|
-
|
|
8189
|
+
_context3.next = 32;
|
|
8152
8190
|
return controller.setEditGood({
|
|
8153
8191
|
priceIncludeTax: _priceIncludeTax
|
|
8154
8192
|
});
|
|
8155
|
-
case
|
|
8193
|
+
case 32:
|
|
8156
8194
|
// 更新不含税
|
|
8157
8195
|
updateUnitPriceExcludingTax(controller, form);
|
|
8158
|
-
|
|
8196
|
+
_context3.next = 50;
|
|
8159
8197
|
break;
|
|
8160
|
-
case
|
|
8198
|
+
case 35:
|
|
8161
8199
|
if (!(!err.priceExcludeTax && values.priceExcludeTax)) {
|
|
8162
|
-
|
|
8200
|
+
_context3.next = 43;
|
|
8163
8201
|
break;
|
|
8164
8202
|
}
|
|
8165
8203
|
priceExcludeTax = format15(values.priceExcludeTax, calculatingDigits);
|
|
@@ -8167,17 +8205,17 @@ var onChangeQuantity = lazyFn(function (controller, form, record) {
|
|
|
8167
8205
|
form.setFieldsValue({
|
|
8168
8206
|
lineAmountExcludeTax: lineAmountExcludeTax
|
|
8169
8207
|
});
|
|
8170
|
-
|
|
8208
|
+
_context3.next = 41;
|
|
8171
8209
|
return controller.setEditGood({
|
|
8172
8210
|
lineAmountExcludeTax: lineAmountExcludeTax,
|
|
8173
8211
|
quantity: quantity
|
|
8174
8212
|
});
|
|
8175
|
-
case
|
|
8176
|
-
|
|
8213
|
+
case 41:
|
|
8214
|
+
_context3.next = 49;
|
|
8177
8215
|
break;
|
|
8178
|
-
case
|
|
8216
|
+
case 43:
|
|
8179
8217
|
if (!(!err.lineAmountExcludeTax && values.lineAmountExcludeTax)) {
|
|
8180
|
-
|
|
8218
|
+
_context3.next = 49;
|
|
8181
8219
|
break;
|
|
8182
8220
|
}
|
|
8183
8221
|
_lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
|
|
@@ -8185,54 +8223,39 @@ var onChangeQuantity = lazyFn(function (controller, form, record) {
|
|
|
8185
8223
|
form.setFieldsValue({
|
|
8186
8224
|
priceExcludeTax: _priceExcludeTax
|
|
8187
8225
|
});
|
|
8188
|
-
|
|
8226
|
+
_context3.next = 49;
|
|
8189
8227
|
return controller.setEditGood({
|
|
8190
8228
|
priceExcludeTax: _priceExcludeTax,
|
|
8191
8229
|
quantity: quantity
|
|
8192
8230
|
});
|
|
8193
|
-
case
|
|
8231
|
+
case 49:
|
|
8194
8232
|
// 更新含税
|
|
8195
8233
|
updateUnitPriceTax(controller, form);
|
|
8196
|
-
case
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8201
|
-
while (1) switch (_context.prev = _context.next) {
|
|
8202
|
-
case 0:
|
|
8203
|
-
return _context.abrupt("return", s.calculating = '');
|
|
8204
|
-
case 1:
|
|
8205
|
-
case "end":
|
|
8206
|
-
return _context.stop();
|
|
8207
|
-
}
|
|
8208
|
-
}, _callee);
|
|
8209
|
-
}));
|
|
8210
|
-
return function (_x3) {
|
|
8211
|
-
return _ref2.apply(this, arguments);
|
|
8212
|
-
};
|
|
8213
|
-
}());
|
|
8214
|
-
case 46:
|
|
8234
|
+
case 50:
|
|
8235
|
+
_context3.next = 52;
|
|
8236
|
+
return clearCalculatingField(controller);
|
|
8237
|
+
case 52:
|
|
8215
8238
|
case "end":
|
|
8216
|
-
return
|
|
8239
|
+
return _context3.stop();
|
|
8217
8240
|
}
|
|
8218
|
-
},
|
|
8241
|
+
}, _callee3);
|
|
8219
8242
|
}));
|
|
8220
|
-
return function (
|
|
8221
|
-
return
|
|
8243
|
+
return function (_x3, _x4) {
|
|
8244
|
+
return _ref3.apply(this, arguments);
|
|
8222
8245
|
};
|
|
8223
8246
|
}());
|
|
8224
8247
|
}, 1000);
|
|
8225
8248
|
/** 单价(含税) */
|
|
8226
8249
|
var onChangePriceIncludeTax = lazyFn(function (controller, form, record) {
|
|
8227
8250
|
form.validateFields( /*#__PURE__*/function () {
|
|
8228
|
-
var
|
|
8251
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(err, values) {
|
|
8229
8252
|
var calculatingDigits, priceIncludeTax, quantity, lineAmountIncludeTax, _lineAmountIncludeTax2, _quantity;
|
|
8230
8253
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
8231
8254
|
while (1) switch (_context4.prev = _context4.next) {
|
|
8232
8255
|
case 0:
|
|
8233
8256
|
err = err || {};
|
|
8234
8257
|
if (!(!values.priceIncludeTax && values.priceIncludeTax !== 0)) {
|
|
8235
|
-
_context4.next =
|
|
8258
|
+
_context4.next = 7;
|
|
8236
8259
|
break;
|
|
8237
8260
|
}
|
|
8238
8261
|
_context4.next = 4;
|
|
@@ -8241,27 +8264,33 @@ var onChangePriceIncludeTax = lazyFn(function (controller, form, record) {
|
|
|
8241
8264
|
priceExcludeTax: undefined
|
|
8242
8265
|
});
|
|
8243
8266
|
case 4:
|
|
8267
|
+
_context4.next = 6;
|
|
8268
|
+
return clearCalculatingField(controller);
|
|
8269
|
+
case 6:
|
|
8244
8270
|
return _context4.abrupt("return");
|
|
8245
|
-
case
|
|
8271
|
+
case 7:
|
|
8246
8272
|
if (!err.priceIncludeTax) {
|
|
8247
|
-
_context4.next =
|
|
8273
|
+
_context4.next = 11;
|
|
8248
8274
|
break;
|
|
8249
8275
|
}
|
|
8276
|
+
_context4.next = 10;
|
|
8277
|
+
return clearCalculatingField(controller);
|
|
8278
|
+
case 10:
|
|
8250
8279
|
return _context4.abrupt("return");
|
|
8251
|
-
case
|
|
8280
|
+
case 11:
|
|
8252
8281
|
calculatingDigits = controller.state.calculatingDigits;
|
|
8253
8282
|
priceIncludeTax = format15(values.priceIncludeTax, calculatingDigits);
|
|
8254
|
-
_context4.next =
|
|
8283
|
+
_context4.next = 15;
|
|
8255
8284
|
return controller.setEditGood({
|
|
8256
8285
|
priceIncludeTax: priceIncludeTax
|
|
8257
8286
|
});
|
|
8258
|
-
case
|
|
8287
|
+
case 15:
|
|
8259
8288
|
form.setFieldsValue({
|
|
8260
8289
|
priceIncludeTax: priceIncludeTax
|
|
8261
8290
|
});
|
|
8262
8291
|
// 是否有数量
|
|
8263
8292
|
if (!(!err.quantity && values.quantity)) {
|
|
8264
|
-
_context4.next =
|
|
8293
|
+
_context4.next = 24;
|
|
8265
8294
|
break;
|
|
8266
8295
|
}
|
|
8267
8296
|
quantity = format15(values.quantity, calculatingDigits);
|
|
@@ -8269,16 +8298,16 @@ var onChangePriceIncludeTax = lazyFn(function (controller, form, record) {
|
|
|
8269
8298
|
form.setFieldsValue({
|
|
8270
8299
|
lineAmountIncludeTax: lineAmountIncludeTax
|
|
8271
8300
|
});
|
|
8272
|
-
_context4.next =
|
|
8301
|
+
_context4.next = 22;
|
|
8273
8302
|
return controller.setEditGood({
|
|
8274
8303
|
lineAmountIncludeTax: lineAmountIncludeTax
|
|
8275
8304
|
});
|
|
8276
|
-
case
|
|
8277
|
-
_context4.next =
|
|
8305
|
+
case 22:
|
|
8306
|
+
_context4.next = 30;
|
|
8278
8307
|
break;
|
|
8279
|
-
case
|
|
8308
|
+
case 24:
|
|
8280
8309
|
if (!(!err.lineAmountIncludeTax && values.lineAmountIncludeTax)) {
|
|
8281
|
-
_context4.next =
|
|
8310
|
+
_context4.next = 30;
|
|
8282
8311
|
break;
|
|
8283
8312
|
}
|
|
8284
8313
|
_lineAmountIncludeTax2 = format2(values.lineAmountIncludeTax);
|
|
@@ -8286,81 +8315,73 @@ var onChangePriceIncludeTax = lazyFn(function (controller, form, record) {
|
|
|
8286
8315
|
form.setFieldsValue({
|
|
8287
8316
|
quantity: _quantity
|
|
8288
8317
|
});
|
|
8289
|
-
_context4.next =
|
|
8318
|
+
_context4.next = 30;
|
|
8290
8319
|
return controller.setEditGood({
|
|
8291
8320
|
quantity: _quantity
|
|
8292
8321
|
});
|
|
8293
|
-
case
|
|
8322
|
+
case 30:
|
|
8294
8323
|
// 更新不含税
|
|
8295
8324
|
updateUnitPriceExcludingTax(controller, form);
|
|
8296
8325
|
// 清楚 计算中启动字段
|
|
8297
|
-
|
|
8298
|
-
|
|
8299
|
-
|
|
8300
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
8301
|
-
case 0:
|
|
8302
|
-
return _context3.abrupt("return", s.calculating = '');
|
|
8303
|
-
case 1:
|
|
8304
|
-
case "end":
|
|
8305
|
-
return _context3.stop();
|
|
8306
|
-
}
|
|
8307
|
-
}, _callee3);
|
|
8308
|
-
}));
|
|
8309
|
-
return function (_x6) {
|
|
8310
|
-
return _ref4.apply(this, arguments);
|
|
8311
|
-
};
|
|
8312
|
-
}());
|
|
8313
|
-
case 28:
|
|
8326
|
+
_context4.next = 33;
|
|
8327
|
+
return clearCalculatingField(controller);
|
|
8328
|
+
case 33:
|
|
8314
8329
|
case "end":
|
|
8315
8330
|
return _context4.stop();
|
|
8316
8331
|
}
|
|
8317
8332
|
}, _callee4);
|
|
8318
8333
|
}));
|
|
8319
|
-
return function (
|
|
8320
|
-
return
|
|
8334
|
+
return function (_x5, _x6) {
|
|
8335
|
+
return _ref4.apply(this, arguments);
|
|
8321
8336
|
};
|
|
8322
8337
|
}());
|
|
8323
8338
|
}, 1000);
|
|
8324
8339
|
/** 单价(不含税) */
|
|
8325
8340
|
var onChangePriceExcludeTax = lazyFn(function (controller, form, record) {
|
|
8326
8341
|
form.validateFields( /*#__PURE__*/function () {
|
|
8327
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
8342
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(err, values) {
|
|
8328
8343
|
var calculatingDigits, priceExcludeTax, quantity, lineAmountExcludeTax, _lineAmountExcludeTax2, _quantity2;
|
|
8329
|
-
return _regeneratorRuntime().wrap(function
|
|
8330
|
-
while (1) switch (
|
|
8344
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
8345
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
8331
8346
|
case 0:
|
|
8332
8347
|
err = err || {};
|
|
8333
8348
|
if (!(!values.priceExcludeTax && values.priceExcludeTax !== 0)) {
|
|
8334
|
-
|
|
8349
|
+
_context5.next = 7;
|
|
8335
8350
|
break;
|
|
8336
8351
|
}
|
|
8337
|
-
|
|
8352
|
+
_context5.next = 4;
|
|
8338
8353
|
return controller.setEditGood({
|
|
8339
8354
|
priceIncludeTax: undefined,
|
|
8340
8355
|
priceExcludeTax: undefined
|
|
8341
8356
|
});
|
|
8342
8357
|
case 4:
|
|
8343
|
-
|
|
8344
|
-
|
|
8358
|
+
_context5.next = 6;
|
|
8359
|
+
return clearCalculatingField(controller);
|
|
8360
|
+
case 6:
|
|
8361
|
+
return _context5.abrupt("return");
|
|
8362
|
+
case 7:
|
|
8345
8363
|
if (!err.priceExcludeTax) {
|
|
8346
|
-
|
|
8364
|
+
_context5.next = 11;
|
|
8347
8365
|
break;
|
|
8348
8366
|
}
|
|
8349
|
-
|
|
8350
|
-
|
|
8367
|
+
_context5.next = 10;
|
|
8368
|
+
return clearCalculatingField(controller);
|
|
8369
|
+
case 10:
|
|
8370
|
+
return _context5.abrupt("return");
|
|
8371
|
+
case 11:
|
|
8351
8372
|
calculatingDigits = controller.state.calculatingDigits;
|
|
8352
8373
|
priceExcludeTax = format15(values.priceExcludeTax, calculatingDigits);
|
|
8353
|
-
|
|
8374
|
+
_context5.next = 15;
|
|
8354
8375
|
return controller.setEditGood({
|
|
8355
8376
|
priceExcludeTax: priceExcludeTax
|
|
8356
8377
|
});
|
|
8357
|
-
case
|
|
8378
|
+
case 15:
|
|
8358
8379
|
form.setFieldsValue({
|
|
8359
8380
|
priceExcludeTax: priceExcludeTax
|
|
8360
8381
|
});
|
|
8361
8382
|
// 是否有数量
|
|
8362
8383
|
if (!(!err.quantity && values.quantity)) {
|
|
8363
|
-
|
|
8384
|
+
_context5.next = 24;
|
|
8364
8385
|
break;
|
|
8365
8386
|
}
|
|
8366
8387
|
quantity = format15(values.quantity, calculatingDigits);
|
|
@@ -8368,16 +8389,16 @@ var onChangePriceExcludeTax = lazyFn(function (controller, form, record) {
|
|
|
8368
8389
|
form.setFieldsValue({
|
|
8369
8390
|
lineAmountExcludeTax: lineAmountExcludeTax
|
|
8370
8391
|
});
|
|
8371
|
-
|
|
8392
|
+
_context5.next = 22;
|
|
8372
8393
|
return controller.setEditGood({
|
|
8373
8394
|
lineAmountExcludeTax: lineAmountExcludeTax
|
|
8374
8395
|
});
|
|
8375
|
-
case
|
|
8376
|
-
|
|
8396
|
+
case 22:
|
|
8397
|
+
_context5.next = 30;
|
|
8377
8398
|
break;
|
|
8378
|
-
case
|
|
8399
|
+
case 24:
|
|
8379
8400
|
if (!(!err.lineAmountExcludeTax && values.lineAmountExcludeTax)) {
|
|
8380
|
-
|
|
8401
|
+
_context5.next = 30;
|
|
8381
8402
|
break;
|
|
8382
8403
|
}
|
|
8383
8404
|
_lineAmountExcludeTax2 = format2(values.lineAmountExcludeTax);
|
|
@@ -8385,35 +8406,21 @@ var onChangePriceExcludeTax = lazyFn(function (controller, form, record) {
|
|
|
8385
8406
|
form.setFieldsValue({
|
|
8386
8407
|
quantity: _quantity2
|
|
8387
8408
|
});
|
|
8388
|
-
|
|
8409
|
+
_context5.next = 30;
|
|
8389
8410
|
return controller.setEditGood({
|
|
8390
8411
|
quantity: _quantity2
|
|
8391
8412
|
});
|
|
8392
|
-
case
|
|
8413
|
+
case 30:
|
|
8393
8414
|
// 更新含税
|
|
8394
8415
|
updateUnitPriceTax(controller, form);
|
|
8395
8416
|
// 清楚 计算中启动字段
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
8400
|
-
case 0:
|
|
8401
|
-
return _context5.abrupt("return", s.calculating = '');
|
|
8402
|
-
case 1:
|
|
8403
|
-
case "end":
|
|
8404
|
-
return _context5.stop();
|
|
8405
|
-
}
|
|
8406
|
-
}, _callee5);
|
|
8407
|
-
}));
|
|
8408
|
-
return function (_x9) {
|
|
8409
|
-
return _ref6.apply(this, arguments);
|
|
8410
|
-
};
|
|
8411
|
-
}());
|
|
8412
|
-
case 28:
|
|
8417
|
+
_context5.next = 33;
|
|
8418
|
+
return clearCalculatingField(controller);
|
|
8419
|
+
case 33:
|
|
8413
8420
|
case "end":
|
|
8414
|
-
return
|
|
8421
|
+
return _context5.stop();
|
|
8415
8422
|
}
|
|
8416
|
-
},
|
|
8423
|
+
}, _callee5);
|
|
8417
8424
|
}));
|
|
8418
8425
|
return function (_x7, _x8) {
|
|
8419
8426
|
return _ref5.apply(this, arguments);
|
|
@@ -8423,38 +8430,41 @@ var onChangePriceExcludeTax = lazyFn(function (controller, form, record) {
|
|
|
8423
8430
|
/** 金额(含税) */
|
|
8424
8431
|
var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
|
|
8425
8432
|
form.validateFields( /*#__PURE__*/function () {
|
|
8426
|
-
var
|
|
8433
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(err, values) {
|
|
8427
8434
|
var calculatingDigits, lineAmountIncludeTax, quantity, priceIncludeTax, _priceIncludeTax2, _quantity3;
|
|
8428
|
-
return _regeneratorRuntime().wrap(function
|
|
8429
|
-
while (1) switch (
|
|
8435
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
8436
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
8430
8437
|
case 0:
|
|
8431
8438
|
err = err || {};
|
|
8432
8439
|
if (!(promptErr(err.lineAmountIncludeTax) || !values.lineAmountIncludeTax)) {
|
|
8433
|
-
|
|
8440
|
+
_context6.next = 8;
|
|
8434
8441
|
break;
|
|
8435
8442
|
}
|
|
8436
|
-
|
|
8443
|
+
_context6.next = 4;
|
|
8437
8444
|
return controller.setEditGood({
|
|
8438
8445
|
lineAmountIncludeTax: undefined,
|
|
8439
8446
|
lineAmountExcludeTax: undefined
|
|
8440
8447
|
});
|
|
8441
8448
|
case 4:
|
|
8442
8449
|
updateUnitPriceExcludingTax(controller, form);
|
|
8443
|
-
|
|
8444
|
-
|
|
8450
|
+
_context6.next = 7;
|
|
8451
|
+
return clearCalculatingField(controller);
|
|
8452
|
+
case 7:
|
|
8453
|
+
return _context6.abrupt("return");
|
|
8454
|
+
case 8:
|
|
8445
8455
|
calculatingDigits = controller.state.calculatingDigits;
|
|
8446
8456
|
lineAmountIncludeTax = format2(values.lineAmountIncludeTax);
|
|
8447
|
-
|
|
8457
|
+
_context6.next = 12;
|
|
8448
8458
|
return controller.setEditGood({
|
|
8449
8459
|
lineAmountIncludeTax: lineAmountIncludeTax
|
|
8450
8460
|
});
|
|
8451
|
-
case
|
|
8461
|
+
case 12:
|
|
8452
8462
|
form.setFieldsValue({
|
|
8453
8463
|
lineAmountIncludeTax: lineAmountIncludeTax
|
|
8454
8464
|
});
|
|
8455
8465
|
// 是否有数量
|
|
8456
8466
|
if (!(!err.quantity && values.quantity)) {
|
|
8457
|
-
|
|
8467
|
+
_context6.next = 21;
|
|
8458
8468
|
break;
|
|
8459
8469
|
}
|
|
8460
8470
|
quantity = format15(values.quantity, calculatingDigits);
|
|
@@ -8462,16 +8472,16 @@ var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
|
|
|
8462
8472
|
form.setFieldsValue({
|
|
8463
8473
|
priceIncludeTax: priceIncludeTax
|
|
8464
8474
|
});
|
|
8465
|
-
|
|
8475
|
+
_context6.next = 19;
|
|
8466
8476
|
return controller.setEditGood({
|
|
8467
8477
|
priceIncludeTax: priceIncludeTax
|
|
8468
8478
|
});
|
|
8469
|
-
case 17:
|
|
8470
|
-
_context8.next = 25;
|
|
8471
|
-
break;
|
|
8472
8479
|
case 19:
|
|
8480
|
+
_context6.next = 27;
|
|
8481
|
+
break;
|
|
8482
|
+
case 21:
|
|
8473
8483
|
if (!(!err.priceIncludeTax && (values.priceIncludeTax || values.priceIncludeTax === 0))) {
|
|
8474
|
-
|
|
8484
|
+
_context6.next = 27;
|
|
8475
8485
|
break;
|
|
8476
8486
|
}
|
|
8477
8487
|
_priceIncludeTax2 = format15(values.priceIncludeTax, calculatingDigits);
|
|
@@ -8479,76 +8489,65 @@ var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
|
|
|
8479
8489
|
form.setFieldsValue({
|
|
8480
8490
|
quantity: _quantity3
|
|
8481
8491
|
});
|
|
8482
|
-
|
|
8492
|
+
_context6.next = 27;
|
|
8483
8493
|
return controller.setEditGood({
|
|
8484
8494
|
quantity: _quantity3
|
|
8485
8495
|
});
|
|
8486
|
-
case
|
|
8496
|
+
case 27:
|
|
8487
8497
|
// 更新不含税
|
|
8488
8498
|
updateUnitPriceExcludingTax(controller, form);
|
|
8489
8499
|
// 清楚 计算中启动字段
|
|
8490
|
-
|
|
8491
|
-
|
|
8492
|
-
|
|
8493
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
8494
|
-
case 0:
|
|
8495
|
-
return _context7.abrupt("return", s.calculating = '');
|
|
8496
|
-
case 1:
|
|
8497
|
-
case "end":
|
|
8498
|
-
return _context7.stop();
|
|
8499
|
-
}
|
|
8500
|
-
}, _callee7);
|
|
8501
|
-
}));
|
|
8502
|
-
return function (_x12) {
|
|
8503
|
-
return _ref8.apply(this, arguments);
|
|
8504
|
-
};
|
|
8505
|
-
}());
|
|
8506
|
-
case 27:
|
|
8500
|
+
_context6.next = 30;
|
|
8501
|
+
return clearCalculatingField(controller);
|
|
8502
|
+
case 30:
|
|
8507
8503
|
case "end":
|
|
8508
|
-
return
|
|
8504
|
+
return _context6.stop();
|
|
8509
8505
|
}
|
|
8510
|
-
},
|
|
8506
|
+
}, _callee6);
|
|
8511
8507
|
}));
|
|
8512
|
-
return function (
|
|
8513
|
-
return
|
|
8508
|
+
return function (_x9, _x10) {
|
|
8509
|
+
return _ref6.apply(this, arguments);
|
|
8514
8510
|
};
|
|
8515
8511
|
}());
|
|
8516
8512
|
}, 1000);
|
|
8517
8513
|
/** 金额(不含税) */
|
|
8518
8514
|
var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
|
|
8519
8515
|
form.validateFields( /*#__PURE__*/function () {
|
|
8520
|
-
var
|
|
8516
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(err, values) {
|
|
8521
8517
|
var calculatingDigits, lineAmountExcludeTax, quantity, priceExcludeTax, _priceExcludeTax2, _quantity4;
|
|
8522
|
-
return _regeneratorRuntime().wrap(function
|
|
8523
|
-
while (1) switch (
|
|
8518
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
8519
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
8524
8520
|
case 0:
|
|
8525
8521
|
err = err || {};
|
|
8526
8522
|
if (!(promptErr(err.lineAmountExcludeTax) || !values.lineAmountExcludeTax)) {
|
|
8527
|
-
|
|
8523
|
+
_context7.next = 8;
|
|
8528
8524
|
break;
|
|
8529
8525
|
}
|
|
8530
|
-
|
|
8526
|
+
_context7.next = 4;
|
|
8531
8527
|
return controller.setEditGood({
|
|
8532
8528
|
lineAmountIncludeTax: undefined,
|
|
8533
8529
|
lineAmountExcludeTax: undefined
|
|
8534
8530
|
});
|
|
8535
8531
|
case 4:
|
|
8536
8532
|
updateUnitPriceTax(controller, form);
|
|
8537
|
-
|
|
8538
|
-
|
|
8533
|
+
_context7.next = 7;
|
|
8534
|
+
return clearCalculatingField(controller);
|
|
8535
|
+
case 7:
|
|
8536
|
+
return _context7.abrupt("return");
|
|
8537
|
+
case 8:
|
|
8539
8538
|
calculatingDigits = controller.state.calculatingDigits;
|
|
8540
8539
|
lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
|
|
8541
|
-
|
|
8540
|
+
_context7.next = 12;
|
|
8542
8541
|
return controller.setEditGood({
|
|
8543
8542
|
lineAmountExcludeTax: lineAmountExcludeTax
|
|
8544
8543
|
});
|
|
8545
|
-
case
|
|
8544
|
+
case 12:
|
|
8546
8545
|
form.setFieldsValue({
|
|
8547
8546
|
lineAmountExcludeTax: lineAmountExcludeTax
|
|
8548
8547
|
});
|
|
8549
8548
|
// 是否有数量
|
|
8550
8549
|
if (!(!err.quantity && values.quantity)) {
|
|
8551
|
-
|
|
8550
|
+
_context7.next = 21;
|
|
8552
8551
|
break;
|
|
8553
8552
|
}
|
|
8554
8553
|
quantity = format15(values.quantity, calculatingDigits);
|
|
@@ -8556,16 +8555,16 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
|
|
|
8556
8555
|
form.setFieldsValue({
|
|
8557
8556
|
priceExcludeTax: priceExcludeTax
|
|
8558
8557
|
});
|
|
8559
|
-
|
|
8558
|
+
_context7.next = 19;
|
|
8560
8559
|
return controller.setEditGood({
|
|
8561
8560
|
priceExcludeTax: priceExcludeTax
|
|
8562
8561
|
});
|
|
8563
|
-
case 17:
|
|
8564
|
-
_context10.next = 25;
|
|
8565
|
-
break;
|
|
8566
8562
|
case 19:
|
|
8563
|
+
_context7.next = 27;
|
|
8564
|
+
break;
|
|
8565
|
+
case 21:
|
|
8567
8566
|
if (!(!err.priceExcludeTax && values.priceExcludeTax)) {
|
|
8568
|
-
|
|
8567
|
+
_context7.next = 27;
|
|
8569
8568
|
break;
|
|
8570
8569
|
}
|
|
8571
8570
|
_priceExcludeTax2 = format15(values.priceExcludeTax, calculatingDigits);
|
|
@@ -8573,58 +8572,44 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
|
|
|
8573
8572
|
form.setFieldsValue({
|
|
8574
8573
|
quantity: _quantity4
|
|
8575
8574
|
});
|
|
8576
|
-
|
|
8575
|
+
_context7.next = 27;
|
|
8577
8576
|
return controller.setEditGood({
|
|
8578
8577
|
quantity: _quantity4
|
|
8579
8578
|
});
|
|
8580
|
-
case
|
|
8579
|
+
case 27:
|
|
8581
8580
|
// 更新含税
|
|
8582
8581
|
updateUnitPriceTax(controller, form);
|
|
8583
8582
|
// 清楚 计算中启动字段
|
|
8584
|
-
|
|
8585
|
-
|
|
8586
|
-
|
|
8587
|
-
while (1) switch (_context9.prev = _context9.next) {
|
|
8588
|
-
case 0:
|
|
8589
|
-
return _context9.abrupt("return", s.calculating = '');
|
|
8590
|
-
case 1:
|
|
8591
|
-
case "end":
|
|
8592
|
-
return _context9.stop();
|
|
8593
|
-
}
|
|
8594
|
-
}, _callee9);
|
|
8595
|
-
}));
|
|
8596
|
-
return function (_x15) {
|
|
8597
|
-
return _ref10.apply(this, arguments);
|
|
8598
|
-
};
|
|
8599
|
-
}());
|
|
8600
|
-
case 27:
|
|
8583
|
+
_context7.next = 30;
|
|
8584
|
+
return clearCalculatingField(controller);
|
|
8585
|
+
case 30:
|
|
8601
8586
|
case "end":
|
|
8602
|
-
return
|
|
8587
|
+
return _context7.stop();
|
|
8603
8588
|
}
|
|
8604
|
-
},
|
|
8589
|
+
}, _callee7);
|
|
8605
8590
|
}));
|
|
8606
|
-
return function (
|
|
8607
|
-
return
|
|
8591
|
+
return function (_x11, _x12) {
|
|
8592
|
+
return _ref7.apply(this, arguments);
|
|
8608
8593
|
};
|
|
8609
8594
|
}());
|
|
8610
8595
|
}, 1000);
|
|
8611
8596
|
/** 税率 */
|
|
8612
8597
|
var onChangeTaxRate = lazyFn(function (controller, form, record) {
|
|
8613
8598
|
form.validateFields( /*#__PURE__*/function () {
|
|
8614
|
-
var
|
|
8599
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(err, values) {
|
|
8615
8600
|
var taxRate;
|
|
8616
|
-
return _regeneratorRuntime().wrap(function
|
|
8617
|
-
while (1) switch (
|
|
8601
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
8602
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
8618
8603
|
case 0:
|
|
8619
8604
|
err = err || {};
|
|
8620
8605
|
if (!(promptErr(err.taxRate) || !values.taxRate && values.taxRate !== 0)) {
|
|
8621
|
-
|
|
8606
|
+
_context8.next = 3;
|
|
8622
8607
|
break;
|
|
8623
8608
|
}
|
|
8624
|
-
return
|
|
8609
|
+
return _context8.abrupt("return");
|
|
8625
8610
|
case 3:
|
|
8626
8611
|
taxRate = parseFloat(values.taxRate);
|
|
8627
|
-
|
|
8612
|
+
_context8.next = 6;
|
|
8628
8613
|
return controller.setEditGood({
|
|
8629
8614
|
taxRate: taxRate
|
|
8630
8615
|
});
|
|
@@ -8647,30 +8632,16 @@ var onChangeTaxRate = lazyFn(function (controller, form, record) {
|
|
|
8647
8632
|
updateUnitPriceTax(controller, form);
|
|
8648
8633
|
}
|
|
8649
8634
|
// 清楚 计算中启动字段
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
while (1) switch (_context11.prev = _context11.next) {
|
|
8654
|
-
case 0:
|
|
8655
|
-
return _context11.abrupt("return", s.calculating = '');
|
|
8656
|
-
case 1:
|
|
8657
|
-
case "end":
|
|
8658
|
-
return _context11.stop();
|
|
8659
|
-
}
|
|
8660
|
-
}, _callee11);
|
|
8661
|
-
}));
|
|
8662
|
-
return function (_x18) {
|
|
8663
|
-
return _ref12.apply(this, arguments);
|
|
8664
|
-
};
|
|
8665
|
-
}());
|
|
8666
|
-
case 9:
|
|
8635
|
+
_context8.next = 10;
|
|
8636
|
+
return clearCalculatingField(controller);
|
|
8637
|
+
case 10:
|
|
8667
8638
|
case "end":
|
|
8668
|
-
return
|
|
8639
|
+
return _context8.stop();
|
|
8669
8640
|
}
|
|
8670
|
-
},
|
|
8641
|
+
}, _callee8);
|
|
8671
8642
|
}));
|
|
8672
|
-
return function (
|
|
8673
|
-
return
|
|
8643
|
+
return function (_x13, _x14) {
|
|
8644
|
+
return _ref8.apply(this, arguments);
|
|
8674
8645
|
};
|
|
8675
8646
|
}());
|
|
8676
8647
|
}, 1000);
|
|
@@ -8706,10 +8677,10 @@ function dutyFree(controller, taxRate, form, record) {
|
|
|
8706
8677
|
/** 含税 => 更新(不含税) */
|
|
8707
8678
|
var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controller, form, record) {
|
|
8708
8679
|
form.validateFields( /*#__PURE__*/function () {
|
|
8709
|
-
var
|
|
8680
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(err, values) {
|
|
8710
8681
|
var taxAmount, lineAmountExcludeTax, priceExcludeTax, deduction;
|
|
8711
|
-
return _regeneratorRuntime().wrap(function
|
|
8712
|
-
while (1) switch (
|
|
8682
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
8683
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
8713
8684
|
case 0:
|
|
8714
8685
|
err = err || {};
|
|
8715
8686
|
/** 税额 */
|
|
@@ -8718,7 +8689,7 @@ var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controlle
|
|
|
8718
8689
|
if (!promptErr(err.lineAmountIncludeTax) && !promptErr(err.taxRate)) {
|
|
8719
8690
|
taxAmount = countTaxAmount(values.lineAmountIncludeTax, deduction, values.taxRate);
|
|
8720
8691
|
}
|
|
8721
|
-
|
|
8692
|
+
_context9.next = 5;
|
|
8722
8693
|
return controller.setEditGood({
|
|
8723
8694
|
taxAmount: taxAmount
|
|
8724
8695
|
});
|
|
@@ -8730,7 +8701,7 @@ var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controlle
|
|
|
8730
8701
|
form.setFieldsValue({
|
|
8731
8702
|
lineAmountExcludeTax: lineAmountExcludeTax
|
|
8732
8703
|
});
|
|
8733
|
-
|
|
8704
|
+
_context9.next = 9;
|
|
8734
8705
|
return controller.setEditGood({
|
|
8735
8706
|
lineAmountExcludeTax: lineAmountExcludeTax
|
|
8736
8707
|
});
|
|
@@ -8742,48 +8713,48 @@ var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controlle
|
|
|
8742
8713
|
form.setFieldsValue({
|
|
8743
8714
|
priceExcludeTax: priceExcludeTax
|
|
8744
8715
|
});
|
|
8745
|
-
|
|
8716
|
+
_context9.next = 13;
|
|
8746
8717
|
return controller.setEditGood({
|
|
8747
8718
|
priceExcludeTax: priceExcludeTax
|
|
8748
8719
|
});
|
|
8749
8720
|
case 13:
|
|
8750
8721
|
case "end":
|
|
8751
|
-
return
|
|
8722
|
+
return _context9.stop();
|
|
8752
8723
|
}
|
|
8753
|
-
},
|
|
8724
|
+
}, _callee9);
|
|
8754
8725
|
}));
|
|
8755
|
-
return function (
|
|
8756
|
-
return
|
|
8726
|
+
return function (_x15, _x16) {
|
|
8727
|
+
return _ref9.apply(this, arguments);
|
|
8757
8728
|
};
|
|
8758
8729
|
}());
|
|
8759
8730
|
};
|
|
8760
8731
|
/** 不含税 => 更新(含税) */
|
|
8761
8732
|
var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
|
|
8762
8733
|
form.validateFields( /*#__PURE__*/function () {
|
|
8763
|
-
var
|
|
8734
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(err, values) {
|
|
8764
8735
|
var calculatingDigits, lineAmountExcludeTax, lineAmountIncludeTax, priceIncludeTax, taxAmount;
|
|
8765
|
-
return _regeneratorRuntime().wrap(function
|
|
8766
|
-
while (1) switch (
|
|
8736
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
8737
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
8767
8738
|
case 0:
|
|
8768
8739
|
err = err || {};
|
|
8769
8740
|
if (!(!err.taxRat && (values.taxRate || values.taxRate === 0) && !promptErr(err.lineAmountExcludeTax) && (values.lineAmountExcludeTax || values.lineAmountExcludeTax === 0))) {
|
|
8770
|
-
|
|
8741
|
+
_context10.next = 17;
|
|
8771
8742
|
break;
|
|
8772
8743
|
}
|
|
8773
8744
|
calculatingDigits = controller.state.calculatingDigits; // 金额(含税)= 金额(不含税)* (1+ 税率)
|
|
8774
8745
|
lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
|
|
8775
8746
|
lineAmountIncludeTax = format2(evaluate("".concat(lineAmountExcludeTax, " * (1+(").concat(values.taxRate, "/100))")));
|
|
8776
|
-
|
|
8747
|
+
_context10.next = 7;
|
|
8777
8748
|
return controller.setEditGood({
|
|
8778
8749
|
lineAmountIncludeTax: lineAmountIncludeTax
|
|
8779
8750
|
});
|
|
8780
8751
|
case 7:
|
|
8781
8752
|
if (!(!err.quantity && values.quantity)) {
|
|
8782
|
-
|
|
8753
|
+
_context10.next = 11;
|
|
8783
8754
|
break;
|
|
8784
8755
|
}
|
|
8785
8756
|
priceIncludeTax = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(values.quantity)), calculatingDigits);
|
|
8786
|
-
|
|
8757
|
+
_context10.next = 11;
|
|
8787
8758
|
return controller.setEditGood({
|
|
8788
8759
|
priceIncludeTax: priceIncludeTax
|
|
8789
8760
|
});
|
|
@@ -8793,176 +8764,176 @@ var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
|
|
|
8793
8764
|
form.setFieldsValue({
|
|
8794
8765
|
taxAmount: taxAmount
|
|
8795
8766
|
});
|
|
8796
|
-
|
|
8767
|
+
_context10.next = 15;
|
|
8797
8768
|
return controller.setEditGood({
|
|
8798
8769
|
taxAmount: taxAmount
|
|
8799
8770
|
});
|
|
8800
8771
|
case 15:
|
|
8801
|
-
|
|
8772
|
+
_context10.next = 20;
|
|
8802
8773
|
break;
|
|
8803
8774
|
case 17:
|
|
8804
8775
|
form.setFieldsValue({
|
|
8805
8776
|
taxAmount: undefined
|
|
8806
8777
|
});
|
|
8807
|
-
|
|
8778
|
+
_context10.next = 20;
|
|
8808
8779
|
return controller.setEditGood({
|
|
8809
8780
|
taxAmount: undefined
|
|
8810
8781
|
});
|
|
8811
8782
|
case 20:
|
|
8812
8783
|
case "end":
|
|
8813
|
-
return
|
|
8784
|
+
return _context10.stop();
|
|
8814
8785
|
}
|
|
8815
|
-
},
|
|
8786
|
+
}, _callee10);
|
|
8816
8787
|
}));
|
|
8817
|
-
return function (
|
|
8818
|
-
return
|
|
8788
|
+
return function (_x17, _x18) {
|
|
8789
|
+
return _ref10.apply(this, arguments);
|
|
8819
8790
|
};
|
|
8820
8791
|
}());
|
|
8821
8792
|
};
|
|
8822
8793
|
/** 单调赋码 */
|
|
8823
8794
|
var endowCode = /*#__PURE__*/function () {
|
|
8824
|
-
var
|
|
8825
|
-
return _regeneratorRuntime().wrap(function
|
|
8826
|
-
while (1) switch (
|
|
8795
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(controller, goods) {
|
|
8796
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
8797
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
8827
8798
|
case 0:
|
|
8828
|
-
|
|
8799
|
+
_context13.next = 2;
|
|
8829
8800
|
return controller.wait();
|
|
8830
8801
|
case 2:
|
|
8831
|
-
|
|
8802
|
+
_context13.next = 4;
|
|
8832
8803
|
return controller.saveEditGood();
|
|
8833
8804
|
case 4:
|
|
8834
|
-
|
|
8805
|
+
_context13.next = 6;
|
|
8835
8806
|
return controller.pipeline( /*#__PURE__*/function () {
|
|
8836
|
-
var
|
|
8807
|
+
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
|
|
8837
8808
|
var _s$goodsListState$edi;
|
|
8838
8809
|
var err, key, g, i;
|
|
8839
|
-
return _regeneratorRuntime().wrap(function
|
|
8840
|
-
while (1) switch (
|
|
8810
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
8811
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
8841
8812
|
case 0:
|
|
8842
8813
|
if (!(s.goodsListState.form && ((_s$goodsListState$edi = s.goodsListState.editGood) === null || _s$goodsListState$edi === void 0 ? void 0 : _s$goodsListState$edi.$index) === (goods === null || goods === void 0 ? void 0 : goods.$index))) {
|
|
8843
|
-
|
|
8814
|
+
_context12.next = 11;
|
|
8844
8815
|
break;
|
|
8845
8816
|
}
|
|
8846
8817
|
err = s.goodsListState.form.getFieldsError();
|
|
8847
|
-
|
|
8818
|
+
_context12.t0 = _regeneratorRuntime().keys(err);
|
|
8848
8819
|
case 3:
|
|
8849
|
-
if ((
|
|
8850
|
-
|
|
8820
|
+
if ((_context12.t1 = _context12.t0()).done) {
|
|
8821
|
+
_context12.next = 11;
|
|
8851
8822
|
break;
|
|
8852
8823
|
}
|
|
8853
|
-
key =
|
|
8824
|
+
key = _context12.t1.value;
|
|
8854
8825
|
if (err[key]) {
|
|
8855
|
-
|
|
8826
|
+
_context12.next = 7;
|
|
8856
8827
|
break;
|
|
8857
8828
|
}
|
|
8858
|
-
return
|
|
8829
|
+
return _context12.abrupt("continue", 3);
|
|
8859
8830
|
case 7:
|
|
8860
8831
|
ktsComponentsAntdX3.message.error(err[key][0]);
|
|
8861
|
-
return
|
|
8832
|
+
return _context12.abrupt("return");
|
|
8862
8833
|
case 11:
|
|
8863
8834
|
g = s.goodsListState.goodsMap.get(goods.$index);
|
|
8864
8835
|
i = s.goodsListState.goodsList.indexOf(g);
|
|
8865
|
-
|
|
8866
|
-
|
|
8836
|
+
_context12.t2 = goods.lineAttribute;
|
|
8837
|
+
_context12.next = _context12.t2 === LineAttributeType$1.正常 ? 16 : _context12.t2 === LineAttributeType$1.折扣行 ? 18 : _context12.t2 === LineAttributeType$1.被折扣行 ? 20 : 22;
|
|
8867
8838
|
break;
|
|
8868
8839
|
case 16:
|
|
8869
8840
|
s.goodsListState.endowCode.endowcodeGoodIndex = [goods.$index];
|
|
8870
|
-
return
|
|
8841
|
+
return _context12.abrupt("break", 22);
|
|
8871
8842
|
case 18:
|
|
8872
8843
|
s.goodsListState.endowCode.endowcodeGoodIndex = [goods.$index, s.goodsListState.goodsList[i - 1].$index];
|
|
8873
|
-
return
|
|
8844
|
+
return _context12.abrupt("break", 22);
|
|
8874
8845
|
case 20:
|
|
8875
8846
|
s.goodsListState.endowCode.endowcodeGoodIndex = [goods.$index, s.goodsListState.goodsList[i + 1].$index];
|
|
8876
|
-
return
|
|
8847
|
+
return _context12.abrupt("break", 22);
|
|
8877
8848
|
case 22:
|
|
8878
8849
|
case "end":
|
|
8879
|
-
return
|
|
8850
|
+
return _context12.stop();
|
|
8880
8851
|
}
|
|
8881
|
-
},
|
|
8852
|
+
}, _callee12);
|
|
8882
8853
|
}));
|
|
8883
|
-
return function (
|
|
8884
|
-
return
|
|
8854
|
+
return function (_x23) {
|
|
8855
|
+
return _ref13.apply(this, arguments);
|
|
8885
8856
|
};
|
|
8886
8857
|
}())();
|
|
8887
8858
|
case 6:
|
|
8888
8859
|
case "end":
|
|
8889
|
-
return
|
|
8860
|
+
return _context13.stop();
|
|
8890
8861
|
}
|
|
8891
|
-
},
|
|
8862
|
+
}, _callee13);
|
|
8892
8863
|
}));
|
|
8893
|
-
return function endowCode(
|
|
8894
|
-
return
|
|
8864
|
+
return function endowCode(_x21, _x22) {
|
|
8865
|
+
return _ref12.apply(this, arguments);
|
|
8895
8866
|
};
|
|
8896
8867
|
}();
|
|
8897
8868
|
/** 修改了 项目名称 */
|
|
8898
8869
|
var onChangeItemName = /*#__PURE__*/function () {
|
|
8899
|
-
var
|
|
8900
|
-
return _regeneratorRuntime().wrap(function
|
|
8901
|
-
while (1) switch (
|
|
8870
|
+
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(controller, form, record) {
|
|
8871
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
8872
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
8902
8873
|
case 0:
|
|
8903
8874
|
controller.run( /*#__PURE__*/function () {
|
|
8904
|
-
var
|
|
8875
|
+
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
|
|
8905
8876
|
var _getSN$shorthand, _getSN;
|
|
8906
8877
|
var value, shorthand;
|
|
8907
|
-
return _regeneratorRuntime().wrap(function
|
|
8908
|
-
while (1) switch (
|
|
8878
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
8879
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
8909
8880
|
case 0:
|
|
8910
8881
|
value = form.getFieldsValue().itemName;
|
|
8911
8882
|
shorthand = (_getSN$shorthand = (_getSN = getSN(value)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand) !== null && _getSN$shorthand !== void 0 ? _getSN$shorthand : '';
|
|
8912
8883
|
if (!s.goodsListState.isMyShow) {
|
|
8913
|
-
|
|
8884
|
+
_context14.next = 11;
|
|
8914
8885
|
break;
|
|
8915
8886
|
}
|
|
8916
|
-
|
|
8887
|
+
_context14.next = 5;
|
|
8917
8888
|
return controller.setEditGood({
|
|
8918
8889
|
itemNameSelf: value
|
|
8919
8890
|
});
|
|
8920
8891
|
case 5:
|
|
8921
|
-
|
|
8922
|
-
if (!
|
|
8923
|
-
|
|
8892
|
+
_context14.t0 = record.itemName;
|
|
8893
|
+
if (!_context14.t0) {
|
|
8894
|
+
_context14.next = 9;
|
|
8924
8895
|
break;
|
|
8925
8896
|
}
|
|
8926
|
-
|
|
8897
|
+
_context14.next = 9;
|
|
8927
8898
|
return controller.setEditGood({
|
|
8928
8899
|
itemName: setShorthand(record.itemName, shorthand)
|
|
8929
8900
|
});
|
|
8930
8901
|
case 9:
|
|
8931
|
-
|
|
8902
|
+
_context14.next = 17;
|
|
8932
8903
|
break;
|
|
8933
8904
|
case 11:
|
|
8934
|
-
|
|
8905
|
+
_context14.next = 13;
|
|
8935
8906
|
return controller.setEditGood({
|
|
8936
8907
|
itemName: value
|
|
8937
8908
|
});
|
|
8938
8909
|
case 13:
|
|
8939
|
-
|
|
8940
|
-
if (!
|
|
8941
|
-
|
|
8910
|
+
_context14.t1 = record.itemNameSelf;
|
|
8911
|
+
if (!_context14.t1) {
|
|
8912
|
+
_context14.next = 17;
|
|
8942
8913
|
break;
|
|
8943
8914
|
}
|
|
8944
|
-
|
|
8915
|
+
_context14.next = 17;
|
|
8945
8916
|
return controller.setEditGood({
|
|
8946
8917
|
itemNameSelf: setShorthand(record.itemNameSelf, shorthand)
|
|
8947
8918
|
});
|
|
8948
8919
|
case 17:
|
|
8949
8920
|
case "end":
|
|
8950
|
-
return
|
|
8921
|
+
return _context14.stop();
|
|
8951
8922
|
}
|
|
8952
|
-
},
|
|
8923
|
+
}, _callee14);
|
|
8953
8924
|
}));
|
|
8954
|
-
return function (
|
|
8955
|
-
return
|
|
8925
|
+
return function (_x27) {
|
|
8926
|
+
return _ref15.apply(this, arguments);
|
|
8956
8927
|
};
|
|
8957
8928
|
}());
|
|
8958
8929
|
case 1:
|
|
8959
8930
|
case "end":
|
|
8960
|
-
return
|
|
8931
|
+
return _context15.stop();
|
|
8961
8932
|
}
|
|
8962
|
-
},
|
|
8933
|
+
}, _callee15);
|
|
8963
8934
|
}));
|
|
8964
|
-
return function onChangeItemName(
|
|
8965
|
-
return
|
|
8935
|
+
return function onChangeItemName(_x24, _x25, _x26) {
|
|
8936
|
+
return _ref14.apply(this, arguments);
|
|
8966
8937
|
};
|
|
8967
8938
|
}();
|
|
8968
8939
|
|
|
@@ -9201,6 +9172,13 @@ var useColumns = (function (form) {
|
|
|
9201
9172
|
};
|
|
9202
9173
|
}());
|
|
9203
9174
|
}, []);
|
|
9175
|
+
var onNumberValueChange = React__default['default'].useCallback(function (e) {
|
|
9176
|
+
var _e$target;
|
|
9177
|
+
var value = e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value;
|
|
9178
|
+
if (value) {
|
|
9179
|
+
return value.replace(/[^0-9-\.]/g, '');
|
|
9180
|
+
}
|
|
9181
|
+
}, []);
|
|
9204
9182
|
/** 获取补充校验规则 */
|
|
9205
9183
|
var getReplenishRules = React__default['default'].useCallback(function (id) {
|
|
9206
9184
|
return columnsReplenish[id] ? columnsReplenish[id].rules || [] : [];
|
|
@@ -9412,6 +9390,7 @@ var useColumns = (function (form) {
|
|
|
9412
9390
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
9413
9391
|
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('quantity', {
|
|
9414
9392
|
initialValue: editGood.quantity,
|
|
9393
|
+
getValueFromEvent: onNumberValueChange,
|
|
9415
9394
|
rules: [].concat(_toConsumableArray(getReplenishRules('quantity')), [{
|
|
9416
9395
|
pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
|
|
9417
9396
|
message: '数量必须为数字'
|
|
@@ -9492,6 +9471,7 @@ var useColumns = (function (form) {
|
|
|
9492
9471
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
9493
9472
|
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('priceIncludeTax', {
|
|
9494
9473
|
initialValue: editGood.priceIncludeTax,
|
|
9474
|
+
getValueFromEvent: onNumberValueChange,
|
|
9495
9475
|
rules: [].concat(_toConsumableArray(getReplenishRules('priceIncludeTax')), [{
|
|
9496
9476
|
pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
|
|
9497
9477
|
message: '单价必须为数字'
|
|
@@ -9557,6 +9537,7 @@ var useColumns = (function (form) {
|
|
|
9557
9537
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
9558
9538
|
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('priceExcludeTax', {
|
|
9559
9539
|
initialValue: editGood.priceExcludeTax,
|
|
9540
|
+
getValueFromEvent: onNumberValueChange,
|
|
9560
9541
|
rules: [].concat(_toConsumableArray(getReplenishRules('priceExcludeTax')), [{
|
|
9561
9542
|
pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
|
|
9562
9543
|
message: '单价必须为数字'
|
|
@@ -9622,6 +9603,7 @@ var useColumns = (function (form) {
|
|
|
9622
9603
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
9623
9604
|
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('lineAmountIncludeTax', {
|
|
9624
9605
|
initialValue: editGood.lineAmountIncludeTax,
|
|
9606
|
+
getValueFromEvent: onNumberValueChange,
|
|
9625
9607
|
rules: [].concat(_toConsumableArray(getReplenishRules('lineAmountIncludeTax')), [{
|
|
9626
9608
|
required: true,
|
|
9627
9609
|
message: '金额不能为空'
|
|
@@ -9699,6 +9681,7 @@ var useColumns = (function (form) {
|
|
|
9699
9681
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
9700
9682
|
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('lineAmountExcludeTax', {
|
|
9701
9683
|
initialValue: editGood.lineAmountExcludeTax,
|
|
9684
|
+
getValueFromEvent: onNumberValueChange,
|
|
9702
9685
|
rules: [].concat(_toConsumableArray(getReplenishRules('lineAmountExcludeTax')), [{
|
|
9703
9686
|
required: true,
|
|
9704
9687
|
message: '金额不能为空'
|