sun-biz 0.0.4-beta.7 → 0.0.4-beta.9

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.
@@ -786,16 +786,39 @@ const _hoisted_3 = {
786
786
  props.changeSourceData(result);
787
787
  }
788
788
  function changeInputSort(flag, sort) {
789
- let data = [
789
+ const currentRow = tableData.value[flag];
790
+ if (!currentRow) return; // 创建新的排序数组
791
+ let newData = [
790
792
  ...tableData.value
793
+ ]; // 移除当前项
794
+ newData = newData.filter((item)=>item.prop !== currentRow.prop); // 在指定位置插入当前项
795
+ const insertIndex = Math.min(sort - 1, newData.length);
796
+ newData.splice(insertIndex, 0, currentRow); // 重新分配排序值
797
+ newData = newData.map((item, index)=>({
798
+ ...item,
799
+ ascendSort: index + 1
800
+ })); // 更新原始数据
801
+ let result = [
802
+ ...props.data
791
803
  ];
792
- let findObj = data.find((item, index)=>index == flag);
793
- data.splice(flag, 1);
794
- data.splice(sort - 1, 0, findObj);
804
+ result = result.map((item)=>{
805
+ let findObj = newData.find((cur)=>cur.prop === item.prop);
806
+ if (findObj) return {
807
+ ...item,
808
+ ascendSort: findObj.ascendSort
809
+ };
810
+ return {
811
+ ...item
812
+ };
813
+ });
814
+ props.changeSourceData(result);
815
+ }
816
+ const changeSort = (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.debounce)(changeInputSort, 1200);
817
+ function handleSortEnd(data) {
795
818
  data = data.map((item, index)=>({
796
819
  ...item,
797
820
  ascendSort: index + 1
798
- }));
821
+ })); // 更新原始数据中的排序字段
799
822
  let result = [
800
823
  ...props.data
801
824
  ];
@@ -811,16 +834,12 @@ const _hoisted_3 = {
811
834
  });
812
835
  props.changeSourceData(result);
813
836
  }
814
- const changeSort = (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.debounce)(changeInputSort, 1200);
815
- function handleSortEnd() {}
816
837
  const columns = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>getColumn());
817
838
  const tableData = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>{
818
- let result = props.data.filter((item)=>item.sortable);
819
- result.sort((a, b)=>(a?.ascendSort || 0) - (b?.ascendSort || 0));
820
- result = result.map((item, index)=>{
821
- item.ascendSort = index + 1;
822
- return item;
823
- });
839
+ let result = [
840
+ ...props.data.filter((item)=>item.sortable)
841
+ ]; // 按照现有的ascendSort排序,如果没有则按默认顺序
842
+ result.sort((a, b)=>(a?.ascendSort || 999) - (b?.ascendSort || 999));
824
843
  return result;
825
844
  });
826
845
  function changeAscendFlag(name, value, ascendSort) {
@@ -882,11 +901,11 @@ const _hoisted_3 = {
882
901
  max: tableData.value.length,
883
902
  modelValue: row.ascendSort,
884
903
  'onUpdate:modelValue': (value)=>{
885
- row.ascendSort = value;
886
- changeSort(index, value);
904
+ if (value && value !== row.ascendSort) changeSort(index, value);
887
905
  },
888
- onInput: (value)=>{
889
- changeSort(index, value);
906
+ onBlur: (event)=>{
907
+ const value = event.target.value;
908
+ if (value && parseInt(value) !== row.ascendSort) changeInputSort(index, parseInt(value));
890
909
  }
891
910
  })
892
911
  }
@@ -1459,7 +1478,9 @@ function dbgrid_component_settingvue_type_script_setup_true_lang_tsx_isSlot(s) {
1459
1478
  const tableColumn = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>sourceData.value.map((item)=>({
1460
1479
  ...item,
1461
1480
  isHidden: item.displayFlag === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.ENABLED_FLAG.NO,
1462
- render: ()=>'--'
1481
+ render: ()=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)("span", null, [
1482
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)("--")
1483
+ ])
1463
1484
  })));
