kts-component-invoice-operate 3.0.20 → 3.0.22

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.
@@ -21,8 +21,10 @@ export default class EndowCode {
21
21
  id: string;
22
22
  pid: string;
23
23
  }[]>;
24
- /** 税率 是否可以编辑 */
24
+ /** 税率 优惠政策 */
25
25
  getReadOnlyTaxRate?: (value?: GoodsListState) => boolean;
26
+ /** 优惠政策 优惠政策 */
27
+ getReadOnlyFavouredPolicy?: (value?: GoodsListState) => boolean;
26
28
  /**
27
29
  * 获取赋码时候的默认值
28
30
  * @param value 商品信息
package/dist/index.esm.js CHANGED
@@ -938,6 +938,7 @@ var EndowCode = /*#__PURE__*/_createClass(function EndowCode() {
938
938
  }));
939
939
  this.getTaxCategoryCodeTree = void 0;
940
940
  this.getReadOnlyTaxRate = void 0;
941
+ this.getReadOnlyFavouredPolicy = void 0;
941
942
  this.getDefaultValue = void 0;
942
943
  this.readOnlyTaxRateMap = {
943
944
  /** 草稿发票 */
@@ -2049,11 +2050,13 @@ var Statistics = (function () {
2049
2050
  }))), React.createElement("div", {
2050
2051
  style: {
2051
2052
  flex: 1,
2052
- border: 'none'
2053
+ border: 'none',
2054
+ textAlign: 'right'
2053
2055
  }
2054
2056
  }, React.createElement("label", null, "\uFF08\u5C0F\u5199\uFF09")), React.createElement("div", {
2055
2057
  style: {
2056
- flex: 3,
2058
+ flex: 'none',
2059
+ width: 359,
2057
2060
  border: 'none'
2058
2061
  }
2059
2062
  }, React.createElement("label", null, parseFloat(lineAmountIncludeTax).toFixed(2)))));
