kts-component-invoice-operate 3.2.247 → 3.2.248

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.js CHANGED
@@ -1186,6 +1186,40 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
1186
1186
  this.addComparisonIndex = void 0;
1187
1187
  this.drag = new Drag();
1188
1188
  this.isValidateGood = true;
1189
+ this.isValidateMeiTan = true;
1190
+ this.meiTanGoodIndex = [];
1191
+
1192
+ this.verifyMeiTanFn = /*#__PURE__*/function () {
1193
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(record) {
1194
+ var taxClassificationCode;
1195
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1196
+ while (1) {
1197
+ switch (_context.prev = _context.next) {
1198
+ case 0:
1199
+ taxClassificationCode = record.taxClassificationCode;
1200
+
1201
+ if (!(taxClassificationCode === '1020101000000000000' || taxClassificationCode === '1020102000000000000' || taxClassificationCode === '1020199000000000000')) {
1202
+ _context.next = 3;
1203
+ break;
1204
+ }
1205
+
1206
+ return _context.abrupt("return", true);
1207
+
1208
+ case 3:
1209
+ return _context.abrupt("return", false);
1210
+
1211
+ case 4:
1212
+ case "end":
1213
+ return _context.stop();
1214
+ }
1215
+ }
1216
+ }, _callee);
1217
+ }));
1218
+
1219
+ return function (_x) {
1220
+ return _ref.apply(this, arguments);
1221
+ };
1222
+ }();
1189
1223
  });
1190
1224
 
