sun-biz 0.0.4-beta.1 → 0.0.4-beta.3

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.
@@ -549,7 +549,7 @@ const RenderColumn_exports_ = RenderColumnvue_type_script_lang_ts_setup_true_nam
549
549
  */ const queryDataSetByCodeSystemCodes = (params)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.dictRequest)('/codeSystem/queryDataSetByCodeSystemCodes', params, {
550
550
  cancel: false
551
551
  });
552
- function use_fetch_dataset_useFetchDataset(codeSystemCodes, enabledFlag) {
552
+ function useFetchDataset(codeSystemCodes, enabledFlag) {
553
553
  const list = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
554
554
  async function fetchData() {
555
555
  if (codeSystemCodes) {
@@ -1131,16 +1131,16 @@ const pro_dialogvue_type_script_setup_true_lang_ts_name_ProDialog_hoisted_2 = {
1131
1131
  // 纯关闭弹窗,不执行其他操作,用于左上角X
1132
1132
  const justCloseDialog = ()=>{
1133
1133
  closeDialog();
1134
- emits('close');
1134
+ emits("close");
1135
1135
  };
1136
1136
  // 处理常规关闭,支持before-close钩子
1137
1137
  const handleClose = ()=>{
1138
- if (attrs?.['before-close']) (attrs?.['before-close'])(closeDialog);
1138
+ if (attrs?.["before-close"]) (attrs?.["before-close"])(closeDialog);
1139
1139
  else closeDialog();
1140
1140
  };
1141
1141
  // 处理取消按钮点击
1142
1142
  const handleCancel = ()=>{
1143
- emits('cancel');
1143
+ emits("cancel");
1144
1144
  if (__props.closeOnCancel) handleClose();
1145
1145
  };
1146
1146
  const handleConfirm = async ()=>{
@@ -1151,7 +1151,7 @@ const pro_dialogvue_type_script_setup_true_lang_ts_name_ProDialog_hoisted_2 = {
1151
1151
  loading.value = false;
1152
1152
  if (!err) {
1153
1153
  handleClose();
1154
- emits('success');
1154
+ emits("success");
1155
1155
  }
1156
1156
  } catch {
1157
1157
  loading.value = false;
@@ -1159,7 +1159,7 @@ const pro_dialogvue_type_script_setup_true_lang_ts_name_ProDialog_hoisted_2 = {
1159
1159
  }
1160
1160
  };
1161
1161
  const changeScreen = async (flag)=>{
1162
- emits('changeScreen', flag);
1162
+ emits("changeScreen", flag);
1163
1163
  };
1164
1164
  __expose({
1165
1165
  ref: dialogRef,
@@ -1275,7 +1275,7 @@ const pro_dialogvue_type_script_setup_true_lang_ts_name_ProDialog_hoisted_2 = {
1275
1275
  onClick: (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(openDialog)
1276
1276
  }, {
1277
1277
  default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
1278
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(__WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.['button-text']), 1)
1278
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(__WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.["button-text"]), 1)
1279
1279
  ]),
1280
1280
  _: 1
1281
1281
  }, 8, [
@@ -1339,7 +1339,7 @@ function dbgrid_component_settingvue_type_script_setup_true_lang_tsx_isSlot(s) {
1339
1339
  dialogRef.value.open();
1340
1340
  });
1341
1341
  const scrollKeyWord = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)('');
1342
- const dataSetList = use_fetch_dataset_useFetchDataset([
1342
+ const dataSetList = useFetchDataset([
1343
1343
  __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.INFLUENCE_SCOPE_CODE_NAME
1344
1344
  ]);
1345
1345
  const renderDialog = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(true); //控制prodialog 是否销毁
@@ -1852,7 +1852,7 @@ const EXPORT_FILE = 'export-file';
1852
1852
  'success'
1853
1853
  ],
1854
1854
  setup (__props, { emit: __emit }) {
1855
- const dataSetList = use_fetch_dataset_useFetchDataset([
1855
+ const dataSetList = useFetchDataset([
1856
1856
  FILE_TYPE_CODE
1857
1857
  ]);
1858
1858
  const props = __props;
@@ -2093,11 +2093,22 @@ const TableSettingButton_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(T
2093
2093
  ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(true), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(props.tableColumns, (item, index)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(RenderColumn, {
2094
2094
  "column-obj": item,
2095
2095
  key: index
2096
- }, null, 8, [
2096
+ }, (0, __WEBPACK_EXTERNAL_MODULE_vue__.createSlots)({
2097
+ _: 2
2098
+ }, [
2099
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(Object.keys(_ctx.$slots), (slot)=>({
2100
+ name: slot,
2101
+ fn: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)((scope)=>[
2102
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderSlot)(_ctx.$slots, slot, (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
2103
+ ref_for: true
2104
+ }, scope))
2105
+ ])
2106
+ }))
2107
+ ]), 1032, [
2097
2108
  "column-obj"
2098
2109
  ]))), 128))
2099
2110
  ]),
2100
- _: 1
2111
+ _: 3
2101
2112
  }, 16, [
2102
2113
  "id",
2103
2114
  "data",
@@ -2650,7 +2661,16 @@ const SELECTION = 'selection';
2650
2661
  "table-columns": tableColumns.value
2651
2662
  }, _ctx.$attrs, {
2652
2663
  draggable: props.draggable
2653
- }), null, 16, [
2664
+ }), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createSlots)({
2665
+ _: 2
2666
+ }, [
2667
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(Object.keys(_ctx.$slots), (slot)=>({
2668
+ name: slot,
2669
+ fn: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)((scope)=>[
2670
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderSlot)(_ctx.$slots, slot, (0, __WEBPACK_EXTERNAL_MODULE_vue__.normalizeProps)((0, __WEBPACK_EXTERNAL_MODULE_vue__.guardReactiveProps)(scope)))
2671
+ ])
2672
+ }))
2673
+ ]), 1040, [
2654
2674
  "id",
2655
2675
  "export-file-flag",
2656
2676
  "componentDesc",
@@ -2664,7 +2684,7 @@ const SELECTION = 'selection';
2664
2684
  "draggable"
2665
2685
  ])
