sun-biz 0.0.4-beta.6 → 0.0.4-beta.8

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.
@@ -3813,7 +3813,7 @@ const defaultMoreText = "更多";
3813
3813
  // 更多按钮 文案逻辑
3814
3814
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect)(()=>{
3815
3815
  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;
3816
+ if (__props.wayList && void 0 !== activeIndex && -1 !== activeIndex) moreButtonText.value = activeIndex < realMaxNum.value ? defaultMoreText : __props.wayList[activeIndex].bizSearchTypeNameDisplay;
3817
3817
  });
3818
3818
  return (_ctx, _cache)=>_ctx.wayList?.length ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", {
3819
3819
  key: 0,
@@ -7909,7 +7909,7 @@ function useInvoiceInfoFormConfig() {
7909
7909
  return data;
7910
7910
  }
7911
7911
  function useUpdateInvoiceFormConfig(options) {
7912
- const { reasonList, updateModel } = options;
7912
+ const { reasonList, updateModel, modelValue } = options;
7913
7913
  const data = useFormConfig({
7914
7914
  getData: ()=>[
7915
7915
  {
@@ -7925,8 +7925,34 @@ function useUpdateInvoiceFormConfig(options) {
7925
7925
  "blur",
7926
7926
  "change"
7927
7927
  ]
7928
+ },
7929
+ {
7930
+ validator: (rule, value, callback)=>{
7931
+ if (!/^\d+$/.test(value)) {
7932
+ callback(new Error("请输入数字"));
7933
+ return;
7934
+ }
7935
+ const currentNo = Number(modelValue.value?.currentNo);
7936
+ const endNo = Number(modelValue.value?.endNo);
7937
+ const numValue = Number(value);
7938
+ if (numValue < currentNo || numValue > endNo) callback(new Error(`调整后票号需在${modelValue.value?.currentNo}-${modelValue.value?.endNo}之间`));
7939
+ else callback();
7940
+ },
7941
+ trigger: [
7942
+ "blur",
7943
+ "change"
7944
+ ]
7928
7945
  }
7929
- ]
7946
+ ],
7947
+ extraProps: {
7948
+ onBlur: (e)=>{
7949
+ const value = e.target.value;
7950
+ if (value && modelValue.value?.currentNo) {
7951
+ const paddedValue = value.padStart(modelValue.value.currentNo.length, "0");
7952
+ e.target.value = paddedValue; // 更新输入框的值
7953
+ }
7954
+ }
7955
+ }
7930
7956
  },
7931
7957
  {
7932
7958
  label: "调整原因",
@@ -8005,7 +8031,7 @@ function useUpdateInvoiceFormConfig(options) {
8005
8031
  currentNo: originData.value?.currentNo
8006
8032
  };
8007
8033
  updateModel.value = {
8008
- currentNo: originData.value?.currentNo,
8034
+ 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
8035
  disableReasonId: originData.value?.disableReasonId,
8010
8036
  disableReasonDesc: originData.value?.disableReasonId === THE_OTHER_REASON_ID ? originData.value?.disableReasonDesc : void 0
8011
8037
  };
@@ -8047,6 +8073,7 @@ function useUpdateInvoiceFormConfig(options) {
8047
8073
  };
8048
8074
  const invoiceInfoConfig = useInvoiceInfoFormConfig();
8049
8075
  const updateInvoiceConfig = useUpdateInvoiceFormConfig({
8076
+ modelValue,
8050
8077
  reasonList,
8051
8078
  updateModel
8052
8079
  });
@@ -8054,7 +8081,7 @@ function useUpdateInvoiceFormConfig(options) {
8054
8081
  open: openDialog
8055
8082
  });
8056
8083
  return (_ctx, _cache)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(pro_dialog, {
8057
- title: "修改票号",
8084
+ title: "调整票号",
8058
8085
  ref_key: "dialogRef",
8059
8086
  ref: dialogRef,
8060
8087
  "destroy-on-close": "",
@@ -1,4 +1,6 @@
1
1
  /** 获取系统时间 */
2
- export declare function getSystemTime(): Promise<string | null>;
2
+ export declare function getSystemTime(): Promise<string | {
3
+ data: string;
4
+ }>;
3
5
  /** 获取系统时间 */
4
6
  export declare function useFetchSystemTiem(): import("vue").Ref<any, any>;
package/dist/index.js CHANGED
@@ -4269,7 +4269,7 @@ const defaultMoreText = "更多";
4269
4269
  // 更多按钮 文案逻辑
4270
4270
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect)(()=>{
4271
4271
  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;
4272
+ if (__props.wayList && void 0 !== activeIndex && -1 !== activeIndex) moreButtonText.value = activeIndex < realMaxNum.value ? defaultMoreText : __props.wayList[activeIndex].bizSearchTypeNameDisplay;
4273
4273
  });
4274
4274
  return (_ctx, _cache)=>_ctx.wayList?.length ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", {
4275
4275
  key: 0,
@@ -6144,7 +6144,7 @@ function useInvoiceInfoFormConfig() {
6144
6144
  return data;
6145
6145
  }
6146
6146
  function useUpdateInvoiceFormConfig(options) {
6147
- const { reasonList, updateModel } = options;
6147
+ const { reasonList, updateModel, modelValue } = options;
6148
6148
  const data = useFormConfig({
6149
6149
  getData: ()=>[
6150
6150
  {
@@ -6160,8 +6160,34 @@ function useUpdateInvoiceFormConfig(options) {
6160
6160
  "blur",
6161
6161
  "change"
6162
6162
  ]
6163
+ },
6164
+ {
6165
+ validator: (rule, value, callback)=>{
6166
+ if (!/^\d+$/.test(value)) {
6167
+ callback(new Error("请输入数字"));
6168
+ return;
6169
+ }
6170
+ const currentNo = Number(modelValue.value?.currentNo);
6171
+ const endNo = Number(modelValue.value?.endNo);
6172
+ const numValue = Number(value);
6173
+ if (numValue < currentNo || numValue > endNo) callback(new Error(`调整后票号需在${modelValue.value?.currentNo}-${modelValue.value?.endNo}之间`));
6174
+ else callback();
6175
+ },
6176
+ trigger: [
6177
+ "blur",
6178
+ "change"
6179
+ ]
6163
6180
  }
6164
- ]
6181
+ ],
6182
+ extraProps: {
6183
+ onBlur: (e)=>{
6184
+ const value = e.target.value;
6185
+ if (value && modelValue.value?.currentNo) {
6186
+ const paddedValue = value.padStart(modelValue.value.currentNo.length, "0");
6187
+ e.target.value = paddedValue; // 更新输入框的值
6188
+ }
6189
+ }
6190
+ }
6165
6191
  },
6166
6192
  {
6167
6193
  label: "调整原因",
@@ -7240,7 +7266,7 @@ const Title_exports_ = Titlevue_type_script_setup_true_lang_ts_name_sunTitle;
7240
7266
  currentNo: originData.value?.currentNo
7241
7267
  };
7242
7268
  updateModel.value = {
7243
- currentNo: originData.value?.currentNo,
7269
+ 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
7270
  disableReasonId: originData.value?.disableReasonId,
7245
7271
  disableReasonDesc: originData.value?.disableReasonId === THE_OTHER_REASON_ID ? originData.value?.disableReasonDesc : void 0
7246
7272
  };
@@ -7282,6 +7308,7 @@ const Title_exports_ = Titlevue_type_script_setup_true_lang_ts_name_sunTitle;
7282
7308
  };
7283
7309
  const invoiceInfoConfig = useInvoiceInfoFormConfig();
7284
7310
  const updateInvoiceConfig = useUpdateInvoiceFormConfig({
7311
+ modelValue,
7285
7312
  reasonList,
7286
7313
  updateModel
7287
7314
  });
@@ -7289,7 +7316,7 @@ const Title_exports_ = Titlevue_type_script_setup_true_lang_ts_name_sunTitle;
7289
7316
  open: openDialog
7290
7317
  });
7291
7318
  return (_ctx, _cache)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(pro_dialog, {
7292
- title: "修改票号",
7319
+ title: "调整票号",
7293
7320
  ref_key: "dialogRef",
7294
7321
  ref: dialogRef,
7295
7322
  "destroy-on-close": "",
@@ -8785,7 +8812,7 @@ const form_design_render_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(f
8785
8812
  ]);
8786
8813
  /* ESM default export */ const form_design_render = form_design_render_exports_;
8787
8814
  /** 获取系统时间 */ async function getSystemTime() {
8788
- const [res] = await (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.dictRequest)("/dictCommon/getSysTime");
8815
+ const [, res] = await (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.dictRequest)("/dictCommon/getSysTime");
8789
8816
  if (res?.success) return res.data;
8790
8817
  return (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.getNowTime)();
8791
8818
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sun-biz",
3
- "version": "0.0.4-beta.6",
3
+ "version": "0.0.4-beta.8",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  "src/*",