1191
1225
  var FreightListState = /*#__PURE__*/_createClass(function FreightListState() {
@@ -29876,7 +29910,8 @@ var DrawerBody$2 = function DrawerBody() {
29876
29910
 
29877
29911
  editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), {}, {
29878
29912
  itemModelName: undefined,
29879
- itemModelNameSelf: undefined
29913
+ itemModelNameSelf: undefined,
29914
+ mtzlDm: undefined
29880
29915
  }, between);
29881
29916
 
29882
29917
  if (editGood.taxRate) {
@@ -29926,6 +29961,25 @@ var DrawerBody$2 = function DrawerBody() {
29926
29961
  return updateUnitPriceTax(controller, s.goodsListState.form, record);
29927
29962
 
29928
29963
  case 28:
29964
+ if (!s.goodsListState.isValidateMeiTan) {
29965
+ _context2.next = 34;
29966
+ break;
29967
+ }
29968
+
29969
+ _context2.next = 31;
29970
+ return s.goodsListState.verifyMeiTanFn(record);
29971
+
29972
+ case 31:
29973
+ _context2.t1 = _context2.sent;
29974
+
29975
+ if (!(_context2.t1 === true)) {
29976
+ _context2.next = 34;
29977
+ break;
29978
+ }
29979
+
29980
+ s.goodsListState.meiTanGoodIndex = [editGood.$index];
29981
+
29982
+ case 34:
29929
29983
  case "end":
29930
29984
  return _context2.stop();
29931
29985
  }
@@ -30812,7 +30866,9 @@ var DrawerBody$3 = function DrawerBody(props) {
30812
30866
  good.taxRate = values.taxRate;
30813
30867
  good.taxFreeType = values.taxFreeType;
30814
30868
  good.favouredPolicyMark = values.favouredPolicyMark;
30815
- good.favouredPolicyName = values.favouredPolicyName; // 无论是否含税,都保持价税合计不变
30869
+ good.favouredPolicyName = values.favouredPolicyName;
30870
+ good.mtzlDm = undefined; //设置成空
30871
+ // 无论是否含税,都保持价税合计不变
30816
30872
 
30817
30873
  good.taxAmount = countTaxAmount(good.lineAmountIncludeTax || 0, s.goodsListState.deduction, values.taxRate);
30818
30874
 
@@ -30827,10 +30883,30 @@ var DrawerBody$3 = function DrawerBody(props) {
30827
30883
 
30828
30884
  good.goodsTaxRateList = goodsTaxRateList;
30829
30885
  });
30830
- s.goodsListState.goodsList = s.goodsListState.goodsList.slice();
30886
+ s.goodsListState.goodsList = s.goodsListState.goodsList.slice(); // 煤炭类判断
30887
+
30888
+ if (!s.goodsListState.isValidateMeiTan) {
30889
+ _context15.next = 9;
30890
+ break;
30891
+ }
30892
+
30893
+ _context15.next = 6;
30894
+ return s.goodsListState.verifyMeiTanFn(values);
30895
+
30896
+ case 6:
30897
+ _context15.t0 = _context15.sent;
30898
+
30899
+ if (!(_context15.t0 === true)) {
30900
+ _context15.next = 9;
30901
+ break;
30902
+ }
30903
+
30904
+ s.goodsListState.meiTanGoodIndex = s.goodsListState.endowCode.endowcodeGoodIndex.slice();
30905
+
30906
+ case 9:
30831
30907
  s.goodsListState.endowCode.endowcodeGoodIndex = [];
30832
30908
 
30833
- case 4:
30909
+ case 10:
30834
30910
  case "end":
30835
30911
  return _context15.stop();
30836
30912
  }
@@ -31200,6 +31276,218 @@ function AddComparisonDrawer() {
31200
31276
  // })
31201
31277
  // }
31202
31278
 
31279
+ var css_248z$A = ".kts-invoice-operate-meitan-modal {\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-meitan-modal .kts-invoice-operate-meitan-title {\n line-height: 30px;\n}\n.kts-invoice-operate-meitan-modal .kts-invoice-operate-meitan-title .kts-invoice-operate-meitan-title2 {\n margin-left: 24px;\n}\n.kts-invoice-operate-meitan-modal .kts-invoice-operate-meitan-content {\n margin-top: 20px;\n padding: 20px;\n background-color: #f9fafd;\n}\n.kts-invoice-operate-meitan-modal .kts-invoice-operate-meitan-content .content-item {\n background-color: #fff;\n margin: 20px 24px;\n padding: 20px;\n}\n.kts-invoice-operate-meitan-modal .ktsAntX-space-item {\n margin: 5px 0;\n}\n.kts-invoice-operate-meitan-modal .ktsAntX-form-item-explain {\n margin-top: 20px;\n}\n.kts-invoice-operate-meitan-button {\n display: flex!important;\n justify-content: center;\n align-items: center;\n padding: 2px 20px!important;\n}\n";
31280
+ styleInject(css_248z$A);
31281
+
31282
+ var MeiTanModal = (function () {
31283
+ var controller = Invoice.useInvoiceController();
31284
+
31285
+ var _Form$useForm = ktsComponentsAntdX4.Form.useForm(),
31286
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
31287
+ form = _Form$useForm2[0];
31288
+
31289
+ var _React$useState = React__default['default'].useState(null),
31290
+ _React$useState2 = _slicedToArray(_React$useState, 2),
31291
+ mainOption = _React$useState2[0],
31292
+ setMainOption = _React$useState2[1]; // 监听煤炭种类变化
31293
+
31294
+
31295
+ var mtzlDm = ktsComponentsAntdX4.Form.useWatch('mtzlDm', form);
31296
+ var visible = controller.useMemo(function (s) {
31297
+ return s.goodsListState.meiTanGoodIndex && s.goodsListState.meiTanGoodIndex.length > 0;
31298
+ }, []);
31299
+ var onClose = React__default['default'].useCallback(function () {
31300
+ controller.pipeline( /*#__PURE__*/function () {
31301
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
31302
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
31303
+ while (1) {
31304
+ switch (_context.prev = _context.next) {
31305
+ case 0:
31306
+ s.goodsListState.meiTanGoodIndex = [];
31307
+ form.setFieldsValue({
31308
+ mtzlDm: undefined
31309
+ });
31310
+ setMainOption(null);
31311
+
31312
+ case 3:
31313
+ case "end":
31314
+ return _context.stop();
31315
+ }
31316
+ }
31317
+ }, _callee);
31318
+ }));
31319
+
31320
+ return function (_x) {
31321
+ return _ref.apply(this, arguments);
31322
+ };
31323
+ }())();
31324
+ }, [controller]); // 提交表单
31325
+
31326
+ var onSubmit = function onSubmit() {
31327
+ form.submit();
31328
+ }; // 表单
31329
+
31330
+
31331
+ var onFinish = function onFinish(values) {
31332
+ console.log('煤炭种类:', values);
31333
+ controller.pipeline( /*#__PURE__*/function () {
31334
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
31335
+ var _s$goodsListState$mei;
31336
+
31337
+ var mtzl, goods, editGood, editGoodIndex;
31338
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
31339
+ while (1) {
31340
+ switch (_context2.prev = _context2.next) {
31341
+ case 0:
31342
+ mtzl = values.mtzlDm;
31343
+ goods = ((_s$goodsListState$mei = s.goodsListState.meiTanGoodIndex) === null || _s$goodsListState$mei === void 0 ? void 0 : _s$goodsListState$mei.map(function (e) {
31344
+ return s.goodsListState.goodsMap.get(e);
31345
+ })) || [];
31346
+ editGood = s.goodsListState.editGood;
31347
+ editGoodIndex = editGood === null || editGood === void 0 ? void 0 : editGood.$index;
31348
+ goods.forEach(function (g) {
31349
+ if (!g) return;
31350
+
31351
+ if (g.lineAttribute === LineAttributeType$1.被折扣行 || g.lineAttribute === LineAttributeType$1.正常) {
31352
+ g.mtzlDm = mtzl;
31353
+
31354
+ if (editGood && editGoodIndex === g.$index) {
31355
+ // 编辑行
31356
+ editGood.mtzlDm = mtzl;
31357
+ }
31358
+ }
31359
+ });
31360
+ s.goodsListState.goodsList = s.goodsListState.goodsList.slice();
31361
+ onClose();
31362
+
31363
+ case 7:
31364
+ case "end":
31365
+ return _context2.stop();
31366
+ }
31367
+ }
31368
+ }, _callee2);
31369
+ }));
31370
+
31371
+ return function (_x2) {
31372
+ return _ref2.apply(this, arguments);
31373
+ };
31374
+ }())();
31375
+ }; // 自定义校验规则
31376
+
31377
+
31378
+ var validateOption = function validateOption(_, value, callback) {
31379
+ console.log('自定义校验规则:', value);
31380
+
31381
+ if (!value) {
31382
+ return Promise.reject(new Error('请选择选项')); // callback('请选择选项');
31383
+ }
31384
+
31385
+ if (value === '0200') {
31386
+ return Promise.reject(new Error('请选择长协煤的子选项'));
31387
+ }
31388
+
31389
+ return Promise.resolve();
31390
+ };
31391
+
31392
+ var handleMainOptionChange = function handleMainOptionChange(e) {
31393
+ var value = e.target.value;
31394
+ setMainOption(value);
31395
+
31396
+ if (value === 'A' || value === 'C') {
31397
+ form.setFieldsValue({
31398
+ mtzlDm: value
31399
+ });
31400
+ } else if (value === 'B') {
31401
+ form.setFieldsValue({
31402
+ mtzlDm: undefined
31403
+ }); // 清空option,等待选择子选项
31404
+ }
31405
+ };
31406
+
31407
+ return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Modal, {
31408
+ title: "\u6E29\u99A8\u63D0\u793A",
31409
+ destroyOnClose: true,
31410
+ width: 700,
31411
+ onCancel: onClose,
31412
+ visible: visible,
31413
+ footer: /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Space, {
31414
+ align: 'end',
31415
+ style: {
31416
+ paddingRight: 20
31417
+ }
31418
+ }, /*#__PURE__*/React__default['default'].createElement(ktsXui.Button, {
31419
+ onClick: onClose,
31420
+ className: 'kts-invoice-operate-meitan-button'
31421
+ }, "\u53D6\u6D88"), /*#__PURE__*/React__default['default'].createElement(ktsXui.Button, {
31422
+ type: "primary",
31423
+ onClick: onSubmit,
31424
+ className: 'kts-invoice-operate-meitan-button'
31425
+ }, "\u786E\u5B9A"))
31426
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
31427
+ className: 'kts-invoice-operate-meitan-modal'
31428
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
31429
+ className: 'kts-invoice-operate-meitan-title'
31430
+ }, /*#__PURE__*/React__default['default'].createElement("div", null, "\u5C0A\u656C\u7684\u7EB3\u7A0E\u4EBA:"), /*#__PURE__*/React__default['default'].createElement("div", {
31431
+ className: 'kts-invoice-operate-meitan-title2'
31432
+ }, "\u60A8\u9009\u62E9\u4E86\u201C\u7164\u70AD\u201D\u7C7B\u5546\u54C1\u7F16\u7801\uFF0C\u8BF7\u6839\u636E\u771F\u5B9E\u4E1A\u52A1\u60C5\u51B5\u9009\u62E9 \u201C\u7164\u70AD\u79CD\u7C7B\u201D\uFF1A")), /*#__PURE__*/React__default['default'].createElement("div", {
31433
+ className: 'kts-invoice-operate-meitan-content'
31434
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Form, {
31435
+ form: form,
31436
+ layout: "vertical",
31437
+ initialValues: {
31438
+ mtzlDm: null
31439
+ },
31440
+ onFinish: onFinish
31441
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Form.Item, {
31442
+ name: "mtzlDm",
31443
+ label: "",
31444
+ rules: [// { required: true , message: '请选择煤炭种类' },
31445
+ {
31446
+ validator: validateOption
31447
+ }]
31448
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Radio.Group, {
31449
+ value: mainOption,
31450
+ onChange: handleMainOptionChange
31451
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Space, {
31452
+ direction: "vertical"
31453
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Radio, {
31454
+ value: "0100"
31455
+ }, "\u653F\u5E9C\u4FDD\u4F9B\u7164"), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Radio, {
31456
+ value: "0200"
31457
+ }, "\u957F\u534F\u7164"), mainOption === '0200' && /*#__PURE__*/React__default['default'].createElement("div", {
31458
+ className: 'content-item'
31459
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
31460
+ style: {
31461
+ marginBottom: 8,
31462
+ color: '#666',
31463
+ fontSize: 14
31464
+ }
31465
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
31466
+ style: {
31467
+ color: 'red'
31468
+ }
31469
+ }, "*"), "\u8BF7\u9009\u62E9\u534F\u8BAE\u671F\u9650\uFF1A"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Radio.Group, {
31470
+ value: mtzlDm,
31471
+ onChange: function onChange(e) {
31472
+ return form.setFieldsValue({
31473
+ mtzlDm: e.target.value
31474
+ });
31475
+ }
31476
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Space, {
31477
+ direction: "vertical"
31478
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Radio, {
31479
+ value: "0201"
31480
+ }, "\u534F\u8BAE\u671F\u4E0D\u8DB3\u534A\u5E74"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Radio, {
31481
+ value: "0202"
31482
+ }, "\u534F\u8BAE\u671F\u5728\u534A\u5E74\u81F3\u4E00\u5E74\u4E4B\u95F4"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Radio, {
31483
+ value: "0203"
31484
+ }, "\u534F\u8BAE\u671F\u5728\u4E00\u5E74\u81F3\u4E24\u5E74\u4E4B\u95F4"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Radio, {
31485
+ value: "0204"
31486
+ }, "\u534F\u8BAE\u671F\u5728\u4E24\u5E74\u4EE5\u4E0A"))))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Radio, {
31487
+ value: "0300"
31488
+ }, "\u5E02\u573A\u7164"))))))));
31489
+ });
31490
+
31203
31491
  // const config = {