2666
2686
  ]),
2667
- _: 1
2687
+ _: 3
2668
2688
  }, 8, [
2669
2689
  "editable",
2670
2690
  "model"
@@ -3442,10 +3462,17 @@ function useSelectByDirectionEvent(options) {
3442
3462
  });
3443
3463
  }
3444
3464
  /* ESM default export */ const use_direction_select = useSelectByDirectionEvent;
3465
+ function useFormConfig(options) {
3466
+ const { t } = (0, __WEBPACK_EXTERNAL_MODULE_i18next_vue__.useTranslation)();
3467
+ const { getData, dataSetCodes } = options;
3468
+ const dataSet = useFetchDataset(dataSetCodes);
3469
+ const data = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>getData(t, dataSet));
3470
+ return data;
3471
+ }
3445
3472
  function useColumnConfig(options) {
3446
3473
  const { t } = (0, __WEBPACK_EXTERNAL_MODULE_i18next_vue__.useTranslation)();
3447
3474
  const { getData, dataSetCodes } = options;
3448
- const dataSet = use_fetch_dataset_useFetchDataset(dataSetCodes);
3475
+ const dataSet = useFetchDataset(dataSetCodes);
3449
3476
  const data = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>getData(t, dataSet));
3450
3477
  return data;
3451
3478
  }
@@ -3695,6 +3722,7 @@ const Icon_exports_ = Iconvue_type_script_setup_true_lang_ts;
3695
3722
  });
3696
3723
  const AccessButton_exports_ = AccessButtonvue_type_script_setup_true_lang_ts;
3697
3724
  /* ESM default export */ const AccessButton = AccessButton_exports_;
3725
+ const defaultMoreText = "更多";
3698
3726
  /* ESM default export */ const AccessWayListvue_type_script_setup_true_lang_ts = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
3699
3727
  __name: 'AccessWayList',
3700
3728
  props: {
@@ -3712,7 +3740,7 @@ const AccessButton_exports_ = AccessButtonvue_type_script_setup_true_lang_ts;
3712
3740
  const emits = __emit;
3713
3741
  const wrapperRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
3714
3742
  const realMaxNum = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(0);
3715
- const moreButtonText = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)('更多');
3743
+ const moreButtonText = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(defaultMoreText);
3716
3744
  const setRealMaxNum = (val)=>{
3717
3745
  realMaxNum.value = val;
3718
3746
  };
