kts-component-invoice-operate 3.2.262 → 3.2.264
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/components/CustomCascader/index.d.ts +1 -0
- package/dist/index.esm.js +147 -53
- package/dist/index.js +147 -53
- package/package.json +1 -1
- package/src/Invoice/Invoice-digtal/_test/passenger/index.tsx +27 -7
- package/src/Invoice/ui/components/CustomCascader/index.tsx +3 -0
- package/src/Invoice/ui/default/ImportPassengerDrawer/index.tsx +0 -6
- package/src/Invoice/ui/digtal/PassengerList/hook/useColumns/index.tsx +3 -2
- package/src/Invoice/ui/digtal/PassengerList/index.less +8 -4
- package/src/Invoice/ui/digtal/PassengerList/index.tsx +8 -9
- package/src/Invoice/ui/digtal/Stakeholder/index.tsx +100 -14
|
@@ -12,6 +12,7 @@ export interface CustomCascaderProps extends Omit<CascaderProps<CustomCascaderOp
|
|
|
12
12
|
options?: CustomCascaderOption[];
|
|
13
13
|
fieldNames?: CustomCascaderFieldNames;
|
|
14
14
|
placeholder?: string;
|
|
15
|
+
maxLength?: number;
|
|
15
16
|
onChange?: (value: (string | number)[] | undefined, selectedOptions?: CustomCascaderOption[]) => void;
|
|
16
17
|
value?: (string | number)[];
|
|
17
18
|
onBlur?: (e: React.FocusEvent) => void;
|
package/dist/index.esm.js
CHANGED
|
@@ -19711,6 +19711,24 @@ var formatCompanyName = function formatCompanyName(e) {
|
|
|
19711
19711
|
if (value) {
|
|
19712
19712
|
return value.replace('(', '(').replace(')', ')').replace(' ', '');
|
|
19713
19713
|
}
|
|
19714
|
+
}; // 参与自然人联动的字段
|
|
19715
|
+
|
|
19716
|
+
|
|
19717
|
+
var GROUP_FIELDS = ['certificateType', 'certificateNumber', 'nationality']; // 各字段为空时的提示
|
|
19718
|
+
|
|
19719
|
+
var EMPTY_MSG = {
|
|
19720
|
+
certificateType: '请选择证件类型',
|
|
19721
|
+
certificateNumber: '请输入证件号码',
|
|
19722
|
+
nationality: '请选择国籍'
|
|
19723
|
+
};
|
|
19724
|
+
var NO_ERROR = {
|
|
19725
|
+
certificateType: '',
|
|
19726
|
+
certificateNumber: '',
|
|
19727
|
+
nationality: ''
|
|
19728
|
+
};
|
|
19729
|
+
|
|
19730
|
+
var isEmpty = function isEmpty(v) {
|
|
19731
|
+
return v === undefined || v === null || typeof v === 'string' && v.trim() === '';
|
|
19714
19732
|
};
|
|
19715
19733
|
/** 干系人 */
|
|
19716
19734
|
|
|
@@ -19749,6 +19767,11 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
|
|
|
19749
19767
|
nationInfo = _React$useState10[0],
|
|
19750
19768
|
setNation = _React$useState10[1];
|
|
19751
19769
|
|
|
19770
|
+
var _React$useState11 = React.useState(NO_ERROR),
|
|
19771
|
+
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
19772
|
+
errors = _React$useState12[0],
|
|
19773
|
+
setErrors = _React$useState12[1];
|
|
19774
|
+
|
|
19752
19775
|
var getFieldDecorator = form.getFieldDecorator;
|
|
19753
19776
|
var controller = Invoice.useInvoiceController();
|
|
19754
19777
|
var model = controller.useMemo(function (s) {
|
|
@@ -19806,6 +19829,74 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
|
|
|
19806
19829
|
React.useEffect(function () {
|
|
19807
19830
|
setExpand(typeof props.isExpand === 'boolean' ? props.isExpand : true);
|
|
19808
19831
|
}, [props.isExpand]);
|
|
19832
|
+
/**
|
|
19833
|
+
* 生成校验器:三个字段要么全空,要么全不空
|
|
19834
|
+
* @param {string} field 当前被校验的字段名
|
|
19835
|
+
*/
|
|
19836
|
+
|
|
19837
|
+
var createGroupValidator = function createGroupValidator(field) {
|
|
19838
|
+
return function (rule, value, callback) {
|
|
19839
|
+
var getFieldValue = form.getFieldValue; // 实时读取三个字段的当前值
|
|
19840
|
+
|
|
19841
|
+
var values = GROUP_FIELDS.map(function (name) {
|
|
19842
|
+
return getFieldValue(name);
|
|
19843
|
+
});
|
|
19844
|
+
var filledCount = values.filter(function (v) {
|
|
19845
|
+
return !isEmpty(v);
|
|
19846
|
+
}).length; // 情况一:全空 —— 通过
|
|
19847
|
+
|
|
19848
|
+
if (filledCount === 0) {
|
|
19849
|
+
return callback();
|
|
19850
|
+
} // 情况二:全不空 —— 通过
|
|
19851
|
+
|
|
19852
|
+
|
|
19853
|
+
if (filledCount === GROUP_FIELDS.length) {
|
|
19854
|
+
return callback();
|
|
19855
|
+
} // 情况三:部分填写 —— 为空的字段报错
|
|
19856
|
+
|
|
19857
|
+
|
|
19858
|
+
if (isEmpty(value)) {
|
|
19859
|
+
return Promise.reject(EMPTY_MSG[field]);
|
|
19860
|
+
}
|
|
19861
|
+
|
|
19862
|
+
callback();
|
|
19863
|
+
};
|
|
19864
|
+
};
|
|
19865
|
+
/** 根据三个字段当前值计算错误 */
|
|
19866
|
+
|
|
19867
|
+
|
|
19868
|
+
var calcErrors = function calcErrors() {
|
|
19869
|
+
var getFieldValue = form.getFieldValue;
|
|
19870
|
+
var values = GROUP_FIELDS.map(function (f) {
|
|
19871
|
+
return getFieldValue(f);
|
|
19872
|
+
});
|
|
19873
|
+
var filledCount = values.filter(function (v) {
|
|
19874
|
+
return !isEmpty(v);
|
|
19875
|
+
}).length;
|
|
19876
|
+
|
|
19877
|
+
var errors = _objectSpread2({}, NO_ERROR); // 全空 / 全不空:不报错
|
|
19878
|
+
// 部分填写:为空的字段报错
|
|
19879
|
+
|
|
19880
|
+
|
|
19881
|
+
if (filledCount > 0 && filledCount < GROUP_FIELDS.length) {
|
|
19882
|
+
GROUP_FIELDS.forEach(function (f) {
|
|
19883
|
+
if (isEmpty(getFieldValue(f))) {
|
|
19884
|
+
errors[f] = EMPTY_MSG[f];
|
|
19885
|
+
}
|
|
19886
|
+
});
|
|
19887
|
+
}
|
|
19888
|
+
|
|
19889
|
+
return errors;
|
|
19890
|
+
};
|
|
19891
|
+
/** 任一字段变化时,主动触发另外两个字段的校验,形成联动 */
|
|
19892
|
+
|
|
19893
|
+
|
|
19894
|
+
var handleGroupChange = React.useCallback(function () {
|
|
19895
|
+
setTimeout(function () {
|
|
19896
|
+
form.validateFields(GROUP_FIELDS, {}, function () {});
|
|
19897
|
+
setErrors(calcErrors());
|
|
19898
|
+
}, 0);
|
|
19899
|
+
}, [form]);
|
|
19809
19900
|
var onChangeType = React.useCallback(function (value) {
|
|
19810
19901
|
var buyerTaxId = form === null || form === void 0 ? void 0 : form.getFieldValue("buyerTaxId");
|
|
19811
19902
|
var certificateNumber = form === null || form === void 0 ? void 0 : form.getFieldValue("certificateNumber");
|
|
@@ -19880,13 +19971,15 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
|
|
|
19880
19971
|
nationality: "158"
|
|
19881
19972
|
});
|
|
19882
19973
|
}
|
|
19974
|
+
|
|
19975
|
+
handleGroupChange();
|
|
19883
19976
|
}, [form]);
|
|
19884
19977
|
/** 校验证件号码*/
|
|
19885
19978
|
|
|
19886
19979
|
var validateIDCode = useCallback(function (_, value) {
|
|
19887
19980
|
if (!value) {
|
|
19888
|
-
setStatus('
|
|
19889
|
-
setInfo('
|
|
19981
|
+
setStatus('');
|
|
19982
|
+
setInfo('');
|
|
19890
19983
|
return Promise.resolve();
|
|
19891
19984
|
}
|
|
19892
19985
|
|
|
@@ -19984,8 +20077,8 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
|
|
|
19984
20077
|
}, [form]);
|
|
19985
20078
|
var validateNationality = useCallback(function (_, value) {
|
|
19986
20079
|
if (!value) {
|
|
19987
|
-
setNationStatue('
|
|
19988
|
-
setNation('
|
|
20080
|
+
setNationStatue('');
|
|
20081
|
+
setNation('');
|
|
19989
20082
|
return Promise.resolve();
|
|
19990
20083
|
}
|
|
19991
20084
|
|
|
@@ -20373,49 +20466,50 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
|
|
|
20373
20466
|
span: 6
|
|
20374
20467
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
20375
20468
|
label: "\u8BC1\u4EF6\u7C7B\u578B",
|
|
20376
|
-
colon: false
|
|
20469
|
+
colon: false,
|
|
20470
|
+
validateStatus: errors.certificateType ? 'error' : "",
|
|
20471
|
+
help: errors.certificateType
|
|
20377
20472
|
}, getFieldDecorator('certificateType', {
|
|
20378
20473
|
rules: [{
|
|
20379
|
-
|
|
20380
|
-
message: '证件类型必填'
|
|
20474
|
+
validator: createGroupValidator('certificateType')
|
|
20381
20475
|
}]
|
|
20382
20476
|
})( /*#__PURE__*/React.createElement(CardSelect, {
|
|
20383
20477
|
onChange: onChangeType,
|
|
20384
20478
|
readOnly: isReadOnly('certificateType'),
|
|
20385
|
-
placeholder: "\
|
|
20386
|
-
autoComplete: "off"
|
|
20479
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
20480
|
+
autoComplete: "off",
|
|
20481
|
+
allowClear: true
|
|
20387
20482
|
})))), /*#__PURE__*/React.createElement(Col, {
|
|
20388
20483
|
span: 7
|
|
20389
20484
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
20390
20485
|
label: "\u8BC1\u4EF6\u53F7\u7801",
|
|
20391
20486
|
colon: false,
|
|
20392
|
-
validateStatus: validateStatus,
|
|
20393
|
-
help: errorInfo
|
|
20487
|
+
validateStatus: validateStatus || (errors.certificateNumber ? 'error' : ""),
|
|
20488
|
+
help: errorInfo || errors.certificateNumber
|
|
20394
20489
|
}, getFieldDecorator('certificateNumber', {
|
|
20395
20490
|
rules: [{
|
|
20396
|
-
required: true,
|
|
20397
|
-
message: '证件号码必填'
|
|
20398
|
-
}, {
|
|
20399
20491
|
max: 30,
|
|
20400
20492
|
message: "\u5185\u5BB9\u8D85\u957F"
|
|
20493
|
+
}, {
|
|
20494
|
+
validator: createGroupValidator('certificateNumber')
|
|
20401
20495
|
}, {
|
|
20402
20496
|
validator: validateIDCode
|
|
20403
20497
|
}]
|
|
20404
20498
|
})( /*#__PURE__*/React.createElement(MyInput$1, {
|
|
20405
20499
|
readOnly: isReadOnly('certificateNumber'),
|
|
20406
|
-
placeholder: "\
|
|
20407
|
-
autoComplete: "off"
|
|
20500
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
20501
|
+
autoComplete: "off",
|
|
20502
|
+
onChange: handleGroupChange
|
|
20408
20503
|
})))), /*#__PURE__*/React.createElement(Col, {
|
|
20409
20504
|
span: 6
|
|
20410
20505
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
20411
20506
|
label: "\u56FD\u7C4D(\u6216\u5730\u533A)",
|
|
20412
20507
|
colon: false,
|
|
20413
|
-
validateStatus: nation,
|
|
20414
|
-
help: nationInfo
|
|
20508
|
+
validateStatus: nation || (errors.nationality ? 'error' : ""),
|
|
20509
|
+
help: nationInfo || errors.nationality
|
|
20415
20510
|
}, getFieldDecorator('nationality', {
|
|
20416
20511
|
rules: [{
|
|
20417
|
-
|
|
20418
|
-
message: '国籍必填'
|
|
20512
|
+
validator: createGroupValidator('nationality')
|
|
20419
20513
|
}, {
|
|
20420
20514
|
validator: validateNationality
|
|
20421
20515
|
}]
|
|
@@ -20432,18 +20526,20 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
|
|
|
20432
20526
|
return false;
|
|
20433
20527
|
},
|
|
20434
20528
|
readOnly: isReadOnly('nationality'),
|
|
20435
|
-
placeholder: "\
|
|
20436
|
-
autoComplete: "off"
|
|
20529
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
20530
|
+
autoComplete: "off",
|
|
20531
|
+
onChange: handleGroupChange,
|
|
20532
|
+
allowClear: true
|
|
20437
20533
|
}))))))));
|
|
20438
20534
|
});
|
|
20439
20535
|
|
|
20440
20536
|
function NaturalPersonFlag(props) {
|
|
20441
20537
|
var controller = Invoice.useInvoiceController();
|
|
20442
20538
|
|
|
20443
|
-
var _React$
|
|
20444
|
-
_React$
|
|
20445
|
-
value = _React$
|
|
20446
|
-
setValue = _React$
|
|
20539
|
+
var _React$useState13 = React.useState(props.value || 'COMPANY'),
|
|
20540
|
+
_React$useState14 = _slicedToArray(_React$useState13, 2),
|
|
20541
|
+
value = _React$useState14[0],
|
|
20542
|
+
setValue = _React$useState14[1];
|
|
20447
20543
|
|
|
20448
20544
|
var onChange = React.useCallback(function (e) {
|
|
20449
20545
|
if (props.readOnly) return;
|
|
@@ -20492,10 +20588,10 @@ function BuyerNameInput$1(props) {
|
|
|
20492
20588
|
return s.autoComplete;
|
|
20493
20589
|
}, []);
|
|
20494
20590
|
|
|
20495
|
-
var _React$
|
|
20496
|
-
_React$
|
|
20497
|
-
options = _React$
|
|
20498
|
-
setOptions = _React$
|
|
20591
|
+
var _React$useState15 = React.useState([]),
|
|
20592
|
+
_React$useState16 = _slicedToArray(_React$useState15, 2),
|
|
20593
|
+
options = _React$useState16[0],
|
|
20594
|
+
setOptions = _React$useState16[1];
|
|
20499
20595
|
|
|
20500
20596
|
var onChangeAutoComplete = React.useCallback(function (value) {
|
|
20501
20597
|
var record = options.filter(function (e) {
|
|
@@ -32799,13 +32895,6 @@ var DrawerBody$3 = function DrawerBody() {
|
|
|
32799
32895
|
};
|
|
32800
32896
|
}(); // 3. 处理文件选择状态(更新左侧 Input 显示的文件名)
|
|
32801
32897
|
|
|
32802
|
-
React.useEffect(function () {
|
|
32803
|
-
controller.getBuyerList && controller.getBuyerList({
|
|
32804
|
-
pagination: {
|
|
32805
|
-
current: 1
|
|
32806
|
-
}
|
|
32807
|
-
});
|
|
32808
|
-
}, [controller]);
|
|
32809
32898
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Alert, {
|
|
32810
32899
|
type: "info",
|
|
32811
32900
|
showIcon: true,
|
|
@@ -34645,7 +34734,7 @@ var TitleText$4 = (function (props) {
|
|
|
34645
34734
|
}, "*") : /*#__PURE__*/React.createElement(React.Fragment, null), children);
|
|
34646
34735
|
});
|
|
34647
34736
|
|
|
34648
|
-
var _excluded$3 = ["options", "fieldNames", "placeholder", "onChange", "value", "className", "style", "onBlur"];
|
|
34737
|
+
var _excluded$3 = ["options", "fieldNames", "placeholder", "maxLength", "onChange", "value", "className", "style", "onBlur"];
|
|
34649
34738
|
var DROPDOWN_CLASS = 'custom-cascader-dropdown';
|
|
34650
34739
|
var ARROW_CLASS = 'custom-cascader-arrow';
|
|
34651
34740
|
var CLEAR_CLASS = 'custom-cascader-clear';
|
|
@@ -34660,6 +34749,8 @@ var CustomCascader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
34660
34749
|
} : _ref$fieldNames,
|
|
34661
34750
|
_ref$placeholder = _ref.placeholder,
|
|
34662
34751
|
placeholder = _ref$placeholder === void 0 ? '请选择或输入地址' : _ref$placeholder,
|
|
34752
|
+
_ref$maxLength = _ref.maxLength,
|
|
34753
|
+
maxLength = _ref$maxLength === void 0 ? 80 : _ref$maxLength,
|
|
34663
34754
|
onChange = _ref.onChange,
|
|
34664
34755
|
externalValue = _ref.value,
|
|
34665
34756
|
_ref$className = _ref.className,
|
|
@@ -34970,6 +35061,7 @@ var CustomCascader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
34970
35061
|
ref: inputRef,
|
|
34971
35062
|
placeholder: placeholder,
|
|
34972
35063
|
value: inputText,
|
|
35064
|
+
maxLength: maxLength,
|
|
34973
35065
|
onChange: handleInputChange,
|
|
34974
35066
|
onCompositionStart: handleCompositionStart,
|
|
34975
35067
|
onCompositionEnd: handleCompositionEnd,
|
|
@@ -35520,11 +35612,16 @@ var useColumns$4 = (function (form, isRequired) {
|
|
|
35520
35612
|
return controller.wait();
|
|
35521
35613
|
|
|
35522
35614
|
case 2:
|
|
35523
|
-
|
|
35524
|
-
|
|
35615
|
+
form.setFieldsValue({
|
|
35616
|
+
'zwdj': undefined
|
|
35617
|
+
});
|
|
35618
|
+
_context7.next = 5;
|
|
35619
|
+
return controller.setEditPassenger({
|
|
35620
|
+
jtgjlxDm: value,
|
|
35621
|
+
zwdj: ''
|
|
35525
35622
|
});
|
|
35526
35623
|
|
|
35527
|
-
case
|
|
35624
|
+
case 5:
|
|
35528
35625
|
case "end":
|
|
35529
35626
|
return _context7.stop();
|
|
35530
35627
|
}
|
|
@@ -36208,7 +36305,7 @@ var useDelRowButton$4 = (function () {
|
|
|
36208
36305
|
};
|
|
36209
36306
|
});
|
|
36210
36307
|
|
|
36211
|
-
var css_248z$E = ".kts-invoice-operate-
|
|
36308
|
+
var css_248z$E = ".kts-invoice-operate-passenger {\n border-bottom: 2px solid #9F613E;\n border-left: 2px solid #9F613E;\n border-right: 2px solid #9F613E;\n}\n.kts-invoice-operate-passenger .real-estate-info-digtal-label {\n padding: 20px 20px 0;\n color: #9F613E;\n font-weight: bold;\n}\n.kts-invoice-operate-passenger .ktsAnt3x-row.ktsAnt3x-form-item {\n margin-bottom: 0;\n}\n.kts-invoice-operate-passenger-list-digtal .goods-list-digtal-discount-tag {\n display: inline-block;\n height: 20px;\n line-height: 20px;\n border: 1px solid;\n padding: 0 5px;\n border-radius: 4px;\n}\n.kts-invoice-operate-passenger-list-digtal .kts-invoice-operate-goods-list-table-tax-rate .ktsAnt3x-select-selection-selected-value {\n float: right;\n}\n.kts-invoice-operate-passenger-list-digtal .kts-invoice-operate-passenger-list-able {\n display: flex;\n padding: 10px;\n border-bottom: 2px solid #9F613E;\n gap: 10px;\n align-items: center;\n}\n.kts-invoice-operate-passenger-list-digtal .ktsAntX-table .ktsAntX-table-row.kts-invoice-operate-goods-be-discount .ktsAntX-table-cell {\n color: #f00;\n}\n.kts-invoice-operate-passenger-list-digtal .ktsAntX-table input,\n.kts-invoice-operate-passenger-list-digtal .ktsAntX-table .ktsAntX-select-selection-item {\n font-size: 12px;\n}\n.kts-invoice-operate-passenger-list-table-digtal .ktsAnt3x-form-item-control.has-error {\n border: 1px solid #f00;\n}\n.kts-invoice-operate-passenger-list-table-digtal .kts-invoice-operate-goods-list-table.kts-invoice-operate-prefab .ktsAnt3x-table-row {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-passenger-list-table-digtal .kts-invoice-operate-goods-list-table-search-protrude {\n background: #ff0;\n color: #000;\n font-weight: bold;\n}\n";
|
|
36212
36309
|
styleInject(css_248z$E);
|
|
36213
36310
|
|
|
36214
36311
|
var BatchImportButton = (function () {
|
|
@@ -36431,11 +36528,6 @@ var Main$6 = decorator(Form.create())(function (props) {
|
|
|
36431
36528
|
var goodsList = controller.useMemo(function (s) {
|
|
36432
36529
|
return s.passengerListState.goodsList;
|
|
36433
36530
|
}, []);
|
|
36434
|
-
/** 货物列表 */
|
|
36435
|
-
|
|
36436
|
-
var dataSource = controller.useMemo(function (s) {
|
|
36437
|
-
return s.passengerListState.goodsList;
|
|
36438
|
-
}, []);
|
|
36439
36531
|
/** 表格行事件 */
|
|
36440
36532
|
|
|
36441
36533
|
var _onRow = useOnRow$4();
|
|
@@ -36478,7 +36570,9 @@ var Main$6 = decorator(Form.create())(function (props) {
|
|
|
36478
36570
|
while (1) {
|
|
36479
36571
|
switch (_context2.prev = _context2.next) {
|
|
36480
36572
|
case 0:
|
|
36481
|
-
|
|
36573
|
+
if (props.fieldNames) {
|
|
36574
|
+
s.passengerListState.addressFieldNames = props.fieldNames;
|
|
36575
|
+
}
|
|
36482
36576
|
|
|
36483
36577
|
case 1:
|
|
36484
36578
|
case "end":
|
|
@@ -36596,22 +36690,22 @@ var Main$6 = decorator(Form.create())(function (props) {
|
|
|
36596
36690
|
// controller.useForm('freightInfo', form);
|
|
36597
36691
|
|
|
36598
36692
|
return /*#__PURE__*/React.createElement("div", {
|
|
36599
|
-
className: "kts-invoice-operate-
|
|
36693
|
+
className: "kts-invoice-operate-passenger"
|
|
36600
36694
|
}, /*#__PURE__*/React.createElement("div", {
|
|
36601
36695
|
className: 'real-estate-info-digtal-label'
|
|
36602
36696
|
}, "\u7279\u5B9A\u4FE1\u606F-\u65C5\u5BA2\u8FD0\u8F93\u670D\u52A1"), /*#__PURE__*/React.createElement("div", {
|
|
36603
|
-
className: "kts-invoice-operate-
|
|
36697
|
+
className: "kts-invoice-operate-passenger-list-digtal",
|
|
36604
36698
|
onClick: function onClick(e) {
|
|
36605
36699
|
e.stopPropagation();
|
|
36606
36700
|
}
|
|
36607
36701
|
}, /*#__PURE__*/React.createElement("div", {
|
|
36608
|
-
className: "kts-invoice-operate-
|
|
36702
|
+
className: "kts-invoice-operate-passenger-list-able"
|
|
36609
36703
|
}, /*#__PURE__*/React.createElement(AddRowButton$4, null), delRowButton.button, /*#__PURE__*/React.createElement(BatchImportButton, null), /*#__PURE__*/React.createElement("div", {
|
|
36610
36704
|
style: {
|
|
36611
36705
|
flex: 1
|
|
36612
36706
|
}
|
|
36613
36707
|
})), /*#__PURE__*/React.createElement("div", {
|
|
36614
|
-
className: classnames('kts-invoice-operate-
|
|
36708
|
+
className: classnames('kts-invoice-operate-passenger-list-table-digtal')
|
|
36615
36709
|
}, /*#__PURE__*/React.createElement(TableVirtual$4, {
|
|
36616
36710
|
size: "small",
|
|
36617
36711
|
rowKey: "$index",
|
|
@@ -36624,7 +36718,7 @@ var Main$6 = decorator(Form.create())(function (props) {
|
|
|
36624
36718
|
row: TableRow$4
|
|
36625
36719
|
}
|
|
36626
36720
|
},
|
|
36627
|
-
dataSource:
|
|
36721
|
+
dataSource: goodsList,
|
|
36628
36722
|
columns: useColumns$4(props.form, isRequired),
|
|
36629
36723
|
rowSelection: useRowSelection$4(),
|
|
36630
36724
|
onRow: function onRow(record) {
|
package/dist/index.js
CHANGED
|
@@ -19721,6 +19721,24 @@ var formatCompanyName = function formatCompanyName(e) {
|
|
|
19721
19721
|
if (value) {
|
|
19722
19722
|
return value.replace('(', '(').replace(')', ')').replace(' ', '');
|
|
19723
19723
|
}
|
|
19724
|
+
}; // 参与自然人联动的字段
|
|
19725
|
+
|
|
19726
|
+
|
|
19727
|
+
var GROUP_FIELDS = ['certificateType', 'certificateNumber', 'nationality']; // 各字段为空时的提示
|
|
19728
|
+
|
|
19729
|
+
var EMPTY_MSG = {
|
|
19730
|
+
certificateType: '请选择证件类型',
|
|
19731
|
+
certificateNumber: '请输入证件号码',
|
|
19732
|
+
nationality: '请选择国籍'
|
|
19733
|
+
};
|
|
19734
|
+
var NO_ERROR = {
|
|
19735
|
+
certificateType: '',
|
|
19736
|
+
certificateNumber: '',
|
|
19737
|
+
nationality: ''
|
|
19738
|
+
};
|
|
19739
|
+
|
|
19740
|
+
var isEmpty = function isEmpty(v) {
|
|
19741
|
+
return v === undefined || v === null || typeof v === 'string' && v.trim() === '';
|
|
19724
19742
|
};
|
|
19725
19743
|
/** 干系人 */
|
|
19726
19744
|
|
|
@@ -19759,6 +19777,11 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
|
|
|
19759
19777
|
nationInfo = _React$useState10[0],
|
|
19760
19778
|
setNation = _React$useState10[1];
|
|
19761
19779
|
|
|
19780
|
+
var _React$useState11 = React__default['default'].useState(NO_ERROR),
|
|
19781
|
+
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
19782
|
+
errors = _React$useState12[0],
|
|
19783
|
+
setErrors = _React$useState12[1];
|
|
19784
|
+
|
|
19762
19785
|
var getFieldDecorator = form.getFieldDecorator;
|
|
19763
19786
|
var controller = Invoice.useInvoiceController();
|
|
19764
19787
|
var model = controller.useMemo(function (s) {
|
|
@@ -19816,6 +19839,74 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
|
|
|
19816
19839
|
React__default['default'].useEffect(function () {
|
|
19817
19840
|
setExpand(typeof props.isExpand === 'boolean' ? props.isExpand : true);
|
|
19818
19841
|
}, [props.isExpand]);
|
|
19842
|
+
/**
|
|
19843
|
+
* 生成校验器:三个字段要么全空,要么全不空
|
|
19844
|
+
* @param {string} field 当前被校验的字段名
|
|
19845
|
+
*/
|
|
19846
|
+
|
|
19847
|
+
var createGroupValidator = function createGroupValidator(field) {
|
|
19848
|
+
return function (rule, value, callback) {
|
|
19849
|
+
var getFieldValue = form.getFieldValue; // 实时读取三个字段的当前值
|
|
19850
|
+
|
|
19851
|
+
var values = GROUP_FIELDS.map(function (name) {
|
|
19852
|
+
return getFieldValue(name);
|
|
19853
|
+
});
|
|
19854
|
+
var filledCount = values.filter(function (v) {
|
|
19855
|
+
return !isEmpty(v);
|
|
19856
|
+
}).length; // 情况一:全空 —— 通过
|
|
19857
|
+
|
|
19858
|
+
if (filledCount === 0) {
|
|
19859
|
+
return callback();
|
|
19860
|
+
} // 情况二:全不空 —— 通过
|
|
19861
|
+
|
|
19862
|
+
|
|
19863
|
+
if (filledCount === GROUP_FIELDS.length) {
|
|
19864
|
+
return callback();
|
|
19865
|
+
} // 情况三:部分填写 —— 为空的字段报错
|
|
19866
|
+
|
|
19867
|
+
|
|
19868
|
+
if (isEmpty(value)) {
|
|
19869
|
+
return Promise.reject(EMPTY_MSG[field]);
|
|
19870
|
+
}
|
|
19871
|
+
|
|
19872
|
+
callback();
|
|
19873
|
+
};
|
|
19874
|
+
};
|
|
19875
|
+
/** 根据三个字段当前值计算错误 */
|
|
19876
|
+
|
|
19877
|
+
|
|
19878
|
+
var calcErrors = function calcErrors() {
|
|
19879
|
+
var getFieldValue = form.getFieldValue;
|
|
19880
|
+
var values = GROUP_FIELDS.map(function (f) {
|
|
19881
|
+
return getFieldValue(f);
|
|
19882
|
+
});
|
|
19883
|
+
var filledCount = values.filter(function (v) {
|
|
19884
|
+
return !isEmpty(v);
|
|
19885
|
+
}).length;
|
|
19886
|
+
|
|
19887
|
+
var errors = _objectSpread2({}, NO_ERROR); // 全空 / 全不空:不报错
|
|
19888
|
+
// 部分填写:为空的字段报错
|
|
19889
|
+
|
|
19890
|
+
|
|
19891
|
+
if (filledCount > 0 && filledCount < GROUP_FIELDS.length) {
|
|
19892
|
+
GROUP_FIELDS.forEach(function (f) {
|
|
19893
|
+
if (isEmpty(getFieldValue(f))) {
|
|
19894
|
+
errors[f] = EMPTY_MSG[f];
|
|
19895
|
+
}
|
|
19896
|
+
});
|
|
19897
|
+
}
|
|
19898
|
+
|
|
19899
|
+
return errors;
|
|
19900
|
+
};
|
|
19901
|
+
/** 任一字段变化时,主动触发另外两个字段的校验,形成联动 */
|
|
19902
|
+
|
|
19903
|
+
|
|
19904
|
+
var handleGroupChange = React__default['default'].useCallback(function () {
|
|
19905
|
+
setTimeout(function () {
|
|
19906
|
+
form.validateFields(GROUP_FIELDS, {}, function () {});
|
|
19907
|
+
setErrors(calcErrors());
|
|
19908
|
+
}, 0);
|
|
19909
|
+
}, [form]);
|
|
19819
19910
|
var onChangeType = React__default['default'].useCallback(function (value) {
|
|
19820
19911
|
var buyerTaxId = form === null || form === void 0 ? void 0 : form.getFieldValue("buyerTaxId");
|
|
19821
19912
|
var certificateNumber = form === null || form === void 0 ? void 0 : form.getFieldValue("certificateNumber");
|
|
@@ -19890,13 +19981,15 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
|
|
|
19890
19981
|
nationality: "158"
|
|
19891
19982
|
});
|
|
19892
19983
|
}
|
|
19984
|
+
|
|
19985
|
+
handleGroupChange();
|
|
19893
19986
|
}, [form]);
|
|
19894
19987
|
/** 校验证件号码*/
|
|
19895
19988
|
|
|
19896
19989
|
var validateIDCode = React.useCallback(function (_, value) {
|
|
19897
19990
|
if (!value) {
|
|
19898
|
-
setStatus('
|
|
19899
|
-
setInfo('
|
|
19991
|
+
setStatus('');
|
|
19992
|
+
setInfo('');
|
|
19900
19993
|
return Promise.resolve();
|
|
19901
19994
|
}
|
|
19902
19995
|
|
|
@@ -19994,8 +20087,8 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
|
|
|
19994
20087
|
}, [form]);
|
|
19995
20088
|
var validateNationality = React.useCallback(function (_, value) {
|
|
19996
20089
|
if (!value) {
|
|
19997
|
-
setNationStatue('
|
|
19998
|
-
setNation('
|
|
20090
|
+
setNationStatue('');
|
|
20091
|
+
setNation('');
|
|
19999
20092
|
return Promise.resolve();
|
|
20000
20093
|
}
|
|
20001
20094
|
|
|
@@ -20383,49 +20476,50 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
|
|
|
20383
20476
|
span: 6
|
|
20384
20477
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
20385
20478
|
label: "\u8BC1\u4EF6\u7C7B\u578B",
|
|
20386
|
-
colon: false
|
|
20479
|
+
colon: false,
|
|
20480
|
+
validateStatus: errors.certificateType ? 'error' : "",
|
|
20481
|
+
help: errors.certificateType
|
|
20387
20482
|
}, getFieldDecorator('certificateType', {
|
|
20388
20483
|
rules: [{
|
|
20389
|
-
|
|
20390
|
-
message: '证件类型必填'
|
|
20484
|
+
validator: createGroupValidator('certificateType')
|
|
20391
20485
|
}]
|
|
20392
20486
|
})( /*#__PURE__*/React__default['default'].createElement(CardSelect, {
|
|
20393
20487
|
onChange: onChangeType,
|
|
20394
20488
|
readOnly: isReadOnly('certificateType'),
|
|
20395
|
-
placeholder: "\
|
|
20396
|
-
autoComplete: "off"
|
|
20489
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
20490
|
+
autoComplete: "off",
|
|
20491
|
+
allowClear: true
|
|
20397
20492
|
})))), /*#__PURE__*/React__default['default'].createElement(ktsXui.Col, {
|
|
20398
20493
|
span: 7
|
|
20399
20494
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
20400
20495
|
label: "\u8BC1\u4EF6\u53F7\u7801",
|
|
20401
20496
|
colon: false,
|
|
20402
|
-
validateStatus: validateStatus,
|
|
20403
|
-
help: errorInfo
|
|
20497
|
+
validateStatus: validateStatus || (errors.certificateNumber ? 'error' : ""),
|
|
20498
|
+
help: errorInfo || errors.certificateNumber
|
|
20404
20499
|
}, getFieldDecorator('certificateNumber', {
|
|
20405
20500
|
rules: [{
|
|
20406
|
-
required: true,
|
|
20407
|
-
message: '证件号码必填'
|
|
20408
|
-
}, {
|
|
20409
20501
|
max: 30,
|
|
20410
20502
|
message: "\u5185\u5BB9\u8D85\u957F"
|
|
20503
|
+
}, {
|
|
20504
|
+
validator: createGroupValidator('certificateNumber')
|
|
20411
20505
|
}, {
|
|
20412
20506
|
validator: validateIDCode
|
|
20413
20507
|
}]
|
|
20414
20508
|
})( /*#__PURE__*/React__default['default'].createElement(MyInput$1, {
|
|
20415
20509
|
readOnly: isReadOnly('certificateNumber'),
|
|
20416
|
-
placeholder: "\
|
|
20417
|
-
autoComplete: "off"
|
|
20510
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
20511
|
+
autoComplete: "off",
|
|
20512
|
+
onChange: handleGroupChange
|
|
20418
20513
|
})))), /*#__PURE__*/React__default['default'].createElement(ktsXui.Col, {
|
|
20419
20514
|
span: 6
|
|
20420
20515
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
20421
20516
|
label: "\u56FD\u7C4D(\u6216\u5730\u533A)",
|
|
20422
20517
|
colon: false,
|
|
20423
|
-
validateStatus: nation,
|
|
20424
|
-
help: nationInfo
|
|
20518
|
+
validateStatus: nation || (errors.nationality ? 'error' : ""),
|
|
20519
|
+
help: nationInfo || errors.nationality
|
|
20425
20520
|
}, getFieldDecorator('nationality', {
|
|
20426
20521
|
rules: [{
|
|
20427
|
-
|
|
20428
|
-
message: '国籍必填'
|
|
20522
|
+
validator: createGroupValidator('nationality')
|
|
20429
20523
|
}, {
|
|
20430
20524
|
validator: validateNationality
|
|
20431
20525
|
}]
|
|
@@ -20442,18 +20536,20 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
|
|
|
20442
20536
|
return false;
|
|
20443
20537
|
},
|
|
20444
20538
|
readOnly: isReadOnly('nationality'),
|
|
20445
|
-
placeholder: "\
|
|
20446
|
-
autoComplete: "off"
|
|
20539
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
20540
|
+
autoComplete: "off",
|
|
20541
|
+
onChange: handleGroupChange,
|
|
20542
|
+
allowClear: true
|
|
20447
20543
|
}))))))));
|
|
20448
20544
|
});
|
|
20449
20545
|
|
|
20450
20546
|
function NaturalPersonFlag(props) {
|
|
20451
20547
|
var controller = Invoice.useInvoiceController();
|
|
20452
20548
|
|
|
20453
|
-
var _React$
|
|
20454
|
-
_React$
|
|
20455
|
-
value = _React$
|
|
20456
|
-
setValue = _React$
|
|
20549
|
+
var _React$useState13 = React__default['default'].useState(props.value || 'COMPANY'),
|
|
20550
|
+
_React$useState14 = _slicedToArray(_React$useState13, 2),
|
|
20551
|
+
value = _React$useState14[0],
|
|
20552
|
+
setValue = _React$useState14[1];
|
|
20457
20553
|
|
|
20458
20554
|
var onChange = React__default['default'].useCallback(function (e) {
|
|
20459
20555
|
if (props.readOnly) return;
|
|
@@ -20502,10 +20598,10 @@ function BuyerNameInput$1(props) {
|
|
|
20502
20598
|
return s.autoComplete;
|
|
20503
20599
|
}, []);
|
|
20504
20600
|
|
|
20505
|
-
var _React$
|
|
20506
|
-
_React$
|
|
20507
|
-
options = _React$
|
|
20508
|
-
setOptions = _React$
|
|
20601
|
+
var _React$useState15 = React__default['default'].useState([]),
|
|
20602
|
+
_React$useState16 = _slicedToArray(_React$useState15, 2),
|
|
20603
|
+
options = _React$useState16[0],
|
|
20604
|
+
setOptions = _React$useState16[1];
|
|
20509
20605
|
|
|
20510
20606
|
var onChangeAutoComplete = React__default['default'].useCallback(function (value) {
|
|
20511
20607
|
var record = options.filter(function (e) {
|
|
@@ -32809,13 +32905,6 @@ var DrawerBody$3 = function DrawerBody() {
|
|
|
32809
32905
|
};
|
|
32810
32906
|
}(); // 3. 处理文件选择状态(更新左侧 Input 显示的文件名)
|
|
32811
32907
|
|
|
32812
|
-
React__default['default'].useEffect(function () {
|
|
32813
|
-
controller.getBuyerList && controller.getBuyerList({
|
|
32814
|
-
pagination: {
|
|
32815
|
-
current: 1
|
|
32816
|
-
}
|
|
32817
|
-
});
|
|
32818
|
-
}, [controller]);
|
|
32819
32908
|
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Alert, {
|
|
32820
32909
|
type: "info",
|
|
32821
32910
|
showIcon: true,
|
|
@@ -34655,7 +34744,7 @@ var TitleText$4 = (function (props) {
|
|
|
34655
34744
|
}, "*") : /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null), children);
|
|
34656
34745
|
});
|
|
34657
34746
|
|
|
34658
|
-
var _excluded$3 = ["options", "fieldNames", "placeholder", "onChange", "value", "className", "style", "onBlur"];
|
|
34747
|
+
var _excluded$3 = ["options", "fieldNames", "placeholder", "maxLength", "onChange", "value", "className", "style", "onBlur"];
|
|
34659
34748
|
var DROPDOWN_CLASS = 'custom-cascader-dropdown';
|
|
34660
34749
|
var ARROW_CLASS = 'custom-cascader-arrow';
|
|
34661
34750
|
var CLEAR_CLASS = 'custom-cascader-clear';
|
|
@@ -34670,6 +34759,8 @@ var CustomCascader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
34670
34759
|
} : _ref$fieldNames,
|
|
34671
34760
|
_ref$placeholder = _ref.placeholder,
|
|
34672
34761
|
placeholder = _ref$placeholder === void 0 ? '请选择或输入地址' : _ref$placeholder,
|
|
34762
|
+
_ref$maxLength = _ref.maxLength,
|
|
34763
|
+
maxLength = _ref$maxLength === void 0 ? 80 : _ref$maxLength,
|
|
34673
34764
|
onChange = _ref.onChange,
|
|
34674
34765
|
externalValue = _ref.value,
|
|
34675
34766
|
_ref$className = _ref.className,
|
|
@@ -34980,6 +35071,7 @@ var CustomCascader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
34980
35071
|
ref: inputRef,
|
|
34981
35072
|
placeholder: placeholder,
|
|
34982
35073
|
value: inputText,
|
|
35074
|
+
maxLength: maxLength,
|
|
34983
35075
|
onChange: handleInputChange,
|
|
34984
35076
|
onCompositionStart: handleCompositionStart,
|
|
34985
35077
|
onCompositionEnd: handleCompositionEnd,
|
|
@@ -35530,11 +35622,16 @@ var useColumns$4 = (function (form, isRequired) {
|
|
|
35530
35622
|
return controller.wait();
|
|
35531
35623
|
|
|
35532
35624
|
case 2:
|
|
35533
|
-
|
|
35534
|
-
|
|
35625
|
+
form.setFieldsValue({
|
|
35626
|
+
'zwdj': undefined
|
|
35627
|
+
});
|
|
35628
|
+
_context7.next = 5;
|
|
35629
|
+
return controller.setEditPassenger({
|
|
35630
|
+
jtgjlxDm: value,
|
|
35631
|
+
zwdj: ''
|
|
35535
35632
|
});
|
|
35536
35633
|
|
|
35537
|
-
case
|
|
35634
|
+
case 5:
|
|
35538
35635
|
case "end":
|
|
35539
35636
|
return _context7.stop();
|
|
35540
35637
|
}
|
|
@@ -36218,7 +36315,7 @@ var useDelRowButton$4 = (function () {
|
|
|
36218
36315
|
};
|
|
36219
36316
|
});
|
|
36220
36317
|
|
|
36221
|
-
var css_248z$E = ".kts-invoice-operate-
|
|
36318
|
+
var css_248z$E = ".kts-invoice-operate-passenger {\n border-bottom: 2px solid #9F613E;\n border-left: 2px solid #9F613E;\n border-right: 2px solid #9F613E;\n}\n.kts-invoice-operate-passenger .real-estate-info-digtal-label {\n padding: 20px 20px 0;\n color: #9F613E;\n font-weight: bold;\n}\n.kts-invoice-operate-passenger .ktsAnt3x-row.ktsAnt3x-form-item {\n margin-bottom: 0;\n}\n.kts-invoice-operate-passenger-list-digtal .goods-list-digtal-discount-tag {\n display: inline-block;\n height: 20px;\n line-height: 20px;\n border: 1px solid;\n padding: 0 5px;\n border-radius: 4px;\n}\n.kts-invoice-operate-passenger-list-digtal .kts-invoice-operate-goods-list-table-tax-rate .ktsAnt3x-select-selection-selected-value {\n float: right;\n}\n.kts-invoice-operate-passenger-list-digtal .kts-invoice-operate-passenger-list-able {\n display: flex;\n padding: 10px;\n border-bottom: 2px solid #9F613E;\n gap: 10px;\n align-items: center;\n}\n.kts-invoice-operate-passenger-list-digtal .ktsAntX-table .ktsAntX-table-row.kts-invoice-operate-goods-be-discount .ktsAntX-table-cell {\n color: #f00;\n}\n.kts-invoice-operate-passenger-list-digtal .ktsAntX-table input,\n.kts-invoice-operate-passenger-list-digtal .ktsAntX-table .ktsAntX-select-selection-item {\n font-size: 12px;\n}\n.kts-invoice-operate-passenger-list-table-digtal .ktsAnt3x-form-item-control.has-error {\n border: 1px solid #f00;\n}\n.kts-invoice-operate-passenger-list-table-digtal .kts-invoice-operate-goods-list-table.kts-invoice-operate-prefab .ktsAnt3x-table-row {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-passenger-list-table-digtal .kts-invoice-operate-goods-list-table-search-protrude {\n background: #ff0;\n color: #000;\n font-weight: bold;\n}\n";
|
|
36222
36319
|
styleInject(css_248z$E);
|
|
36223
36320
|
|
|
36224
36321
|
var BatchImportButton = (function () {
|
|
@@ -36441,11 +36538,6 @@ var Main$6 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
|
|
|
36441
36538
|
var goodsList = controller.useMemo(function (s) {
|
|
36442
36539
|
return s.passengerListState.goodsList;
|
|
36443
36540
|
}, []);
|
|
36444
|
-
/** 货物列表 */
|
|
36445
|
-
|
|
36446
|
-
var dataSource = controller.useMemo(function (s) {
|
|
36447
|
-
return s.passengerListState.goodsList;
|
|
36448
|
-
}, []);
|
|
36449
36541
|
/** 表格行事件 */
|
|
36450
36542
|
|
|
36451
36543
|
var _onRow = useOnRow$4();
|
|
@@ -36488,7 +36580,9 @@ var Main$6 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
|
|
|
36488
36580
|
while (1) {
|
|
36489
36581
|
switch (_context2.prev = _context2.next) {
|
|
36490
36582
|
case 0:
|
|
36491
|
-
|
|
36583
|
+
if (props.fieldNames) {
|
|
36584
|
+
s.passengerListState.addressFieldNames = props.fieldNames;
|
|
36585
|
+
}
|
|
36492
36586
|
|
|
36493
36587
|
case 1:
|
|
36494
36588
|
case "end":
|
|
@@ -36606,22 +36700,22 @@ var Main$6 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
|
|
|
36606
36700
|
// controller.useForm('freightInfo', form);
|
|
36607
36701
|
|
|
36608
36702
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
36609
|
-
className: "kts-invoice-operate-
|
|
36703
|
+
className: "kts-invoice-operate-passenger"
|
|
36610
36704
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
36611
36705
|
className: 'real-estate-info-digtal-label'
|
|
36612
36706
|
}, "\u7279\u5B9A\u4FE1\u606F-\u65C5\u5BA2\u8FD0\u8F93\u670D\u52A1"), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
36613
|
-
className: "kts-invoice-operate-
|
|
36707
|
+
className: "kts-invoice-operate-passenger-list-digtal",
|
|
36614
36708
|
onClick: function onClick(e) {
|
|
36615
36709
|
e.stopPropagation();
|
|
36616
36710
|
}
|
|
36617
36711
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
36618
|
-
className: "kts-invoice-operate-
|
|
36712
|
+
className: "kts-invoice-operate-passenger-list-able"
|
|
36619
36713
|
}, /*#__PURE__*/React__default['default'].createElement(AddRowButton$4, null), delRowButton.button, /*#__PURE__*/React__default['default'].createElement(BatchImportButton, null), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
36620
36714
|
style: {
|
|
36621
36715
|
flex: 1
|
|
36622
36716
|
}
|
|
36623
36717
|
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
36624
|
-
className: classnames__default['default']('kts-invoice-operate-
|
|
36718
|
+
className: classnames__default['default']('kts-invoice-operate-passenger-list-table-digtal')
|
|
36625
36719
|
}, /*#__PURE__*/React__default['default'].createElement(TableVirtual$4, {
|
|
36626
36720
|
size: "small",
|
|
36627
36721
|
rowKey: "$index",
|
|
@@ -36634,7 +36728,7 @@ var Main$6 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
|
|
|
36634
36728
|
row: TableRow$4
|
|
36635
36729
|
}
|
|
36636
36730
|
},
|
|
36637
|
-
dataSource:
|
|
36731
|
+
dataSource: goodsList,
|
|
36638
36732
|
columns: useColumns$4(props.form, isRequired),
|
|
36639
36733
|
rowSelection: useRowSelection$4(),
|
|
36640
36734
|
onRow: function onRow(record) {
|
package/package.json
CHANGED
|
@@ -14544,13 +14544,33 @@ export default () => {
|
|
|
14544
14544
|
], []);
|
|
14545
14545
|
React.useEffect(() => {
|
|
14546
14546
|
controller.run(async s => {
|
|
14547
|
-
|
|
14548
|
-
|
|
14549
|
-
|
|
14550
|
-
|
|
14551
|
-
|
|
14552
|
-
|
|
14553
|
-
|
|
14547
|
+
const data = [{
|
|
14548
|
+
"destination": "北京市,市辖区,西城区",
|
|
14549
|
+
"idCard": "123456",
|
|
14550
|
+
"identityType": "COMPANY",
|
|
14551
|
+
"name": "李四",
|
|
14552
|
+
"origin": "北京市,市辖区,东城区",
|
|
14553
|
+
"sortNumber": 1,
|
|
14554
|
+
"travelDate": "2026-09-15",
|
|
14555
|
+
"travelLevel": null,
|
|
14556
|
+
"travelType": "PUBLIC_TRANSPORT"
|
|
14557
|
+
}]
|
|
14558
|
+
const cargoTransportDataList:Array<any> = data.map((item, index) => {
|
|
14559
|
+
return {
|
|
14560
|
+
// ...item,
|
|
14561
|
+
$index: Invoice.idGenerator(),
|
|
14562
|
+
sortNumber: item.sortNumber,
|
|
14563
|
+
cxr: item.name,
|
|
14564
|
+
chuxrq: item.travelDate,
|
|
14565
|
+
cxrzjlxDm: item.identityType,
|
|
14566
|
+
sfzjhm: item.idCard,
|
|
14567
|
+
jtgjlxDm: item.travelType,
|
|
14568
|
+
zwdj: item.travelLevel,
|
|
14569
|
+
cfd: item.origin?.split(','),
|
|
14570
|
+
ddd: item.destination?.split(','),
|
|
14571
|
+
}
|
|
14572
|
+
})
|
|
14573
|
+
controller.state.passengerListState.goodsList = cargoTransportDataList;
|
|
14554
14574
|
})
|
|
14555
14575
|
}, [])
|
|
14556
14576
|
const onSave = async () => {
|
|
@@ -28,6 +28,7 @@ export interface CustomCascaderProps
|
|
|
28
28
|
options?: CustomCascaderOption[];
|
|
29
29
|
fieldNames?: CustomCascaderFieldNames;
|
|
30
30
|
placeholder?: string;
|
|
31
|
+
maxLength?: number;
|
|
31
32
|
onChange?: (value: (string | number)[] | undefined, selectedOptions?: CustomCascaderOption[]) => void;
|
|
32
33
|
value?: (string | number)[];
|
|
33
34
|
onBlur?: (e: React.FocusEvent) => void;
|
|
@@ -43,6 +44,7 @@ const CustomCascader = forwardRef<any, CustomCascaderProps>(
|
|
|
43
44
|
options = [],
|
|
44
45
|
fieldNames = { label: 'label', value: 'value', children: 'children' },
|
|
45
46
|
placeholder = '请选择或输入地址',
|
|
47
|
+
maxLength = 80,
|
|
46
48
|
onChange,
|
|
47
49
|
value: externalValue,
|
|
48
50
|
className = '',
|
|
@@ -291,6 +293,7 @@ const CustomCascader = forwardRef<any, CustomCascaderProps>(
|
|
|
291
293
|
ref={inputRef}
|
|
292
294
|
placeholder={placeholder}
|
|
293
295
|
value={inputText}
|
|
296
|
+
maxLength={maxLength}
|
|
294
297
|
onChange={handleInputChange}
|
|
295
298
|
onCompositionStart={handleCompositionStart}
|
|
296
299
|
onCompositionEnd={handleCompositionEnd}
|
|
@@ -314,7 +314,8 @@ export default (form: WrappedFormUtils, isRequired?: boolean) => {
|
|
|
314
314
|
getPopupContainer={() => rootElement || document.body}
|
|
315
315
|
onChange={async (value) => {
|
|
316
316
|
await controller.wait()
|
|
317
|
-
|
|
317
|
+
form.setFieldsValue({'zwdj': undefined})
|
|
318
|
+
await controller.setEditPassenger({ jtgjlxDm: value, zwdj: '' });
|
|
318
319
|
}}
|
|
319
320
|
>
|
|
320
321
|
{(vehicleTypeList).map((e, i) => {
|
|
@@ -367,7 +368,7 @@ export default (form: WrappedFormUtils, isRequired?: boolean) => {
|
|
|
367
368
|
controller.setEditPassenger({ zwdj: value });
|
|
368
369
|
}}
|
|
369
370
|
>
|
|
370
|
-
{(levelOptions).map((e:any, i:any) => {
|
|
371
|
+
{(levelOptions).map((e: any, i: any) => {
|
|
371
372
|
return (
|
|
372
373
|
<Select.Option key={i} value={e.value}>
|
|
373
374
|
{e.label}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.kts-invoice-operate-
|
|
1
|
+
.kts-invoice-operate-passenger{
|
|
2
2
|
// padding : 20px;
|
|
3
3
|
border-bottom: 2px solid #9F613E;
|
|
4
4
|
border-left: 2px solid #9F613E;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.kts-invoice-operate-
|
|
18
|
+
.kts-invoice-operate-passenger-list-digtal {
|
|
19
19
|
|
|
20
20
|
.goods-list-digtal-discount-tag {
|
|
21
21
|
display: inline-block;
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
.kts-invoice-operate-
|
|
35
|
+
.kts-invoice-operate-passenger-list-able {
|
|
36
36
|
display: flex;
|
|
37
37
|
padding: 10px;
|
|
38
38
|
border-bottom: 2px solid #9F613E;
|
|
@@ -46,13 +46,17 @@
|
|
|
46
46
|
color: #f00;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
input, .ktsAntX-select-selection-item {
|
|
50
|
+
font-size: 12px;
|
|
51
|
+
}
|
|
52
|
+
|
|
49
53
|
// .ktsAntX-table-row.kts-invoice-operate-goods-discount .ktsAntX-table-cell {
|
|
50
54
|
// background: #f5f5f5;
|
|
51
55
|
// }
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
58
|
|
|
55
|
-
.kts-invoice-operate-
|
|
59
|
+
.kts-invoice-operate-passenger-list-table-digtal {
|
|
56
60
|
|
|
57
61
|
.ktsAnt3x-form-item-control.has-error {
|
|
58
62
|
border: 1px solid #f00;
|
|
@@ -57,9 +57,6 @@ const Main = decorator<IGoodsListProps, FormComponentProps & IGoodsListProps>(Fo
|
|
|
57
57
|
|
|
58
58
|
const goodsList = controller.useMemo(s => s.passengerListState.goodsList, []);
|
|
59
59
|
|
|
60
|
-
/** 货物列表 */
|
|
61
|
-
const dataSource = controller.useMemo(s => s.passengerListState.goodsList, [])
|
|
62
|
-
|
|
63
60
|
/** 表格行事件 */
|
|
64
61
|
const onRow = useOnRow();
|
|
65
62
|
|
|
@@ -76,7 +73,9 @@ const Main = decorator<IGoodsListProps, FormComponentProps & IGoodsListProps>(Fo
|
|
|
76
73
|
|
|
77
74
|
React.useEffect(() => {
|
|
78
75
|
controller.run(async (s) => {
|
|
79
|
-
|
|
76
|
+
if (props.fieldNames) {
|
|
77
|
+
s.passengerListState.addressFieldNames = props.fieldNames
|
|
78
|
+
}
|
|
80
79
|
});
|
|
81
80
|
}, [props.fieldNames])
|
|
82
81
|
|
|
@@ -114,10 +113,10 @@ const Main = decorator<IGoodsListProps, FormComponentProps & IGoodsListProps>(Fo
|
|
|
114
113
|
// 注册 form
|
|
115
114
|
// controller.useForm('freightInfo', form);
|
|
116
115
|
return (
|
|
117
|
-
<div className="kts-invoice-operate-
|
|
116
|
+
<div className="kts-invoice-operate-passenger">
|
|
118
117
|
<div className='real-estate-info-digtal-label' >特定信息-旅客运输服务</div>
|
|
119
|
-
<div className="kts-invoice-operate-
|
|
120
|
-
<div className="kts-invoice-operate-
|
|
118
|
+
<div className="kts-invoice-operate-passenger-list-digtal" onClick={(e) => { e.stopPropagation() }} >
|
|
119
|
+
<div className="kts-invoice-operate-passenger-list-able">
|
|
121
120
|
{/* 添加行 */}
|
|
122
121
|
<AddRowButton />
|
|
123
122
|
|
|
@@ -129,14 +128,14 @@ const Main = decorator<IGoodsListProps, FormComponentProps & IGoodsListProps>(Fo
|
|
|
129
128
|
<div style={{ flex: 1 }} />
|
|
130
129
|
|
|
131
130
|
</div>
|
|
132
|
-
<div className={classnames('kts-invoice-operate-
|
|
131
|
+
<div className={classnames('kts-invoice-operate-passenger-list-table-digtal')}>
|
|
133
132
|
<TableVirtual
|
|
134
133
|
size="small"
|
|
135
134
|
rowKey="$index"
|
|
136
135
|
pagination={false}
|
|
137
136
|
scroll={{ y: 280 }}
|
|
138
137
|
components={{ body: { row: TableRow } }}
|
|
139
|
-
dataSource={
|
|
138
|
+
dataSource={goodsList}
|
|
140
139
|
columns={useColumns(props.form, isRequired)}
|
|
141
140
|
rowSelection={useRowSelection()}
|
|
142
141
|
onRow={record => ({
|
|
@@ -51,6 +51,24 @@ const formatCompanyName = (e: any) => {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
// 参与自然人联动的字段
|
|
55
|
+
const GROUP_FIELDS = ['certificateType', 'certificateNumber', 'nationality'];
|
|
56
|
+
|
|
57
|
+
// 各字段为空时的提示
|
|
58
|
+
const EMPTY_MSG: any = {
|
|
59
|
+
certificateType: '请选择证件类型',
|
|
60
|
+
certificateNumber: '请输入证件号码',
|
|
61
|
+
nationality: '请选择国籍',
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const NO_ERROR = {
|
|
65
|
+
certificateType: '',
|
|
66
|
+
certificateNumber: '',
|
|
67
|
+
nationality: '',
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const isEmpty = (v: any) =>
|
|
71
|
+
v === undefined || v === null || (typeof v === 'string' && v.trim() === '');
|
|
54
72
|
export interface IStakeholder {
|
|
55
73
|
|
|
56
74
|
/** 是否显示导入按钮 */
|
|
@@ -96,6 +114,7 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
|
|
|
96
114
|
const [errorInfo, setInfo] = React.useState('');
|
|
97
115
|
const [nation, setNationStatue] = React.useState<any>('');
|
|
98
116
|
const [nationInfo, setNation] = React.useState('');
|
|
117
|
+
const [errors, setErrors] = React.useState<any>(NO_ERROR);
|
|
99
118
|
|
|
100
119
|
const { getFieldDecorator } = form;
|
|
101
120
|
|
|
@@ -149,6 +168,62 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
|
|
|
149
168
|
setExpand(typeof props.isExpand === 'boolean' ? props.isExpand : true);
|
|
150
169
|
}, [props.isExpand])
|
|
151
170
|
|
|
171
|
+
/**
|
|
172
|
+
* 生成校验器:三个字段要么全空,要么全不空
|
|
173
|
+
* @param {string} field 当前被校验的字段名
|
|
174
|
+
*/
|
|
175
|
+
const createGroupValidator = (field: any) => (rule: any, value: any, callback: any) => {
|
|
176
|
+
const { getFieldValue } = form;
|
|
177
|
+
|
|
178
|
+
// 实时读取三个字段的当前值
|
|
179
|
+
const values = GROUP_FIELDS.map(name => getFieldValue(name));
|
|
180
|
+
const filledCount = values.filter(v => !isEmpty(v)).length;
|
|
181
|
+
|
|
182
|
+
// 情况一:全空 —— 通过
|
|
183
|
+
if (filledCount === 0) {
|
|
184
|
+
return callback();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// 情况二:全不空 —— 通过
|
|
188
|
+
if (filledCount === GROUP_FIELDS.length) {
|
|
189
|
+
return callback();
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// 情况三:部分填写 —— 为空的字段报错
|
|
193
|
+
if (isEmpty(value)) {
|
|
194
|
+
return Promise.reject(EMPTY_MSG[field]);
|
|
195
|
+
}
|
|
196
|
+
callback();
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/** 根据三个字段当前值计算错误 */
|
|
200
|
+
const calcErrors = () => {
|
|
201
|
+
const { getFieldValue } = form;
|
|
202
|
+
const values = GROUP_FIELDS.map(f => getFieldValue(f));
|
|
203
|
+
const filledCount = values.filter(v => !isEmpty(v)).length;
|
|
204
|
+
|
|
205
|
+
const errors:any = { ...NO_ERROR };
|
|
206
|
+
|
|
207
|
+
// 全空 / 全不空:不报错
|
|
208
|
+
// 部分填写:为空的字段报错
|
|
209
|
+
if (filledCount > 0 && filledCount < GROUP_FIELDS.length) {
|
|
210
|
+
GROUP_FIELDS.forEach(f => {
|
|
211
|
+
if (isEmpty(getFieldValue(f))) {
|
|
212
|
+
errors[f] = EMPTY_MSG[f];
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
return errors;
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
/** 任一字段变化时,主动触发另外两个字段的校验,形成联动 */
|
|
220
|
+
const handleGroupChange = React.useCallback(() => {
|
|
221
|
+
setTimeout(() => {
|
|
222
|
+
form.validateFields(GROUP_FIELDS, { }, () => { });
|
|
223
|
+
setErrors(calcErrors())
|
|
224
|
+
}, 0);
|
|
225
|
+
}, [form]);
|
|
226
|
+
|
|
152
227
|
const onChangeType = React.useCallback(
|
|
153
228
|
(value: string) => {
|
|
154
229
|
const buyerTaxId = form?.getFieldValue("buyerTaxId");
|
|
@@ -223,15 +298,17 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
|
|
|
223
298
|
// 当“自然人证件类型”选择“238:中华人民共和国台湾居民居住证”时,校验是否为“ 158:中国台湾”
|
|
224
299
|
form?.setFieldsValue({ nationality: "158" });
|
|
225
300
|
}
|
|
301
|
+
handleGroupChange()
|
|
226
302
|
},
|
|
227
303
|
[form]
|
|
228
304
|
);
|
|
305
|
+
|
|
229
306
|
/** 校验证件号码*/
|
|
230
307
|
const validateIDCode = useCallback(
|
|
231
308
|
(_: any, value: string) => {
|
|
232
309
|
if (!value) {
|
|
233
|
-
setStatus('
|
|
234
|
-
setInfo('
|
|
310
|
+
setStatus('');
|
|
311
|
+
setInfo('')
|
|
235
312
|
return Promise.resolve();
|
|
236
313
|
}
|
|
237
314
|
|
|
@@ -339,8 +416,8 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
|
|
|
339
416
|
const validateNationality = useCallback(
|
|
340
417
|
(_: any, value: string) => {
|
|
341
418
|
if (!value) {
|
|
342
|
-
setNationStatue('
|
|
343
|
-
setNation('
|
|
419
|
+
setNationStatue('');
|
|
420
|
+
setNation('');
|
|
344
421
|
return Promise.resolve();
|
|
345
422
|
}
|
|
346
423
|
const idtype = form?.getFieldValue("certificateType");
|
|
@@ -400,6 +477,7 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
|
|
|
400
477
|
setNationStatue('');
|
|
401
478
|
setNation('');
|
|
402
479
|
return Promise.resolve();
|
|
480
|
+
|
|
403
481
|
},
|
|
404
482
|
[form]
|
|
405
483
|
);
|
|
@@ -626,25 +704,33 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
|
|
|
626
704
|
|
|
627
705
|
</Form.Item>
|
|
628
706
|
</Col>
|
|
629
|
-
{/* <label
|
|
707
|
+
{/* <label>自然人购买方补充信息</label> */}
|
|
630
708
|
<Col span={6} >
|
|
631
|
-
<Form.Item label='证件类型' colon={false} >
|
|
709
|
+
<Form.Item label='证件类型' colon={false} validateStatus={ errors.certificateType ? 'error' : "" } help={errors.certificateType}>
|
|
632
710
|
{getFieldDecorator('certificateType', {
|
|
633
|
-
rules: [
|
|
634
|
-
|
|
711
|
+
rules: [
|
|
712
|
+
{ validator: createGroupValidator('certificateType') }
|
|
713
|
+
]
|
|
714
|
+
})(<CardSelect onChange={onChangeType} readOnly={isReadOnly('certificateType')} placeholder="请选择" autoComplete="off" allowClear={true} />)}
|
|
635
715
|
</Form.Item>
|
|
636
716
|
</Col>
|
|
637
717
|
<Col span={7} >
|
|
638
|
-
<Form.Item label='证件号码' colon={false} validateStatus={validateStatus} help={errorInfo}>
|
|
718
|
+
<Form.Item label='证件号码' colon={false} validateStatus={validateStatus || (errors.certificateNumber ? 'error' : "") } help={errorInfo || errors.certificateNumber}>
|
|
639
719
|
{getFieldDecorator('certificateNumber', {
|
|
640
|
-
rules: [
|
|
641
|
-
|
|
720
|
+
rules: [
|
|
721
|
+
{ max: 30, message: `内容超长` },
|
|
722
|
+
{ validator: createGroupValidator('certificateNumber') },
|
|
723
|
+
{ validator: validateIDCode },]
|
|
724
|
+
})(<MyInput readOnly={isReadOnly('certificateNumber')} placeholder="请输入" autoComplete="off" onChange={handleGroupChange} />)}
|
|
642
725
|
</Form.Item>
|
|
643
726
|
</Col>
|
|
644
727
|
<Col span={6} >
|
|
645
|
-
<Form.Item label='国籍(或地区)' colon={false} validateStatus={nation} help={nationInfo}>
|
|
728
|
+
<Form.Item label='国籍(或地区)' colon={false} validateStatus={nation || (errors.nationality ? 'error' : "")} help={nationInfo || errors.nationality}>
|
|
646
729
|
{getFieldDecorator('nationality', {
|
|
647
|
-
rules: [
|
|
730
|
+
rules: [
|
|
731
|
+
{ validator: createGroupValidator('nationality') },
|
|
732
|
+
{ validator: validateNationality },
|
|
733
|
+
]
|
|
648
734
|
})(<NationalSelect showSearch={true}
|
|
649
735
|
optionFilterProp="children"
|
|
650
736
|
filterOption={(input: any, option: any) => {
|
|
@@ -652,7 +738,7 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
|
|
|
652
738
|
return option.label?.indexOf(input) >= 0;
|
|
653
739
|
}
|
|
654
740
|
return false;
|
|
655
|
-
}} readOnly={isReadOnly('nationality')} placeholder="
|
|
741
|
+
}} readOnly={isReadOnly('nationality')} placeholder="请选择" autoComplete="off" onChange={handleGroupChange} allowClear={true} />)}
|
|
656
742
|
</Form.Item>
|
|
657
743
|
</Col>
|
|
658
744
|
</Row>
|