31204
31492
  // number: 'BigNumber',
31205
31493
  // precision: 64,
@@ -31343,7 +31631,7 @@ var Main$6 = function Main(props) {
31343
31631
  /** 销售方 */
31344
31632
  , props.sign || /*#__PURE__*/React__default['default'].createElement(Sign, null)
31345
31633
  /** 落款 */
31346
- , props.footExpand), /*#__PURE__*/React__default['default'].createElement(ImportBuyerDrawer, null), /*#__PURE__*/React__default['default'].createElement(ImportGoodsDrawer, null), /*#__PURE__*/React__default['default'].createElement(EndowCodeDrawer, null), /*#__PURE__*/React__default['default'].createElement(AddComparisonDrawer, null));
31634
+ , props.footExpand), /*#__PURE__*/React__default['default'].createElement(ImportBuyerDrawer, null), /*#__PURE__*/React__default['default'].createElement(ImportGoodsDrawer, null), /*#__PURE__*/React__default['default'].createElement(EndowCodeDrawer, null), /*#__PURE__*/React__default['default'].createElement(AddComparisonDrawer, null), /*#__PURE__*/React__default['default'].createElement(MeiTanModal, null), " ");
31347
31635
  };
31348
31636
  /** 数电 */
31349
31637
 
@@ -31399,11 +31687,11 @@ var Digtal = function Digtal(props) {
31399
31687
  /** 特殊信息 */
31400
31688
  , props.sign || /*#__PURE__*/React__default['default'].createElement(SignDigtal, null)
31401
31689
  /** 落款 */
31402
- ), /*#__PURE__*/React__default['default'].createElement(ImportGoodsDrawer, null), /*#__PURE__*/React__default['default'].createElement(EndowCodeDrawer, null));
31690
+ ), /*#__PURE__*/React__default['default'].createElement(ImportGoodsDrawer, null), /*#__PURE__*/React__default['default'].createElement(EndowCodeDrawer, null), /*#__PURE__*/React__default['default'].createElement(MeiTanModal, null), " ");
31403
31691
  };