@@ -3728,8 +3756,8 @@ const AccessButton_exports_ = AccessButtonvue_type_script_setup_true_lang_ts;
3728
3756
  });
3729
3757
  };
3730
3758
  const handleButtonClick = (item, isMore)=>{
3731
- moreButtonText.value = isMore ? item.bizSearchTypeNameDisplay : '更多';
3732
- emits('way-change', item);
3759
+ moreButtonText.value = isMore ? item.bizSearchTypeNameDisplay : defaultMoreText;
3760
+ emits("way-change", item);
3733
3761
  };
3734
3762
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect)(()=>{
3735
3763
  if (__props.wayList?.length && wrapperRef?.value) (0, __WEBPACK_EXTERNAL_MODULE_vue__.nextTick)(()=>{
@@ -3766,6 +3794,7 @@ const AccessButton_exports_ = AccessButtonvue_type_script_setup_true_lang_ts;
3766
3794
  }, {
3767
3795
  reference: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
3768
3796
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElButton), {
3797
+ type: moreButtonText.value === defaultMoreText ? 'default' : 'primary',
3769
3798
  style: {
3770
3799
  "margin-left": "10px"
3771
3800
  }
@@ -3774,7 +3803,9 @@ const AccessButton_exports_ = AccessButtonvue_type_script_setup_true_lang_ts;
3774
3803
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(moreButtonText.value) + " ⋮ ", 1)
3775
3804
  ]),
3776
3805
  _: 1
3777
- })
3806
+ }, 8, [
3807
+ "type"
3808
+ ])
3778
3809
  ]),
3779
3810
  default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
