kts-component-invoice-operate 3.2.177 → 3.2.179
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/digtal/FreightList/index.d.ts +2 -1
- package/dist/index.esm.js +62 -17
- package/dist/index.js +62 -17
- package/package.json +1 -1
- package/src/Invoice/Invoice-digtal/_test/freight/index.tsx +19 -8
- package/src/Invoice/InvoiceController/InvoiceControllerForm/index.ts +11 -1
- package/src/Invoice/ui/digtal/FreightList/index.tsx +7 -2
package/dist/index.esm.js
CHANGED
|
@@ -759,7 +759,7 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
|
|
|
759
759
|
var _validateFields2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
760
760
|
var _this3 = this;
|
|
761
761
|
|
|
762
|
-
var _errors, _values, arr, i, key, _yield$_validateField, errors, values, _this$state$goodsList;
|
|
762
|
+
var _errors, _values, arr, i, key, _yield$_validateField, errors, values, _this$state$goodsList, _this$state$freightLi;
|
|
763
763
|
|
|
764
764
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
765
765
|
while (1) {
|
|
@@ -817,7 +817,30 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
|
|
|
817
817
|
_errors.set('goodsList', _context.t0.errors);
|
|
818
818
|
|
|
819
819
|
case 27:
|
|
820
|
-
_values.set('goodsList', this.state.goodsListState.goodsList.slice());
|
|
820
|
+
_values.set('goodsList', this.state.goodsListState.goodsList.slice()); //货物运输列表
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
if (!this.state.freightListState.form) {
|
|
824
|
+
_context.next = 37;
|
|
825
|
+
break;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
_context.prev = 29;
|
|
829
|
+
_context.next = 32;
|
|
830
|
+
return (_this$state$freightLi = this.state.freightListState.form) === null || _this$state$freightLi === void 0 ? void 0 : _this$state$freightLi.validateFields();
|
|
831
|
+
|
|
832
|
+
case 32:
|
|
833
|
+
_context.next = 37;
|
|
834
|
+
break;
|
|
835
|
+
|
|
836
|
+
case 34:
|
|
837
|
+
_context.prev = 34;
|
|
838
|
+
_context.t1 = _context["catch"](29);
|
|
839
|
+
|
|
840
|
+
_errors.set('freightList', _context.t1.errors);
|
|
841
|
+
|
|
842
|
+
case 37:
|
|
843
|
+
_values.set('freightList', this.state.freightListState.goodsList.slice()); // 金额(含税)
|
|
821
844
|
|
|
822
845
|
|
|
823
846
|
_values.set('lineAmountIncludeTax', function () {
|
|
@@ -863,12 +886,12 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
|
|
|
863
886
|
values: _values
|
|
864
887
|
});
|
|
865
888
|
|
|
866
|
-
case
|
|
889
|
+
case 43:
|
|
867
890
|
case "end":
|
|
868
891
|
return _context.stop();
|
|
869
892
|
}
|
|
870
893
|
}
|
|
871
|
-
}, _callee, this, [[19, 24]]);
|
|
894
|
+
}, _callee, this, [[19, 24], [29, 34]]);
|
|
872
895
|
}));
|
|
873
896
|
|
|
874
897
|
function validateFields() {
|
|
@@ -25698,7 +25721,7 @@ var Main$4 = decorator(Form.create())(function (props) {
|
|
|
25698
25721
|
while (1) {
|
|
25699
25722
|
switch (_context3.prev = _context3.next) {
|
|
25700
25723
|
case 0:
|
|
25701
|
-
s.freightListState.
|
|
25724
|
+
s.freightListState.vehicleTypeList = props.vehicleTypeList;
|
|
25702
25725
|
|
|
25703
25726
|
case 1:
|
|
25704
25727
|
case "end":
|
|
@@ -25712,8 +25735,7 @@ var Main$4 = decorator(Form.create())(function (props) {
|
|
|
25712
25735
|
return _ref3.apply(this, arguments);
|
|
25713
25736
|
};
|
|
25714
25737
|
}());
|
|
25715
|
-
}, [props.
|
|
25716
|
-
|
|
25738
|
+
}, [props.vehicleTypeList]);
|
|
25717
25739
|
React.useEffect(function () {
|
|
25718
25740
|
controller.run( /*#__PURE__*/function () {
|
|
25719
25741
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
|
|
@@ -25721,12 +25743,9 @@ var Main$4 = decorator(Form.create())(function (props) {
|
|
|
25721
25743
|
while (1) {
|
|
25722
25744
|
switch (_context4.prev = _context4.next) {
|
|
25723
25745
|
case 0:
|
|
25724
|
-
s.freightListState.
|
|
25725
|
-
goodsList.forEach(function (e) {
|
|
25726
|
-
s.freightListState.goodsMap.set(e.$index, e);
|
|
25727
|
-
});
|
|
25746
|
+
s.freightListState.area = props.addressOptions;
|
|
25728
25747
|
|
|
25729
|
-
case
|
|
25748
|
+
case 1:
|
|
25730
25749
|
case "end":
|
|
25731
25750
|
return _context4.stop();
|
|
25732
25751
|
}
|
|
@@ -25738,19 +25757,21 @@ var Main$4 = decorator(Form.create())(function (props) {
|
|
|
25738
25757
|
return _ref4.apply(this, arguments);
|
|
25739
25758
|
};
|
|
25740
25759
|
}());
|
|
25741
|
-
}, [
|
|
25742
|
-
/** props 产品最大数 更新 */
|
|
25760
|
+
}, [props.addressOptions]); // 跟新 货物
|
|
25743
25761
|
|
|
25744
25762
|
React.useEffect(function () {
|
|
25745
|
-
controller.
|
|
25763
|
+
controller.run( /*#__PURE__*/function () {
|
|
25746
25764
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
|
|
25747
25765
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
25748
25766
|
while (1) {
|
|
25749
25767
|
switch (_context5.prev = _context5.next) {
|
|
25750
25768
|
case 0:
|
|
25751
|
-
s.freightListState.
|
|
25769
|
+
s.freightListState.goodsMap = new Map();
|
|
25770
|
+
goodsList.forEach(function (e) {
|
|
25771
|
+
s.freightListState.goodsMap.set(e.$index, e);
|
|
25772
|
+
});
|
|
25752
25773
|
|
|
25753
|
-
case
|
|
25774
|
+
case 2:
|
|
25754
25775
|
case "end":
|
|
25755
25776
|
return _context5.stop();
|
|
25756
25777
|
}
|
|
@@ -25761,6 +25782,30 @@ var Main$4 = decorator(Form.create())(function (props) {
|
|
|
25761
25782
|
return function (_x6) {
|
|
25762
25783
|
return _ref5.apply(this, arguments);
|
|
25763
25784
|
};
|
|
25785
|
+
}());
|
|
25786
|
+
}, [controller, goodsList]);
|
|
25787
|
+
/** props 产品最大数 更新 */
|
|
25788
|
+
|
|
25789
|
+
React.useEffect(function () {
|
|
25790
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
25791
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(s) {
|
|
25792
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
25793
|
+
while (1) {
|
|
25794
|
+
switch (_context6.prev = _context6.next) {
|
|
25795
|
+
case 0:
|
|
25796
|
+
s.freightListState.goodMax = props.goodMax;
|
|
25797
|
+
|
|
25798
|
+
case 1:
|
|
25799
|
+
case "end":
|
|
25800
|
+
return _context6.stop();
|
|
25801
|
+
}
|
|
25802
|
+
}
|
|
25803
|
+
}, _callee6);
|
|
25804
|
+
}));
|
|
25805
|
+
|
|
25806
|
+
return function (_x7) {
|
|
25807
|
+
return _ref6.apply(this, arguments);
|
|
25808
|
+
};
|
|
25764
25809
|
}())();
|
|
25765
25810
|
}, [controller, props.goodMax]); // 注册 form
|
|
25766
25811
|
// controller.useForm('freightInfo', form);
|
package/dist/index.js
CHANGED
|
@@ -769,7 +769,7 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
|
|
|
769
769
|
var _validateFields2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
770
770
|
var _this3 = this;
|
|
771
771
|
|
|
772
|
-
var _errors, _values, arr, i, key, _yield$_validateField, errors, values, _this$state$goodsList;
|
|
772
|
+
var _errors, _values, arr, i, key, _yield$_validateField, errors, values, _this$state$goodsList, _this$state$freightLi;
|
|
773
773
|
|
|
774
774
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
775
775
|
while (1) {
|
|
@@ -827,7 +827,30 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
|
|
|
827
827
|
_errors.set('goodsList', _context.t0.errors);
|
|
828
828
|
|
|
829
829
|
case 27:
|
|
830
|
-
_values.set('goodsList', this.state.goodsListState.goodsList.slice());
|
|
830
|
+
_values.set('goodsList', this.state.goodsListState.goodsList.slice()); //货物运输列表
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
if (!this.state.freightListState.form) {
|
|
834
|
+
_context.next = 37;
|
|
835
|
+
break;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
_context.prev = 29;
|
|
839
|
+
_context.next = 32;
|
|
840
|
+
return (_this$state$freightLi = this.state.freightListState.form) === null || _this$state$freightLi === void 0 ? void 0 : _this$state$freightLi.validateFields();
|
|
841
|
+
|
|
842
|
+
case 32:
|
|
843
|
+
_context.next = 37;
|
|
844
|
+
break;
|
|
845
|
+
|
|
846
|
+
case 34:
|
|
847
|
+
_context.prev = 34;
|
|
848
|
+
_context.t1 = _context["catch"](29);
|
|
849
|
+
|
|
850
|
+
_errors.set('freightList', _context.t1.errors);
|
|
851
|
+
|
|
852
|
+
case 37:
|
|
853
|
+
_values.set('freightList', this.state.freightListState.goodsList.slice()); // 金额(含税)
|
|
831
854
|
|
|
832
855
|
|
|
833
856
|
_values.set('lineAmountIncludeTax', function () {
|
|
@@ -873,12 +896,12 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
|
|
|
873
896
|
values: _values
|
|
874
897
|
});
|
|
875
898
|
|
|
876
|
-
case
|
|
899
|
+
case 43:
|
|
877
900
|
case "end":
|
|
878
901
|
return _context.stop();
|
|
879
902
|
}
|
|
880
903
|
}
|
|
881
|
-
}, _callee, this, [[19, 24]]);
|
|
904
|
+
}, _callee, this, [[19, 24], [29, 34]]);
|
|
882
905
|
}));
|
|
883
906
|
|
|
884
907
|
function validateFields() {
|
|
@@ -25708,7 +25731,7 @@ var Main$4 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
|
|
|
25708
25731
|
while (1) {
|
|
25709
25732
|
switch (_context3.prev = _context3.next) {
|
|
25710
25733
|
case 0:
|
|
25711
|
-
s.freightListState.
|
|
25734
|
+
s.freightListState.vehicleTypeList = props.vehicleTypeList;
|
|
25712
25735
|
|
|
25713
25736
|
case 1:
|
|
25714
25737
|
case "end":
|
|
@@ -25722,8 +25745,7 @@ var Main$4 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
|
|
|
25722
25745
|
return _ref3.apply(this, arguments);
|
|
25723
25746
|
};
|
|
25724
25747
|
}());
|
|
25725
|
-
}, [props.
|
|
25726
|
-
|
|
25748
|
+
}, [props.vehicleTypeList]);
|
|
25727
25749
|
React__default['default'].useEffect(function () {
|
|
25728
25750
|
controller.run( /*#__PURE__*/function () {
|
|
25729
25751
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
|
|
@@ -25731,12 +25753,9 @@ var Main$4 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
|
|
|
25731
25753
|
while (1) {
|
|
25732
25754
|
switch (_context4.prev = _context4.next) {
|
|
25733
25755
|
case 0:
|
|
25734
|
-
s.freightListState.
|
|
25735
|
-
goodsList.forEach(function (e) {
|
|
25736
|
-
s.freightListState.goodsMap.set(e.$index, e);
|
|
25737
|
-
});
|
|
25756
|
+
s.freightListState.area = props.addressOptions;
|
|
25738
25757
|
|
|
25739
|
-
case
|
|
25758
|
+
case 1:
|
|
25740
25759
|
case "end":
|
|
25741
25760
|
return _context4.stop();
|
|
25742
25761
|
}
|
|
@@ -25748,19 +25767,21 @@ var Main$4 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
|
|
|
25748
25767
|
return _ref4.apply(this, arguments);
|
|
25749
25768
|
};
|
|
25750
25769
|
}());
|
|
25751
|
-
}, [
|
|
25752
|
-
/** props 产品最大数 更新 */
|
|
25770
|
+
}, [props.addressOptions]); // 跟新 货物
|
|
25753
25771
|
|
|
25754
25772
|
React__default['default'].useEffect(function () {
|
|
25755
|
-
controller.
|
|
25773
|
+
controller.run( /*#__PURE__*/function () {
|
|
25756
25774
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
|
|
25757
25775
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
25758
25776
|
while (1) {
|
|
25759
25777
|
switch (_context5.prev = _context5.next) {
|
|
25760
25778
|
case 0:
|
|
25761
|
-
s.freightListState.
|
|
25779
|
+
s.freightListState.goodsMap = new Map();
|
|
25780
|
+
goodsList.forEach(function (e) {
|
|
25781
|
+
s.freightListState.goodsMap.set(e.$index, e);
|
|
25782
|
+
});
|
|
25762
25783
|
|
|
25763
|
-
case
|
|
25784
|
+
case 2:
|
|
25764
25785
|
case "end":
|
|
25765
25786
|
return _context5.stop();
|
|
25766
25787
|
}
|
|
@@ -25771,6 +25792,30 @@ var Main$4 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
|
|
|
25771
25792
|
return function (_x6) {
|
|
25772
25793
|
return _ref5.apply(this, arguments);
|
|
25773
25794
|
};
|
|
25795
|
+
}());
|
|
25796
|
+
}, [controller, goodsList]);
|
|
25797
|
+
/** props 产品最大数 更新 */
|
|
25798
|
+
|
|
25799
|
+
React__default['default'].useEffect(function () {
|
|
25800
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
25801
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(s) {
|
|
25802
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
25803
|
+
while (1) {
|
|
25804
|
+
switch (_context6.prev = _context6.next) {
|
|
25805
|
+
case 0:
|
|
25806
|
+
s.freightListState.goodMax = props.goodMax;
|
|
25807
|
+
|
|
25808
|
+
case 1:
|
|
25809
|
+
case "end":
|
|
25810
|
+
return _context6.stop();
|
|
25811
|
+
}
|
|
25812
|
+
}
|
|
25813
|
+
}, _callee6);
|
|
25814
|
+
}));
|
|
25815
|
+
|
|
25816
|
+
return function (_x7) {
|
|
25817
|
+
return _ref6.apply(this, arguments);
|
|
25818
|
+
};
|
|
25774
25819
|
}())();
|
|
25775
25820
|
}, [controller, props.goodMax]); // 注册 form
|
|
25776
25821
|
// controller.useForm('freightInfo', form);
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ import 'antd/dist/antd.css';
|
|
|
6
6
|
export default () => {
|
|
7
7
|
|
|
8
8
|
const controller = React.useMemo(() => new Invoice.InvoiceController(), []);
|
|
9
|
-
const area=React.useMemo(() => [
|
|
9
|
+
const area = React.useMemo(() => [
|
|
10
10
|
{
|
|
11
11
|
"code": "11",
|
|
12
12
|
"name": "北京市",
|
|
@@ -14545,12 +14545,12 @@ export default () => {
|
|
|
14545
14545
|
React.useEffect(() => {
|
|
14546
14546
|
controller.run(async s => {
|
|
14547
14547
|
// await controller.run(async s => { s.model = 'readOnly' }); // 设置只读
|
|
14548
|
-
controller.state.freightListState.vehicleTypeList = [
|
|
14549
|
-
|
|
14550
|
-
];
|
|
14551
|
-
controller.state.freightListState.area=area;
|
|
14552
|
-
controller.state.freightListState.addressFieldNames={label:'name',value:'name',children:'children'}
|
|
14553
|
-
controller.state.freightListState.goodsList=[{$index:'222',type:'RAILWAY',itemName:'咖啡机',licensePlate:'渝bkb190',origin:['北京','市辖区','东城区'],destination:['北京','市辖区','东城区']}]
|
|
14548
|
+
// controller.state.freightListState.vehicleTypeList = [
|
|
14549
|
+
// { label: '铁路运输', value: 'RAILWAY' }
|
|
14550
|
+
// ];
|
|
14551
|
+
// controller.state.freightListState.area=area;
|
|
14552
|
+
// controller.state.freightListState.addressFieldNames={label:'name',value:'name',children:'children'}
|
|
14553
|
+
controller.state.freightListState.goodsList = [{ $index: '222', type: 'RAILWAY', itemName: '咖啡机', licensePlate: '渝bkb190', origin: ['北京', '市辖区', '东城区'], destination: ['北京', '市辖区', '东城区'] }]
|
|
14554
14554
|
})
|
|
14555
14555
|
}, [])
|
|
14556
14556
|
|
|
@@ -14558,7 +14558,18 @@ export default () => {
|
|
|
14558
14558
|
<Invoice
|
|
14559
14559
|
invoiceType='digtal'
|
|
14560
14560
|
controller={controller}
|
|
14561
|
-
specialInfor={<Invoice.FreightList
|
|
14561
|
+
specialInfor={<Invoice.FreightList
|
|
14562
|
+
vehicleTypeList={[
|
|
14563
|
+
{ label: '铁路运输', value: 'RAILWAY' }
|
|
14564
|
+
]}
|
|
14565
|
+
addressOptions={area}
|
|
14566
|
+
fieldNames={{
|
|
14567
|
+
label: 'name',
|
|
14568
|
+
value: 'name',
|
|
14569
|
+
children: 'children'
|
|
14570
|
+
}}
|
|
14571
|
+
/>
|
|
14572
|
+
}
|
|
14562
14573
|
/>
|
|
14563
14574
|
)
|
|
14564
14575
|
};
|
|
@@ -45,8 +45,18 @@ export default class InvoiceControllerForm extends GreyReactBox<InvoiceControlle
|
|
|
45
45
|
_errors.set('goodsList', error.errors);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
|
|
49
49
|
_values.set('goodsList', this.state.goodsListState.goodsList.slice());
|
|
50
|
+
//货物运输列表
|
|
51
|
+
if (this.state.freightListState.form) {
|
|
52
|
+
try {
|
|
53
|
+
await this.state.freightListState.form?.validateFields()
|
|
54
|
+
} catch (error: any) {
|
|
55
|
+
_errors.set('freightList', error.errors);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
_values.set('freightList', this.state.freightListState.goodsList.slice());
|
|
50
60
|
|
|
51
61
|
// 金额(含税)
|
|
52
62
|
_values.set('lineAmountIncludeTax', (() => {
|
|
@@ -26,9 +26,9 @@ export interface IGoodsListProps {
|
|
|
26
26
|
goodMax?: number;
|
|
27
27
|
|
|
28
28
|
addressOptions: any[];
|
|
29
|
-
|
|
29
|
+
vehicleTypeList:any[];
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* 地址数据字段名
|
|
32
32
|
*/
|
|
33
33
|
fieldNames?: any;
|
|
34
34
|
|
|
@@ -68,6 +68,11 @@ const Main = decorator<IGoodsListProps, FormComponentProps & IGoodsListProps>(Fo
|
|
|
68
68
|
s.freightListState.addressFieldNames = props.fieldNames
|
|
69
69
|
});
|
|
70
70
|
}, [props.fieldNames])
|
|
71
|
+
React.useEffect(() => {
|
|
72
|
+
controller.run(async (s) => {
|
|
73
|
+
s.freightListState.vehicleTypeList = props.vehicleTypeList
|
|
74
|
+
});
|
|
75
|
+
}, [props.vehicleTypeList])
|
|
71
76
|
React.useEffect(() => {
|
|
72
77
|
controller.run(async (s) => {
|
|
73
78
|
s.freightListState.area = props.addressOptions
|