31404
31692
 
31405
- var css_248z$A = ".taxdetailsbox {\n display: flex;\n justify-content: flex-start;\n flex-direction: row;\n}\n.taxdetailsbox .taxrightbox {\n width: 340px;\n position: absolute;\n right: 30px;\n top: 79px;\n bottom: 50px;\n min-height: 300px;\n}\n.taxdetailsbox .taxrightbox .taxdesc {\n height: calc(100vh - 323px);\n min-height: 105px;\n overflow: auto;\n}\n";
31406
- styleInject(css_248z$A);
31693
+ var css_248z$B = ".taxdetailsbox {\n display: flex;\n justify-content: flex-start;\n flex-direction: row;\n}\n.taxdetailsbox .taxrightbox {\n width: 340px;\n position: absolute;\n right: 30px;\n top: 79px;\n bottom: 50px;\n min-height: 300px;\n}\n.taxdetailsbox .taxrightbox .taxdesc {\n height: calc(100vh - 323px);\n min-height: 105px;\n overflow: auto;\n}\n";
31694
+ styleInject(css_248z$B);
31407
31695
 
31408
31696
  function TaxClassificationModal(props) {
31409
31697
  var _props$info6;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.247",
3
+ "version": "3.2.248",
4
4
  "scripts": {
5
5
  "dev": "dumi dev --max-old-space-size=6096",
6
6
  "start": "dumi dev",