3780
3811
  ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(true), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(_ctx.wayList.slice(realMaxNum.value), (item)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(AccessButton, {
@@ -4803,6 +4834,17 @@ var constant_DATA_SOURCE_CONTENT_TYPE_CODE = /*#__PURE__*/ function(DATA_SOURCE_
4803
4834
  */ DATA_SOURCE_CONTENT_TYPE_CODE["BASE64"] = "BASE64";
4804
4835
  return DATA_SOURCE_CONTENT_TYPE_CODE;
4805
4836
  }({});
4837
+ /**
4838
+ * 数据源类型代码
4839
+ */ var constant_DATA_SOURCE_TYPE_CODE = /*#__PURE__*/ function(DATA_SOURCE_TYPE_CODE) {
4840
+ /**
4841
+ * 存储过程
4842
+ */ DATA_SOURCE_TYPE_CODE["STORAGE"] = "1";
4843
+ /**
4844
+ * JSON
4845
+ */ DATA_SOURCE_TYPE_CODE["JSON"] = "2";
4846
+ return DATA_SOURCE_TYPE_CODE;
4847
+ }({});
4806
4848
  // 添加图标导入
4807
4849
  /** 用于获取单据 */ const usePrintReceipt = (params, isInit = true)=>{
4808
4850
  const menuXReceiptList = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([]);
@@ -5141,8 +5183,15 @@ const createPrint = ()=>{
5141
5183
  }
5142
5184
  };
5143
5185
  /** 5.组织单据分单 */ const splitReceiptFn = async ()=>{
5144
- if (defaultContext.printParams?.designFlag === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.NO) //5
5145
- {
5186
+ if (defaultContext.printParams?.designFlag === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.NO) {
5187
+ if (defaultContext?.receiptInfo?.dataSourceTypeCode === constant_DATA_SOURCE_TYPE_CODE.JSON) {
5188
+ if (defaultContext.printParams?.dataSourceContentTypeCode !== constant_DATA_SOURCE_CONTENT_TYPE_CODE.JSON) {
5189
+ __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error("当前单据数据源类型为[JSON],请传入JSON数据源!");
5190
+ breakPrint = true;
5191
+ return;
5192
+ }
5193
+ }
5194
+ //5
5146
5195
  if (!defaultContext?.printParams?.dataSourceContent && (defaultContext?.receiptInfo?.invoiceFlag === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.NO || defaultContext?.receiptInfo?.invoiceFlag === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.YES && defaultContext?.printParams?.invoiceInfo?.invOperateTypeCode === constant_INV_OPERATE_TYPE_CODE.ISSUE)) await receiptSplitResultFn();
5147
5196
  }
5148
5197
  };
@@ -5325,6 +5374,10 @@ const createPrint = ()=>{
5325
5374
  defaultContext.dataSourceContentItem = ((res.data?.bizIssueList ?? [])[0].invoiceList ?? [])[0].eInvoiceH5Url;
5326
5375
  defaultContext.dataSourceContentTypeCodeItem = constant_DATA_SOURCE_CONTENT_TYPE_CODE.H5;
5327
5376
  }
5377
+ } else // 如果单据信息的数据源类型为JSON,则不调用接口
5378
+ if (defaultContext?.receiptInfo?.dataSourceTypeCode === constant_DATA_SOURCE_TYPE_CODE.JSON) {
5379
+ defaultContext.dataSourceContentItem = defaultContext?.receiptInfo?.designJson;
5380
+ defaultContext.dataSourceContentTypeCodeItem = constant_DATA_SOURCE_CONTENT_TYPE_CODE.JSON;
5328
5381
  } else {
5329
5382
  const [, res] = await queryReceiptDataSource({
5330
5383
  receiptId: defaultContext?.printParams?.receiptId,
@@ -7309,7 +7362,7 @@ const access_info_exports_ = access_infovue_type_script_setup_true_lang_ts_name_
7309
7362
  use_app_config_MAIN_APP_CONFIG.IS_CLOUD_ENV
7310
7363
  ]);
7311
7364
  function useGetDMLList() {
7312
- const dataSetList = use_fetch_dataset_useFetchDataset([
7365
+ const dataSetList = useFetchDataset([
7313
7366
  'HBI000.4001'
7314
7367
  ]);
7315
7368
  const dmlList = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>(dataSetList?.value?.['HBI000.4001'] || []).map((item)=>({
@@ -7399,7 +7452,7 @@ const access_info_exports_ = access_infovue_type_script_setup_true_lang_ts_name_
7399
7452
  const dml_button_exports_ = dml_buttonvue_type_script_setup_true_lang_ts;
7400
7453
  /* ESM default export */ const dml_button = dml_button_exports_;
7401
7454
  function useTableColumnsConfig(options) {
7402
- const { currentRow } = options;
7455
+ const { currentRow, updateCurrentNo } = options;
7403
7456
  const tableColumns = useColumnConfig({
7404
7457
  getData: ()=>[
7405
7458
  {
@@ -7424,12 +7477,18 @@ function useTableColumnsConfig(options) {
7424
7477
  render: (row)=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-button"), {
7425
7478
  type: "primary",
7426
7479
  link: true,
7427
- class: "underline"
7480
+ class: "underline",
7481
+ onClick: async (e)=>{
7482
+ await e.stopPropagation();
7483
+ await updateCurrentNo(row);
7484
+ }
7428
7485
  }, {
7429
7486
  default: ()=>[
7430
7487
  row.currentNo
7431
7488
  ]
7432
- })
7489
+ }, 8, [
7490
+ "onClick"
7491
+ ])
7433
7492
  },
7434
7493
  {
7435
7494
  label: "剩余票号",
@@ -7442,6 +7501,248 @@ function useTableColumnsConfig(options) {
7442
7501
  tableColumns
7443
7502
  };
7444
7503
  }
7504
+ var constant_REASON_USE_SCOPE_CODE = /*#__PURE__*/ function(REASON_USE_SCOPE_CODE) {
7505
+ /**
7506
+ * 调整票号
7507
+ */ REASON_USE_SCOPE_CODE["ADJUST_NUMBER"] = "13";
7508
+ return REASON_USE_SCOPE_CODE;
7509
+ }({});
7510
+ const THE_OTHER_REASON_ID = "1633928410185179136";
7511
+ /**
7512
+ * 1-10100-1 根据条件查询原因
7513
+ * @param code
7514
+ * @returns
7515
+ */ const queryReasonList = (code)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.dictRequest)("/reason/queryReasonByExample", {
7516
+ enabledFlag: __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.YES,
7517
+ reasonUseScopeCode: code
7518
+ });
7519
+ /**
7520
+ * 1-10100-1 根据条件查询原因
7521
+ * @param code
7522
+ * @returns
7523
+ */ const updateCurrentNoById = (params)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.basicRequest)("/invoicemanagement/updateCurrentNoById", params);
7524
+ function useInvoiceInfoFormConfig() {
7525
+ const data = useFormConfig({
7526
+ getData: ()=>[
7527
+ {
7528
+ label: "领用人",
7529
+ name: "invoiceUsingObjectName",
7530
+ component: "text"
7531
+ },
7532
+ {
7533
+ label: "票号段",
7534
+ name: "numNo",
7535
+ component: "text" // render: () => {
7536
+ },
7537
+ {
7538
+ label: "剩余票数",
7539
+ name: "residueCount",
7540
+ component: "text"
7541
+ },
7542
+ {
7543
+ label: "当前票号",
7544
+ name: "currentNo",
7545
+ component: "text"
7546
+ }
7547
+ ]
7548
+ });
7549
+ return data;
7550
+ }
7551
+ function useUpdateInvoiceFormConfig(options) {
7552
+ const { reasonList, updateModel } = options;
7553
+ const data = useFormConfig({
7554
+ getData: ()=>[
7555
+ {
7556
+ label: "调整后票号",
7557
+ name: "currentNo",
7558
+ component: "input",
7559
+ placeholder: "请输入调整后票号",
7560
+ rules: [
7561
+ {
7562
+ required: true,
7563
+ message: "请输入调整后票号",
7564
+ trigger: [
7565
+ "blur",
7566
+ "change"
7567
+ ]
7568
+ }
7569
+ ]
7570
+ },
7571
+ {
7572
+ label: "调整原因",
7573
+ name: "disableReasonId",
7574
+ component: "select",
7575
+ placeholder: "请选择调整原因",
7576
+ rules: [
7577
+ {
7578
+ required: true,
7579
+ message: "请选择调整原因",
7580
+ trigger: [
7581
+ "blur",
7582
+ "change"
7583
+ ]
7584
+ }
7585
+ ],
7586
+ extraProps: {
7587
+ options: reasonList.value,
7588
+ props: {
7589
+ label: "reasonName",
7590
+ value: "reasonId"
7591
+ }
7592
+ }
7593
+ },
7594
+ {
7595
+ label: "原因描述",
7596
+ name: "disableReasonDesc",
7597
+ component: "input",
7598
+ placeholder: "请输入原因描述",
7599
+ isHidden: updateModel.value?.disableReasonId !== THE_OTHER_REASON_ID,
7600
+ isFullWidth: true,
7601
+ rules: [
7602
+ {
7603
+ required: updateModel.value?.disableReasonId === THE_OTHER_REASON_ID,
7604
+ message: "请输入原因描述",
7605
+ trigger: [
7606
+ "blur",
7607
+ "change"
7608
+ ]
7609
+ }
7610
+ ],
7611
+ extraProps: {
7612
+ rows: 4,
7613
+ type: "textarea"
7614
+ }
7615
+ }
7616
+ ]
7617
+ });
7618
+ return data;
7619
+ }
7620
+ /* ESM default export */ const updateCurrentNovue_type_script_setup_true_lang_ts_name_updateDialog = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
7621
+ __name: 'updateCurrentNo',
7622
+ emits: [
7623
+ "success"
7624
+ ],
7625
+ setup (__props, { expose: __expose, emit: __emit }) {
7626
+ const dialogRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(); //dialogRef ref
7627
+ const reasonList = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([]); //原因list
7628
+ const reasonLoading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false); //原因list
7629
+ const formRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(); //formRef ref
7630
+ const originData = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
7631
+ const modelValue = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
7632
+ const updateModel = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)({
7633
+ currentNo: void 0,
7634
+ disableReasonId: void 0,
7635
+ disableReasonDesc: void 0
7636
+ });
7637
+ const emits = __emit;
7638
+ /** 初始化 */ const initData = async ()=>{
7639
+ modelValue.value = {
7640
+ invoiceUsingObjectName: originData.value?.invoiceUsingObjectName,
7641
+ numNo: originData.value?.beginNo || originData.value?.endNo ? (originData.value?.beginNo ?? "--") + " - " + (originData.value?.endNo ?? "--") : "--",
7642
+ beginNo: originData.value?.beginNo,
7643
+ endNo: originData.value?.endNo,
7644
+ residueCount: originData.value?.residueCount,
7645
+ currentNo: originData.value?.currentNo
7646
+ };
7647
+ updateModel.value = {
7648
+ currentNo: originData.value?.currentNo,
7649
+ disableReasonId: originData.value?.disableReasonId,
7650
+ disableReasonDesc: originData.value?.disableReasonId === THE_OTHER_REASON_ID ? originData.value?.disableReasonDesc : void 0
7651
+ };
7652
+ };
7653
+ /** 打开弹窗 */ const openDialog = async (row)=>{
7654
+ dialogRef.value.open();
7655
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.nextTick)(async ()=>{
7656
+ const loadingInstance = __WEBPACK_EXTERNAL_MODULE_element_sun__.ElLoading.service({
7657
+ target: ".dialog-container",
7658
+ fullscreen: true,
7659
+ text: "加载中..."
7660
+ });
7661
+ originData.value = row;
7662
+ await initData();
7663
+ await getReasonList();
7664
+ loadingInstance.close();
7665
+ });
7666
+ };
7667
+ /** 获取原因list */ const getReasonList = async ()=>{
7668
+ reasonLoading.value = true;
7669
+ const [, res] = await queryReasonList(constant_REASON_USE_SCOPE_CODE.ADJUST_NUMBER);
7670
+ reasonLoading.value = false;
7671
+ if (res?.success) reasonList.value = res?.data;
7672
+ };
7673
+ /** 提交 */ const confirmFn = async ()=>{
7674
+ const isValid = await formRef.value.ref.validate();
7675
+ if (isValid) return [];
7676
+ const params = {
7677
+ invoiceAllotId: originData.value?.invoiceAllotId,
7678
+ currentNo: updateModel.value?.currentNo,
7679
+ disableReasonId: updateModel.value?.disableReasonId,
7680
+ disableReasonDesc: updateModel.value?.disableReasonId === THE_OTHER_REASON_ID ? updateModel.value?.disableReasonDesc : void 0
7681
+ };
7682
+ const [error, res] = await updateCurrentNoById(params);
7683
+ return [
7684
+ error,
7685
+ res
7686
+ ];
7687
+ };
7688
+ const invoiceInfoConfig = useInvoiceInfoFormConfig();
7689
+ const updateInvoiceConfig = useUpdateInvoiceFormConfig({
7690
+ reasonList,
7691
+ updateModel
7692
+ });
7693
+ __expose({
7694
+ open: openDialog
7695
+ });
7696
+ return (_ctx, _cache)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(pro_dialog, {
7697
+ title: "修改票号",
7698
+ ref_key: "dialogRef",
7699
+ ref: dialogRef,
7700
+ "destroy-on-close": "",
7701
+ "close-on-click-modal": false,
7702
+ "close-on-press-escape": false,
7703
+ "confirm-fn": confirmFn,
7704
+ onSuccess: _cache[2] || (_cache[2] = ()=>{
7705
+ emits('success');
7706
+ formRef.value.value.ref?.resetFields();
7707
+ })
7708
+ }, {
7709
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7710
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(Title, {
7711
+ title: "票据信息",
7712
+ class: "mb-2.5"
7713
+ }),
7714
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(pro_form, {
7715
+ column: 3,
7716
+ modelValue: modelValue.value,
7717
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event)=>modelValue.value = $event),
7718
+ data: (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(invoiceInfoConfig),
7719
+ "label-suffix": " :"
7720
+ }, null, 8, [
7721
+ "modelValue",
7722
+ "data"
7723
+ ]),
7724
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(Title, {
7725
+ title: "调整票号",
7726
+ class: "mb-2.5"
7727
+ }),
7728
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(pro_form, {
7729
+ ref_key: "formRef",
7730
+ ref: formRef,
7731
+ column: 2,
7732
+ modelValue: updateModel.value,
7733
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event)=>updateModel.value = $event),
7734
+ data: (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(updateInvoiceConfig)
7735
+ }, null, 8, [
7736
+ "modelValue",
7737
+ "data"
7738
+ ])
7739
+ ]),
7740
+ _: 1
7741
+ }, 512));
7742
+ }
7743
+ });
7744
+ const updateCurrentNo_exports_ = updateCurrentNovue_type_script_setup_true_lang_ts_name_updateDialog;
7745
+ /* ESM default export */ const composables_updateCurrentNo = updateCurrentNo_exports_;
7445
7746
  const invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_1 = {
7446
7747
  class: "absolute left-[11px] top-2.5 -translate-x-1/2 -translate-y-1/2 rotate-[-42deg] bg-[#2468da] px-10 text-sm text-white scale-[0.8]"
7447
7748
  };