1464
1485
  function changeSourceData(data) {
1465
1486
  sourceData.value = data;
@@ -1803,7 +1824,7 @@ function dbgrid_component_settingvue_type_script_setup_true_lang_tsx_isSlot(s) {
1803
1824
  const dbgrid_component_setting_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(dbgrid_component_settingvue_type_script_setup_true_lang_tsx, [
1804
1825
  [
1805
1826
  '__scopeId',
1806
- "data-v-65b0a9d0"
1827
+ "data-v-70d357a6"
1807
1828
  ]
1808
1829
  ]);
1809
1830
  /* ESM default export */ const dbgrid_component_setting = dbgrid_component_setting_exports_;
@@ -3813,7 +3834,7 @@ const defaultMoreText = "更多";
3813
3834
  // 更多按钮 文案逻辑
3814
3835
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect)(()=>{
3815
3836
  const activeIndex = __props.wayList?.findIndex((item)=>item.searchTypeId === __props.activeAccessWay.searchTypeId);
3816
- if (__props.wayList && void 0 !== activeIndex && -1 !== activeIndex) moreButtonText.value = activeIndex > realMaxNum.value ? __props.wayList[activeIndex].bizSearchTypeNameDisplay : defaultMoreText;
3837
+ if (__props.wayList && void 0 !== activeIndex && -1 !== activeIndex) moreButtonText.value = activeIndex < realMaxNum.value ? defaultMoreText : __props.wayList[activeIndex].bizSearchTypeNameDisplay;
3817
3838
  });
3818
3839
  return (_ctx, _cache)=>_ctx.wayList?.length ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", {
3819
3840
  key: 0,
@@ -4730,7 +4751,7 @@ const pluginMainRequest = async (methodName, params)=>{
4730
4751
  const result = await Api.PluginMain[methodName](paramsJson);
4731
4752
  const { ...res } = JSON.parse(result);
4732
4753
  // console.log("params", params);
4733
- // console.log("res", JSON.parse(result));
4754
+ console.log("出参", JSON.parse(result));
4734
4755
  if (!res.success) __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error(res.errorMessage);
4735
4756
  return [
4736
4757
  res.success ? void 0 : res,
@@ -7640,9 +7661,20 @@ const access_infovue_type_script_setup_true_lang_ts_name_accessInfo_hoisted_3 =
7640
7661
  "code"
7641
7662
  ])) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true),
7642
7663
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", access_infovue_type_script_setup_true_lang_ts_name_accessInfo_hoisted_3, [
7664
+ _ctx.clearBtn ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(_component_el_button, {
7665
+ key: 0,
7666
+ type: "primary",
7667
+ plain: "",
7668
+ onClick: clearFn
7669
+ }, {
7670
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7671
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(_ctx.btnTitle), 1)
7672
+ ]),
7673
+ _: 1
7674
+ })) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true),
7643
7675
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderSlot)(_ctx.$slots, "default"),
7644
7676
  _ctx.invoiceConfig ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(invoice), {
7645
- key: 0,
7677
+ key: 1,
7646
7678
  ref_key: "invoiceRef",
7647
7679
  ref: invoiceRef,
7648
7680
  "menu-id": _ctx.menuId,
@@ -7651,18 +7683,7 @@ const access_infovue_type_script_setup_true_lang_ts_name_accessInfo_hoisted_3 =
7651
7683
  }, null, 8, [
7652
7684
  "menu-id",
7653
7685
  "invoice-usage-code"
7654
- ])) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true),
7655
- _ctx.clearBtn ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(_component_el_button, {
7656
- key: 1,
7657
- type: "primary",
7658
- plain: "",
7659
- onClick: clearFn
7660
- }, {
7661
- default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7662
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(_ctx.btnTitle), 1)
7663
- ]),
7664
- _: 1
7665
- })) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
7686
+ ])) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
7666
7687
  ])
7667
7688
  ]),