@@ -13007,7 +13010,7 @@ var DrawerBody$3 = function DrawerBody(props) {
13007
13010
  var actions = React.useMemo(function () {
13008
13011
  return createAsyncFormActions();
13009
13012
  }, []);
13010
- /** 税率 是否可以编辑 */
13013
+ /** 税率 是否禁用 */
13011
13014
 
13012
13015
  var readOnlyTaxRate = controller.useMemo(function (s) {
13013
13016
  if (s.goodsListState.endowCode.getReadOnlyTaxRate) {
@@ -13016,6 +13019,15 @@ var DrawerBody$3 = function DrawerBody(props) {
13016
13019
  return false;
13017
13020
  }
13018
13021
  }, []);
13022
+ /** 优惠政策 是否禁用 */
13023
+
13024
+ var readOnlyFavouredPolicy = controller.useMemo(function (s) {
13025
+ if (s.goodsListState.endowCode.getReadOnlyFavouredPolicy) {
13026
+ return s.goodsListState.endowCode.getReadOnlyFavouredPolicy(s.goodsListState);
13027
+ } else {
13028
+ return false;
13029
+ }
13030
+ }, []);
13019
13031
  /** 税率列表 */
13020
13032
 
13021
13033
  var taxRateList = controller.useMemo(function (s) {
@@ -13522,6 +13534,9 @@ var DrawerBody$3 = function DrawerBody(props) {
13522
13534
  name: "favouredPolicyMark",
13523
13535
  type: "number",
13524
13536
  title: "\u662F\u5426\u4EAB\u53D7\u4F18\u60E0\u653F\u7B56",
13537
+ "x-component-props": {
13538
+ disabled: readOnlyFavouredPolicy
13539
+ },
13525
13540
  enum: [{
13526
13541
  label: '是',
13527
13542
  value: 1
@@ -13538,6 +13553,9 @@ var DrawerBody$3 = function DrawerBody(props) {
13538
13553
  name: "favouredPolicyName",
13539
13554
  type: "string",
13540
13555
  title: "\u4F18\u60E0\u653F\u7B56\u7C7B\u578B",
13556
+ "x-component-props": {
13557
+ disabled: readOnlyFavouredPolicy
13558
+ },
13541
13559
  enum: favouredPolicyNameList,
13542
13560
  default: defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.favouredPolicyName,
13543
13561
  "x-rules": [{
package/dist/index.js CHANGED
@@ -948,6 +948,7 @@ var EndowCode = /*#__PURE__*/_createClass(function EndowCode() {
948
948
  }));
949
949
  this.getTaxCategoryCodeTree = void 0;
950
950
  this.getReadOnlyTaxRate = void 0;
951
+ this.getReadOnlyFavouredPolicy = void 0;
951
952
  this.getDefaultValue = void 0;
952
953
  this.readOnlyTaxRateMap = {
953
954
  /** 草稿发票 */
@@ -2059,11 +2060,13 @@ var Statistics = (function () {
2059
2060
  }))), React__default['default'].createElement("div", {
2060
2061
  style: {
2061
2062
  flex: 1,
2062
- border: 'none'
2063
+ border: 'none',
2064
+ textAlign: 'right'
2063
2065
  }
2064
2066
  }, React__default['default'].createElement("label", null, "\uFF08\u5C0F\u5199\uFF09")), React__default['default'].createElement("div", {
2065
2067
  style: {
2066
- flex: 3,
2068
+ flex: 'none',
2069
+ width: 359,
2067
2070
  border: 'none'
2068
2071
  }
2069
2072
  }, React__default['default'].createElement("label", null, parseFloat(lineAmountIncludeTax).toFixed(2)))));
@@ -13017,7 +13020,7 @@ var DrawerBody$3 = function DrawerBody(props) {
13017
13020
  var actions = React__default['default'].useMemo(function () {
13018
13021
  return antd.createAsyncFormActions();
13019
13022
  }, []);
13020
- /** 税率 是否可以编辑 */
13023
+ /** 税率 是否禁用 */
13021
13024
 
13022
13025
  var readOnlyTaxRate = controller.useMemo(function (s) {
13023
13026
  if (s.goodsListState.endowCode.getReadOnlyTaxRate) {
@@ -13026,6 +13029,15 @@ var DrawerBody$3 = function DrawerBody(props) {
13026
13029
  return false;
13027
13030
  }
13028
13031
  }, []);
13032
+ /** 优惠政策 是否禁用 */
13033
+
13034
+ var readOnlyFavouredPolicy = controller.useMemo(function (s) {
13035
+ if (s.goodsListState.endowCode.getReadOnlyFavouredPolicy) {
13036
+ return s.goodsListState.endowCode.getReadOnlyFavouredPolicy(s.goodsListState);
13037
+ } else {
13038
+ return false;
13039
+ }
13040
+ }, []);
13029
13041
  /** 税率列表 */
13030
13042
 
13031
13043
  var taxRateList = controller.useMemo(function (s) {
@@ -13532,6 +13544,9 @@ var DrawerBody$3 = function DrawerBody(props) {
13532
13544
  name: "favouredPolicyMark",
13533
13545
  type: "number",
13534
13546
  title: "\u662F\u5426\u4EAB\u53D7\u4F18\u60E0\u653F\u7B56",
13547
+ "x-component-props": {
13548
+ disabled: readOnlyFavouredPolicy
13549
+ },
13535
13550
  enum: [{
13536
13551
  label: '是',
13537
13552
  value: 1
@@ -13548,6 +13563,9 @@ var DrawerBody$3 = function DrawerBody(props) {
13548
13563
  name: "favouredPolicyName",
13549
13564
  type: "string",
13550
13565
  title: "\u4F18\u60E0\u653F\u7B56\u7C7B\u578B",
13566
+ "x-component-props": {
13567
+ disabled: readOnlyFavouredPolicy
13568
+ },
13551
13569
  enum: favouredPolicyNameList,
13552
13570
  default: defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.favouredPolicyName,
13553
13571
  "x-rules": [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.0.20",
3
+ "version": "3.0.22",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -21,9 +21,12 @@ export default class EndowCode {
21
21
  */
22
22
  getTaxCategoryCodeTree?: (taxCategoryCode?: string, val?: string) => Promise<{ id: string, pid: string }[]>;
23
23
 
24
- /** 税率 是否可以编辑 */
24
+ /** 税率 优惠政策 */
25
25
  getReadOnlyTaxRate?: (value?: GoodsListState) => boolean;
26
26
 
27
+ /** 优惠政策 优惠政策 */
28
+ getReadOnlyFavouredPolicy?: (value?: GoodsListState) => boolean;
29
+
27
30
  /**
28
31
  * 获取赋码时候的默认值
29
32
  * @param value 商品信息
@@ -87,7 +87,7 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
87
87
 
88
88
  const actions = React.useMemo(() => createAsyncFormActions(), []);
89
89
 
90
- /** 税率 是否可以编辑 */
90
+ /** 税率 是否禁用 */
91
91
  const readOnlyTaxRate = controller.useMemo(s => {
92
92
  if (s.goodsListState.endowCode.getReadOnlyTaxRate) {
93
93
  return s.goodsListState.endowCode.getReadOnlyTaxRate(s.goodsListState);
@@ -96,6 +96,15 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
96
96
  }
97
97
  }, [])
98
98
 
99
+ /** 优惠政策 是否禁用 */
100
+ const readOnlyFavouredPolicy = controller.useMemo(s => {
101
+ if (s.goodsListState.endowCode.getReadOnlyFavouredPolicy) {
102
+ return s.goodsListState.endowCode.getReadOnlyFavouredPolicy(s.goodsListState);
103
+ } else {
104
+ return false;
105
+ }
106
+ }, [])
107
+
99
108
  /** 税率列表 */
100
109
  const taxRateList = controller.useMemo(s => s.goodsListState.taxRateList.map((e) => ({ label: `${e}%`, value: e })), []);
101
110
 
@@ -382,6 +391,7 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
382
391
  name="favouredPolicyMark"
383
392
  type="number"
384
393
  title="是否享受优惠政策"
394
+ x-component-props={{ disabled: readOnlyFavouredPolicy }}
385
395
  enum={[
386
396
  { label: '是', value: 1 },
387
397
  { label: '否', value: 0 },
@@ -394,6 +404,7 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
394
404
  name="favouredPolicyName"
395
405
  type="string"
396
406
  title="优惠政策类型"
407
+ x-component-props={{ disabled: readOnlyFavouredPolicy }}
397
408
  enum={favouredPolicyNameList}
398
409
  default={defaultValue?.favouredPolicyName}
399
410
  x-rules={[{ message: '请选择是否享受优惠政策', required: true }]}
@@ -98,10 +98,10 @@ export default () => {
98
98
  {nzhcn.toMoney(lineAmountIncludeTax, { outSymbol: false })}
99
99
  </label>
100
100
  </div>
101
- <div style={{ flex: 1, border: 'none' }}>
101
+ <div style={{ flex: 1, border: 'none', textAlign: 'right' }}>
102
102
  <label>(小写)</label>
103
103
  </div>
104
- <div style={{ flex: 3, border: 'none' }}>
104
+ <div style={{ flex: 'none', width: 359, border: 'none' }}>
105
105
  <label>{parseFloat(lineAmountIncludeTax).toFixed(2)}</label>
106
106
  </div>
107
107
  </div>