@@ -7469,17 +7770,22 @@ const invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4 = {
7469
7770
  setup (__props, { expose: __expose, emit: __emit }) {
7470
7771
  const props = __props;
7471
7772
  const emit = __emit;
7773
+ const timer = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(); //定时器
7774
+ const isClickOut = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(true); //是否允许点击外部关闭
7775
+ const isRefreshing = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false); //刷新按钮动画
7472
7776
  const visible = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false); //popover的显示隐藏控制
7473
7777
  const loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false); //加载状态
7474
7778
  const currentRow = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(); //选中行
7475
7779
  const tableData = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([]);
7476
7780
  const tableRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(); //table ref
7781
+ const updateRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(); //updateRef ref
7477
7782
  const popoverRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(); //popover ref
7478
7783
  const menuId = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>props.menuId);
7479
7784
  const invoiceUsageCode = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>props.invoiceUsageCode);
7480
7785
  // 展示
7481
7786
  const handleShow = ()=>{
7482
7787
  visible.value = true;
7788
+ refresh();
7483
7789
  };
7484
7790
  // 隐藏
7485
7791
  const handleHide = ()=>{
@@ -7489,6 +7795,9 @@ const invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4 = {
7489
7795
  invoiceListData: tableData.value
7490
7796
  });