7668
7689
  _ctx.showBanner && bannerCode.value ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(BannerInfo), {
@@ -7909,7 +7930,7 @@ function useInvoiceInfoFormConfig() {
7909
7930
  return data;
7910
7931
  }
7911
7932
  function useUpdateInvoiceFormConfig(options) {
7912
- const { reasonList, updateModel } = options;
7933
+ const { reasonList, updateModel, modelValue } = options;
7913
7934
  const data = useFormConfig({
7914
7935
  getData: ()=>[
7915
7936
  {
@@ -7925,8 +7946,38 @@ function useUpdateInvoiceFormConfig(options) {
7925
7946
  "blur",
7926
7947
  "change"
7927
7948
  ]
7949
+ },
7950
+ {
7951
+ validator: (rule, value, callback)=>{
7952
+ if (!/^\d+$/.test(value)) {
7953
+ callback(new Error("请输入数字"));
7954
+ return;
7955
+ }
7956
+ const currentNo = Number(modelValue.value?.currentNo);
7957
+ const endNo = Number(modelValue.value?.endNo);
7958
+ const numValue = Number(value); // 如果当前票号和结束票号一致,且调整后票号也一致,直接通过
7959
+ if (currentNo === endNo && numValue === currentNo) {
7960
+ callback();
7961
+ return;
7962
+ }
7963
+ if (numValue <= currentNo || numValue > endNo) callback(new Error(`调整后票号需在当前票号和结束票号之间!`));
7964
+ else callback();
7965
+ },
7966
+ trigger: [
7967
+ "blur",
7968
+ "change"
7969
+ ]
7928
7970
  }
7929
- ]
7971
+ ],
7972
+ extraProps: {
7973
+ onBlur: (e)=>{
7974
+ const value = e.target.value;
7975
+ if (value && modelValue.value?.currentNo) {
7976
+ const paddedValue = value.padStart(modelValue.value.currentNo.length, "0");
7977
+ e.target.value = paddedValue; // 更新输入框的值
7978
+ }
7979
+ }
7980
+ }
7930
7981
  },
7931
7982
  {
7932
7983
  label: "调整原因",
@@ -8005,7 +8056,7 @@ function useUpdateInvoiceFormConfig(options) {
8005
8056
  currentNo: originData.value?.currentNo
8006
8057
  };
8007
8058
  updateModel.value = {
8008
- currentNo: originData.value?.currentNo,
8059
+ currentNo: originData.value?.currentNo && originData.value?.endNo && originData.value.currentNo !== originData.value.endNo ? String(Number(originData.value.currentNo) + 1).padStart(originData.value.currentNo.length, "0") : originData.value?.currentNo,
8009
8060
  disableReasonId: originData.value?.disableReasonId,
8010
8061
  disableReasonDesc: originData.value?.disableReasonId === THE_OTHER_REASON_ID ? originData.value?.disableReasonDesc : void 0
8011
8062
  };
@@ -8032,7 +8083,9 @@ function useUpdateInvoiceFormConfig(options) {
8032
8083
  };
8033
8084
  /** 提交 */ const confirmFn = async ()=>{
8034
8085
  const isValid = await formRef.value.ref.validate();
8086
+ const isEndNo = updateModel.value?.currentNo === modelValue.value?.currentNo && modelValue.value?.currentNo === modelValue.value?.endNo;
8035
8087
  if (!isValid) return [];
8088
+ if (isEndNo) __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error("无可用票号,无法修改");
8036
8089
  const params = {
8037
8090
  invoiceAllotId: originData.value?.invoiceAllotId,
8038
8091
  currentNo: updateModel.value?.currentNo,
@@ -8047,6 +8100,7 @@ function useUpdateInvoiceFormConfig(options) {
8047
8100
  };
8048
8101
  const invoiceInfoConfig = useInvoiceInfoFormConfig();
8049
8102
  const updateInvoiceConfig = useUpdateInvoiceFormConfig({
8103
+ modelValue,
8050
8104
  reasonList,
8051
8105
  updateModel
8052
8106
  });
@@ -8054,7 +8108,7 @@ function useUpdateInvoiceFormConfig(options) {
8054
8108
  open: openDialog
8055
8109
  });
8056
8110
  return (_ctx, _cache)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(pro_dialog, {
8057
- title: "修改票号",
8111
+ title: "调整票号",
8058
8112
  ref_key: "dialogRef",
8059
8113
  ref: dialogRef,
8060
8114
  "destroy-on-close": "",
@@ -564,7 +564,7 @@ function useFetchDataset(codeSystemCodes, enabledFlag) {
564
564
  }
565
565
  /* ESM default export */ const use_editable_table = useEditableTable;
566
566
  function useDataChangeDetector(sources, options) {
567
- const confirmMessage = options?.confirmMessage || '您有未保存的更改,确定要离开吗?';
567
+ const confirmMessage = options?.confirmMessage || "您有未保存的更改,确定要离开吗?";
568
568
  // 缓存原始数据
569
569
  const cacheSources = sources.map((s)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.cloneDeep)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(s)));
570
570
  let clearSourceWatchList = [];
@@ -599,13 +599,14 @@ function useDataChangeDetector(sources, options) {
599
599
  sources.forEach((value, index)=>{
600
600
  console.log(index, (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(value), cacheSources[index]);
601
601
  });
602
- __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessageBox.confirm(confirmMessage, '提示', {
603
- confirmButtonText: '确定',
604
- cancelButtonText: '取消',
605
- type: 'warning'
602
+ __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessageBox.confirm(confirmMessage, "提示", {
603
+ confirmButtonText: "确定",
604
+ cancelButtonText: "取消",
605
+ type: "warning"
606
606
  }).then(async ()=>{
607
607
  next();
608
608
  }).catch(()=>{
609
+ if (options?.cancelFn) options.cancelFn();
609
610
  next(false);
610
611
  });
611
612
  return;
@@ -1,9 +1,10 @@
1
- import { Ref } from 'vue';
1
+ import { Ref } from "vue";
2
2
  export declare function useDataChangeDetector<T extends readonly unknown[]>(sources: {
3
3
  [K in keyof T]: Ref<T[K]>;
4
4
  }, options?: {
5
5
  confirmMessage?: string;
6
6
  isSkip?: Ref<boolean>;
7
+ cancelFn?: () => void;
7
8
  }): {
8
9
  checkChange: () => boolean;
9
10
  updateOriginals: () => void;
package/dist/index.js CHANGED
@@ -787,16 +787,39 @@ const _hoisted_3 = {
787
787
  props.changeSourceData(result);
788
788
  }
789
789
  function changeInputSort(flag, sort) {
790
- let data = [
790
+ const currentRow = tableData.value[flag];
791
+ if (!currentRow) return; // 创建新的排序数组
792
+ let newData = [
791
793
  ...tableData.value
794
+ ]; // 移除当前项
795
+ newData = newData.filter((item)=>item.prop !== currentRow.prop); // 在指定位置插入当前项
796
+ const insertIndex = Math.min(sort - 1, newData.length);
797
+ newData.splice(insertIndex, 0, currentRow); // 重新分配排序值
798
+ newData = newData.map((item, index)=>({
799
+ ...item,
800
+ ascendSort: index + 1
801
+ })); // 更新原始数据
802
+ let result = [
803
+ ...props.data
792
804
  ];
793
- let findObj = data.find((item, index)=>index == flag);
794
- data.splice(flag, 1);
795
- data.splice(sort - 1, 0, findObj);
805
+ result = result.map((item)=>{
806
+ let findObj = newData.find((cur)=>cur.prop === item.prop);
807
+ if (findObj) return {
808
+ ...item,
809
+ ascendSort: findObj.ascendSort
810
+ };
811
+ return {
812
+ ...item
813
+ };
814
+ });
815
+ props.changeSourceData(result);
816
+ }
817
+ const changeSort = (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.debounce)(changeInputSort, 1200);
818
+ function handleSortEnd(data) {
796
819
  data = data.map((item, index)=>({
797
820
  ...item,
798
821
  ascendSort: index + 1
799
- }));
822
+ })); // 更新原始数据中的排序字段
800
823
  let result = [
801
824
  ...props.data
802
825
  ];
@@ -812,16 +835,12 @@ const _hoisted_3 = {
812
835
  });
813
836
  props.changeSourceData(result);
814
837
  }
815
- const changeSort = (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.debounce)(changeInputSort, 1200);
816
- function handleSortEnd() {}
817
838
  const columns = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>getColumn());
818
839
  const tableData = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>{
819
- let result = props.data.filter((item)=>item.sortable);
820
- result.sort((a, b)=>(a?.ascendSort || 0) - (b?.ascendSort || 0));
821
- result = result.map((item, index)=>{
822
- item.ascendSort = index + 1;
823
- return item;
824
- });
840
+ let result = [
841
+ ...props.data.filter((item)=>item.sortable)
842
+ ]; // 按照现有的ascendSort排序,如果没有则按默认顺序
843
+ result.sort((a, b)=>(a?.ascendSort || 999) - (b?.ascendSort || 999));
825
844
  return result;
826
845
  });
827
846
  function changeAscendFlag(name, value, ascendSort) {
@@ -883,11 +902,11 @@ const _hoisted_3 = {
883
902
  max: tableData.value.length,
884
903
  modelValue: row.ascendSort,
885
904
  'onUpdate:modelValue': (value)=>{
886
- row.ascendSort = value;
887
- changeSort(index, value);
905
+ if (value && value !== row.ascendSort) changeSort(index, value);
888
906
  },
889
- onInput: (value)=>{
890
- changeSort(index, value);
907
+ onBlur: (event)=>{
908
+ const value = event.target.value;
909
+ if (value && parseInt(value) !== row.ascendSort) changeInputSort(index, parseInt(value));
891
910
  }
892
911
  })
893
912
  }
@@ -1460,7 +1479,9 @@ function dbgrid_component_settingvue_type_script_setup_true_lang_tsx_isSlot(s) {
1460
1479
  const tableColumn = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>sourceData.value.map((item)=>({
1461
1480
  ...item,
1462
1481
  isHidden: item.displayFlag === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.ENABLED_FLAG.NO,
1463
- render: ()=>'--'
1482
+ render: ()=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)("span", null, [
1483
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)("--")
1484
+ ])
1464
1485
  })));
1465
1486
  function changeSourceData(data) {
1466
1487
  sourceData.value = data;
@@ -1804,7 +1825,7 @@ function dbgrid_component_settingvue_type_script_setup_true_lang_tsx_isSlot(s) {
1804
1825
  const dbgrid_component_setting_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(dbgrid_component_settingvue_type_script_setup_true_lang_tsx, [
1805
1826
  [
1806
1827
  '__scopeId',
1807
- "data-v-65b0a9d0"
1828
+ "data-v-70d357a6"
1808
1829
  ]
1809
1830
  ]);
1810
1831
  /* ESM default export */ const dbgrid_component_setting = dbgrid_component_setting_exports_;
@@ -3897,7 +3918,7 @@ function useSelectByDirectionEvent(options) {
3897
3918
  };
3898
3919
  }
3899
3920
  function useDataChangeDetector(sources, options) {
3900
- const confirmMessage = options?.confirmMessage || '您有未保存的更改,确定要离开吗?';
3921
+ const confirmMessage = options?.confirmMessage || "您有未保存的更改,确定要离开吗?";
3901
3922
  // 缓存原始数据
3902
3923
  const cacheSources = sources.map((s)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.cloneDeep)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(s)));
3903
3924
  let clearSourceWatchList = [];
@@ -3932,13 +3953,14 @@ function useDataChangeDetector(sources, options) {
3932
3953
  sources.forEach((value, index)=>{
3933
3954
  console.log(index, (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(value), cacheSources[index]);
3934
3955
  });
3935
- __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessageBox.confirm(confirmMessage, '提示', {
3936
- confirmButtonText: '确定',
3937
- cancelButtonText: '取消',
3938
- type: 'warning'
3956
+ __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessageBox.confirm(confirmMessage, "提示", {
3957
+ confirmButtonText: "确定",
3958
+ cancelButtonText: "取消",
3959
+ type: "warning"
3939
3960
  }).then(async ()=>{
3940
3961
  next();
3941
3962
  }).catch(()=>{
3963
+ if (options?.cancelFn) options.cancelFn();
3942
3964
  next(false);
3943
3965
  });
3944
3966
  return;
@@ -4269,7 +4291,7 @@ const defaultMoreText = "更多";
4269
4291
  // 更多按钮 文案逻辑
4270
4292
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect)(()=>{
4271
4293
  const activeIndex = __props.wayList?.findIndex((item)=>item.searchTypeId === __props.activeAccessWay.searchTypeId);
4272
- if (__props.wayList && void 0 !== activeIndex && -1 !== activeIndex) moreButtonText.value = activeIndex > realMaxNum.value ? __props.wayList[activeIndex].bizSearchTypeNameDisplay : defaultMoreText;
4294
+ if (__props.wayList && void 0 !== activeIndex && -1 !== activeIndex) moreButtonText.value = activeIndex < realMaxNum.value ? defaultMoreText : __props.wayList[activeIndex].bizSearchTypeNameDisplay;
4273
4295
  });
4274
4296
  return (_ctx, _cache)=>_ctx.wayList?.length ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", {
4275
4297
  key: 0,
@@ -5186,7 +5208,7 @@ const pluginMainRequest = async (methodName, params)=>{
5186
5208
  const result = await Api.PluginMain[methodName](paramsJson);
5187
5209
  const { ...res } = JSON.parse(result);
5188
5210
  // console.log("params", params);
5189
- // console.log("res", JSON.parse(result));
5211
+ console.log("出参", JSON.parse(result));
5190
5212
  if (!res.success) __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error(res.errorMessage);
5191
5213
  return [
5192
5214
  res.success ? void 0 : res,
@@ -6144,7 +6166,7 @@ function useInvoiceInfoFormConfig() {
6144
6166
  return data;
6145
6167
  }
6146
6168
  function useUpdateInvoiceFormConfig(options) {
6147
- const { reasonList, updateModel } = options;
6169
+ const { reasonList, updateModel, modelValue } = options;
6148
6170
  const data = useFormConfig({
6149
6171
  getData: ()=>[
6150
6172
  {
@@ -6160,8 +6182,38 @@ function useUpdateInvoiceFormConfig(options) {
6160
6182
  "blur",
6161
6183
  "change"
6162
6184
  ]
6185
+ },
6186
+ {
6187
+ validator: (rule, value, callback)=>{
6188
+ if (!/^\d+$/.test(value)) {
6189
+ callback(new Error("请输入数字"));
6190
+ return;
6191
+ }
6192
+ const currentNo = Number(modelValue.value?.currentNo);
6193
+ const endNo = Number(modelValue.value?.endNo);
6194
+ const numValue = Number(value); // 如果当前票号和结束票号一致,且调整后票号也一致,直接通过
6195
+ if (currentNo === endNo && numValue === currentNo) {
6196
+ callback();
6197
+ return;
6198
+ }
6199
+ if (numValue <= currentNo || numValue > endNo) callback(new Error(`调整后票号需在当前票号和结束票号之间!`));
6200
+ else callback();
6201
+ },
6202
+ trigger: [
6203
+ "blur",
6204
+ "change"
6205
+ ]
6163
6206
  }
6164
- ]
6207
+ ],
6208
+ extraProps: {
6209
+ onBlur: (e)=>{
6210
+ const value = e.target.value;
6211
+ if (value && modelValue.value?.currentNo) {
6212
+ const paddedValue = value.padStart(modelValue.value.currentNo.length, "0");
6213
+ e.target.value = paddedValue; // 更新输入框的值
6214
+ }
6215
+ }
6216
+ }
6165
6217
  },
6166
6218
  {
6167
6219
  label: "调整原因",
@@ -7240,7 +7292,7 @@ const Title_exports_ = Titlevue_type_script_setup_true_lang_ts_name_sunTitle;
7240
7292
  currentNo: originData.value?.currentNo
7241
7293
  };
7242
7294
  updateModel.value = {
7243
- currentNo: originData.value?.currentNo,
7295
+ currentNo: originData.value?.currentNo && originData.value?.endNo && originData.value.currentNo !== originData.value.endNo ? String(Number(originData.value.currentNo) + 1).padStart(originData.value.currentNo.length, "0") : originData.value?.currentNo,
7244
7296
  disableReasonId: originData.value?.disableReasonId,
7245
7297
  disableReasonDesc: originData.value?.disableReasonId === THE_OTHER_REASON_ID ? originData.value?.disableReasonDesc : void 0
7246
7298
  };
@@ -7267,7 +7319,9 @@ const Title_exports_ = Titlevue_type_script_setup_true_lang_ts_name_sunTitle;
7267
7319
  };
7268
7320
  /** 提交 */ const confirmFn = async ()=>{
7269
7321
  const isValid = await formRef.value.ref.validate();
7322
+ const isEndNo = updateModel.value?.currentNo === modelValue.value?.currentNo && modelValue.value?.currentNo === modelValue.value?.endNo;
7270
7323
  if (!isValid) return [];
7324
+ if (isEndNo) __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error("无可用票号,无法修改");
7271
7325
  const params = {
7272
7326
  invoiceAllotId: originData.value?.invoiceAllotId,
7273
7327
  currentNo: updateModel.value?.currentNo,
@@ -7282,6 +7336,7 @@ const Title_exports_ = Titlevue_type_script_setup_true_lang_ts_name_sunTitle;
7282
7336
  };
7283
7337
  const invoiceInfoConfig = useInvoiceInfoFormConfig();
7284
7338
  const updateInvoiceConfig = useUpdateInvoiceFormConfig({
7339
+ modelValue,
7285
7340
  reasonList,
7286
7341
  updateModel
7287
7342
  });
@@ -7289,7 +7344,7 @@ const Title_exports_ = Titlevue_type_script_setup_true_lang_ts_name_sunTitle;
7289
7344
  open: openDialog
7290
7345
  });
7291
7346
  return (_ctx, _cache)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(pro_dialog, {
7292
- title: "修改票号",
7347
+ title: "调整票号",
7293
7348
  ref_key: "dialogRef",
7294
7349
  ref: dialogRef,
7295
7350
  "destroy-on-close": "",
@@ -7915,9 +7970,20 @@ const access_infovue_type_script_setup_true_lang_ts_name_accessInfo_hoisted_3 =
7915
7970
  "code"
7916
7971
  ])) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true),
7917
7972
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", access_infovue_type_script_setup_true_lang_ts_name_accessInfo_hoisted_3, [
7973
+ _ctx.clearBtn ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(_component_el_button, {
7974
+ key: 0,
7975
+ type: "primary",
7976
+ plain: "",
7977
+ onClick: clearFn
7978
+ }, {
7979
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7980
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(_ctx.btnTitle), 1)
7981
+ ]),
7982
+ _: 1
7983
+ })) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true),
7918
7984
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderSlot)(_ctx.$slots, "default"),
7919
7985
  _ctx.invoiceConfig ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(invoice), {
7920
- key: 0,
7986
+ key: 1,
7921
7987
  ref_key: "invoiceRef",
7922
7988
  ref: invoiceRef,
7923
7989
  "menu-id": _ctx.menuId,
@@ -7926,18 +7992,7 @@ const access_infovue_type_script_setup_true_lang_ts_name_accessInfo_hoisted_3 =
7926
7992
  }, null, 8, [
7927
7993
  "menu-id",
7928
7994
  "invoice-usage-code"
7929
- ])) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true),
7930
- _ctx.clearBtn ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(_component_el_button, {
7931
- key: 1,
7932
- type: "primary",
7933
- plain: "",
7934
- onClick: clearFn
7935
- }, {
7936
- default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7937
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(_ctx.btnTitle), 1)
7938
- ]),
7939
- _: 1
7940
- })) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
7995
+ ])) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
7941
7996
  ])
7942
7997
  ]),
7943
7998
  _ctx.showBanner && bannerCode.value ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(BannerInfo), {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sun-biz",
3
- "version": "0.0.4-beta.7",
3
+ "version": "0.0.4-beta.9",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  "src/*",