7491
7797
  };
7798
+ /** 点击外部 */ const handleClickOutside = ()=>{
7799
+ if (isClickOut.value) handleHide();
7800
+ };
7492
7801
  // 获取票据列表
7493
7802
  const getInvoiceList = async ()=>{
7494
7803
  loading.value = true;
@@ -7536,8 +7845,24 @@ const invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4 = {
7536
7845
  }, 0);
7537
7846
  }
7538
7847
  });
7848
+ /** 修改票号 */ const updateCurrentNo = async (row)=>{
7849
+ updateRef.value.open(row);
7850
+ isClickOut.value = false;
7851
+ };
7852
+ /** 图标更新方法 */ const handleRefresh = async (e)=>{
7853
+ e.stopPropagation();
7854
+ isRefreshing.value = true;
7855
+ // 清除已有定时器
7856
+ if (timer.value) clearTimeout(timer.value);
7857
+ timer.value = setTimeout(()=>{
7858
+ refresh();
7859
+ isRefreshing.value = false;
7860
+ clearTimeout(timer.value);
7861
+ }, 1000);
7862
+ };
7539
7863
  const { tableColumns } = useTableColumnsConfig({
7540
- currentRow: currentRow
7864
+ currentRow: currentRow,
7865
+ updateCurrentNo
7541
7866
  });
7542
7867
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.onMounted)(async ()=>{
7543
7868
  await getInvoiceList();
@@ -7549,67 +7874,95 @@ const invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4 = {
7549
7874
  });
7550
7875
  return (_ctx, _cache)=>{
7551
7876
  const _component_el_button = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-button");
7552
- return (0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElPopover), {
7553
- width: "auto",
7554
- trigger: "click",
7555
- visible: visible.value,
7556
- "show-arrow": false,
7557
- placement: "bottom-start"
7558
- }, {
7559
- reference: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7560
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", {
7561
- class: "relative overflow-hidden bg-[#EAEEFE] rounded",
7562
- onClick: handleShow,
7563
- ref_key: "popoverRef",
7564
- ref: popoverRef
7565
- }, [
7566
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_1, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(currentRow.value?.invoiceMediaTypeDesc ?? "--"), 1),
7567
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(_component_el_button, {
7568
- class: "border-[#2468DA] bg-[#EAEEFE]"
7569
- }, {
7570
- default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7571
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_2, [
7572
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_3, "当前票号 " + (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(currentRow.value?.currentNo ?? "--"), 1),
7573
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", null, "剩余张数 " + (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(currentRow.value?.residueCount ?? "--"), 1)
7574
- ])
7575
- ]),
7576
- _: 1
7577
- })
7578
- ], 512)
7579
- ]),
7580
- default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7581
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4, [
7582
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives)((0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(pro_table), {
7583
- ref_key: "tableRef",
7584
- ref: tableRef,
7585
- data: tableData.value,
7586
- loading: loading.value,
7587
- columns: (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(tableColumns),
7588
- "row-key": "invoiceAllotId",
7589
- "highlight-current-row": "",
7590
- onRowClick: _cache[0] || (_cache[0] = (row)=>{
7591
- currentRow.value = {
7592
- ...row
7593
- };
7594
- handleHide();
7595
- }),
7596
- onCurrentChange: setCurrentRow
7597
- }, null, 8, [
7598
- "data",
7599
- "loading",
7600
- "columns"
7601
- ]), [
7602
- [
7603
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ClickOutside),
7604
- handleHide
7605
- ]
7877
+ return (0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, [
7878
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElPopover), {
7879
+ width: "auto",
7880
+ trigger: "click",
7881
+ visible: visible.value,
7882
+ "show-arrow": false,
7883
+ placement: "bottom-start"
7884
+ }, {
7885
+ reference: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7886
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", {
7887
+ class: "relative overflow-hidden bg-[#EAEEFE] rounded",
7888
+ onClick: handleShow,
7889
+ ref_key: "popoverRef",
7890
+ ref: popoverRef
7891
+ }, [
7892
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_1, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(currentRow.value?.invoiceMediaTypeDesc ?? "--"), 1),
7893
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(_component_el_button, {
7894
+ class: "border-[#2468DA] bg-[#EAEEFE]"
7895
+ }, {
7896
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7897
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_2, [
7898
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_3, "当前票号 " + (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(currentRow.value?.currentNo ?? "--"), 1),
7899
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", null, "剩余张数 " + (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(currentRow.value?.residueCount ?? "--"), 1),
7900
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElIcon), {
7901
+ size: 20,
7902
+ onClick: handleRefresh,
7903
+ class: "pl-1"
7904
+ }, {
7905
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7906
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE__element_sun_icons_vue__.RefreshRight), {
7907
+ class: (0, __WEBPACK_EXTERNAL_MODULE_vue__.normalizeClass)({
7908
+ 'animate-spin': isRefreshing.value
7909
+ })
7910
+ }, null, 8, [
7911
+ "class"
7912
+ ])
7913
+ ]),
7914
+ _: 1
7915
+ })
7916
+ ])
7917
+ ]),
7918
+ _: 1
7919
+ })
7920
+ ], 512)
7921
+ ]),
7922
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7923
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4, [
7924
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives)((0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(pro_table), {
7925
+ ref_key: "tableRef",
7926
+ ref: tableRef,
7927
+ data: tableData.value,
7928
+ loading: loading.value,
7929
+ columns: (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(tableColumns),
7930
+ "row-key": "invoiceAllotId",
7931
+ "highlight-current-row": "",
7932
+ onRowClick: _cache[0] || (_cache[0] = (row)=>{
7933
+ currentRow.value = {
7934
+ ...row
7935
+ };
7936
+ handleHide();
7937
+ }),
7938
+ onCurrentChange: setCurrentRow
7939
+ }, null, 8, [
7940
+ "data",
7941
+ "loading",
7942
+ "columns"
7943
+ ]), [
7944
+ [
7945
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ClickOutside),
7946
+ handleClickOutside
7947
+ ]
7948
+ ])
7606
7949
  ])
7607
- ])
7608
- ]),
7609
- _: 1
7610
- }, 8, [
7611
- "visible"
7612
- ]);
7950
+ ]),
7951
+ _: 1
7952
+ }, 8, [
7953
+ "visible"
7954
+ ]),
7955
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(composables_updateCurrentNo, {
7956
+ ref_key: "updateRef",
7957
+ ref: updateRef,
7958
+ onClose: _cache[1] || (_cache[1] = ($event)=>isClickOut.value = true),
7959
+ onCancel: _cache[2] || (_cache[2] = ($event)=>isClickOut.value = true),
7960
+ onSuccess: _cache[3] || (_cache[3] = async ()=>{
7961
+ isClickOut.value = true;
7962
+ await refresh();
7963
+ })
7964
+ }, null, 512)
7965
+ ], 64);
7613
7966
  };
7614
7967
  }
7615
7968
  });