sun-biz 0.0.4-beta.2 → 0.0.4-beta.4

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;
@@ -3462,10 +3462,17 @@ function useSelectByDirectionEvent(options) {
3462
3462
  });
3463
3463
  }
3464
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
+ }
3465
3472
  function useColumnConfig(options) {
3466
3473
  const { t } = (0, __WEBPACK_EXTERNAL_MODULE_i18next_vue__.useTranslation)();
3467
3474
  const { getData, dataSetCodes } = options;
3468
- const dataSet = use_fetch_dataset_useFetchDataset(dataSetCodes);
3475
+ const dataSet = useFetchDataset(dataSetCodes);
3469
3476
  const data = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>getData(t, dataSet));
3470
3477
  return data;
3471
3478
  }
@@ -4827,6 +4834,17 @@ var constant_DATA_SOURCE_CONTENT_TYPE_CODE = /*#__PURE__*/ function(DATA_SOURCE_
4827
4834
  */ DATA_SOURCE_CONTENT_TYPE_CODE["BASE64"] = "BASE64";
4828
4835
  return DATA_SOURCE_CONTENT_TYPE_CODE;
4829
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
+ }({});
4830
4848
  // 添加图标导入
4831
4849
  /** 用于获取单据 */ const usePrintReceipt = (params, isInit = true)=>{
4832
4850
  const menuXReceiptList = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([]);
@@ -4947,7 +4965,10 @@ var constant_DATA_SOURCE_CONTENT_TYPE_CODE = /*#__PURE__*/ function(DATA_SOURCE_
4947
4965
  options.onCancel?.(); // 触发取消回调
4948
4966
  closeDialog();
4949
4967
  },
4950
- class: isFullscreen.value ? "custom-dialog custom-dialog__bodyContent" : "custom-dialog"
4968
+ class: isFullscreen.value ? "custom-dialog custom-dialog__bodyContent" : "custom-dialog",
4969
+ "close-on-click-modal": false,
4970
+ "close-on-press-escape": false,
4971
+ "destroy-on-close": true
4951
4972
  }, {
4952
4973
  header: ()=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.h)("div", {}, [
4953
4974
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.h)("span", {}, title),
@@ -5165,8 +5186,15 @@ const createPrint = ()=>{
5165
5186
  }
5166
5187
  };
5167
5188
  /** 5.组织单据分单 */ const splitReceiptFn = async ()=>{
5168
- if (defaultContext.printParams?.designFlag === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.NO) //5
5169
- {
5189
+ if (defaultContext.printParams?.designFlag === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.NO) {
5190
+ if (defaultContext?.receiptInfo?.dataSourceTypeCode === constant_DATA_SOURCE_TYPE_CODE.JSON) {
5191
+ if (defaultContext.printParams?.dataSourceContentTypeCode !== constant_DATA_SOURCE_CONTENT_TYPE_CODE.JSON) {
5192
+ __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error("当前单据数据源类型为[JSON],请传入JSON数据源!");
5193
+ breakPrint = true;
5194
+ return;
5195
+ }
5196
+ }
5197
+ //5
5170
5198
  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();
5171
5199
  }
5172
5200
  };
@@ -5349,6 +5377,10 @@ const createPrint = ()=>{
5349
5377
  defaultContext.dataSourceContentItem = ((res.data?.bizIssueList ?? [])[0].invoiceList ?? [])[0].eInvoiceH5Url;
5350
5378
  defaultContext.dataSourceContentTypeCodeItem = constant_DATA_SOURCE_CONTENT_TYPE_CODE.H5;
5351
5379
  }
5380
+ } else // 如果单据信息的数据源类型为JSON,则不调用接口
5381
+ if (defaultContext?.receiptInfo?.dataSourceTypeCode === constant_DATA_SOURCE_TYPE_CODE.JSON) {
5382
+ defaultContext.dataSourceContentItem = defaultContext?.receiptInfo?.designJson;
5383
+ defaultContext.dataSourceContentTypeCodeItem = constant_DATA_SOURCE_CONTENT_TYPE_CODE.JSON;
5352
5384
  } else {
5353
5385
  const [, res] = await queryReceiptDataSource({
5354
5386
  receiptId: defaultContext?.printParams?.receiptId,
@@ -7333,7 +7365,7 @@ const access_info_exports_ = access_infovue_type_script_setup_true_lang_ts_name_
7333
7365
  use_app_config_MAIN_APP_CONFIG.IS_CLOUD_ENV
7334
7366
  ]);
7335
7367
  function useGetDMLList() {
7336
- const dataSetList = use_fetch_dataset_useFetchDataset([
7368
+ const dataSetList = useFetchDataset([
7337
7369
  'HBI000.4001'
7338
7370
  ]);
7339
7371
  const dmlList = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>(dataSetList?.value?.['HBI000.4001'] || []).map((item)=>({
@@ -7423,7 +7455,7 @@ const access_info_exports_ = access_infovue_type_script_setup_true_lang_ts_name_
7423
7455
  const dml_button_exports_ = dml_buttonvue_type_script_setup_true_lang_ts;
7424
7456
  /* ESM default export */ const dml_button = dml_button_exports_;
7425
7457
  function useTableColumnsConfig(options) {
7426
- const { currentRow } = options;
7458
+ const { currentRow, updateCurrentNo } = options;
7427
7459
  const tableColumns = useColumnConfig({
7428
7460
  getData: ()=>[
7429
7461
  {
@@ -7448,12 +7480,18 @@ function useTableColumnsConfig(options) {
7448
7480
  render: (row)=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-button"), {
7449
7481
  type: "primary",
7450
7482
  link: true,
7451
- class: "underline"
7483
+ class: "underline",
7484
+ onClick: async (e)=>{
7485
+ await e.stopPropagation();
7486
+ await updateCurrentNo(row);
7487
+ }
7452
7488
  }, {
7453
7489
  default: ()=>[
7454
7490
  row.currentNo
7455
7491
  ]
7456
- })
7492
+ }, 8, [
7493
+ "onClick"
7494
+ ])
7457
7495
  },
7458
7496
  {
7459
7497
  label: "剩余票号",
@@ -7466,6 +7504,248 @@ function useTableColumnsConfig(options) {
7466
7504
  tableColumns
7467
7505
  };
7468
7506
  }
7507
+ var constant_REASON_USE_SCOPE_CODE = /*#__PURE__*/ function(REASON_USE_SCOPE_CODE) {
7508
+ /**
7509
+ * 调整票号
7510
+ */ REASON_USE_SCOPE_CODE["ADJUST_NUMBER"] = "13";
7511
+ return REASON_USE_SCOPE_CODE;
7512
+ }({});
7513
+ const THE_OTHER_REASON_ID = "1633928410185179136";
7514
+ /**
7515
+ * 1-10100-1 根据条件查询原因
7516
+ * @param code
7517
+ * @returns
7518
+ */ const queryReasonList = (code)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.dictRequest)("/reason/queryReasonByExample", {
7519
+ enabledFlag: __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.YES,
7520
+ reasonUseScopeCode: code
7521
+ });
7522
+ /**
7523
+ * 1-10100-1 根据条件查询原因
7524
+ * @param code
7525
+ * @returns
7526
+ */ const updateCurrentNoById = (params)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.basicRequest)("/invoicemanagement/updateCurrentNoById", params);
7527
+ function useInvoiceInfoFormConfig() {
7528
+ const data = useFormConfig({
7529
+ getData: ()=>[
7530
+ {
7531
+ label: "领用人",
7532
+ name: "invoiceUsingObjectName",
7533
+ component: "text"
7534
+ },
7535
+ {
7536
+ label: "票号段",
7537
+ name: "numNo",
7538
+ component: "text" // render: () => {
7539
+ },
7540
+ {
7541
+ label: "剩余票数",
7542
+ name: "residueCount",
7543
+ component: "text"
7544
+ },
7545
+ {
7546
+ label: "当前票号",
7547
+ name: "currentNo",
7548
+ component: "text"
7549
+ }
7550
+ ]
7551
+ });
7552
+ return data;
7553
+ }
7554
+ function useUpdateInvoiceFormConfig(options) {
7555
+ const { reasonList, updateModel } = options;
7556
+ const data = useFormConfig({
7557
+ getData: ()=>[
7558
+ {
7559
+ label: "调整后票号",
7560
+ name: "currentNo",
7561
+ component: "input",
7562
+ placeholder: "请输入调整后票号",
7563
+ rules: [
7564
+ {
7565
+ required: true,
7566
+ message: "请输入调整后票号",
7567
+ trigger: [
7568
+ "blur",
7569
+ "change"
7570
+ ]
7571
+ }
7572
+ ]
7573
+ },
7574
+ {
7575
+ label: "调整原因",
7576
+ name: "disableReasonId",
7577
+ component: "select",
7578
+ placeholder: "请选择调整原因",
7579
+ rules: [
7580
+ {
7581
+ required: true,
7582
+ message: "请选择调整原因",
7583
+ trigger: [
7584
+ "blur",
7585
+ "change"
7586
+ ]
7587
+ }
7588
+ ],
7589
+ extraProps: {
7590
+ options: reasonList.value,
7591
+ props: {
7592
+ label: "reasonName",
7593
+ value: "reasonId"
7594
+ }
7595
+ }
7596
+ },
7597
+ {
7598
+ label: "原因描述",
7599
+ name: "disableReasonDesc",
7600
+ component: "input",
7601
+ placeholder: "请输入原因描述",
7602
+ isHidden: updateModel.value?.disableReasonId !== THE_OTHER_REASON_ID,
7603
+ isFullWidth: true,
7604
+ rules: [
7605
+ {
7606
+ required: updateModel.value?.disableReasonId === THE_OTHER_REASON_ID,
7607
+ message: "请输入原因描述",
7608
+ trigger: [
7609
+ "blur",
7610
+ "change"
7611
+ ]
7612
+ }
7613
+ ],
7614
+ extraProps: {
7615
+ rows: 4,
7616
+ type: "textarea"
7617
+ }
7618
+ }
7619
+ ]
7620
+ });
7621
+ return data;
7622
+ }
7623
+ /* ESM default export */ const updateCurrentNovue_type_script_setup_true_lang_ts_name_updateDialog = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
7624
+ __name: 'updateCurrentNo',
7625
+ emits: [
7626
+ "success"
7627
+ ],
7628
+ setup (__props, { expose: __expose, emit: __emit }) {
7629
+ const dialogRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(); //dialogRef ref
7630
+ const reasonList = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([]); //原因list
7631
+ const reasonLoading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false); //原因list
7632
+ const formRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(); //formRef ref
7633
+ const originData = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
7634
+ const modelValue = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
7635
+ const updateModel = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)({
7636
+ currentNo: void 0,
7637
+ disableReasonId: void 0,
7638
+ disableReasonDesc: void 0
7639
+ });
7640
+ const emits = __emit;
7641
+ /** 初始化 */ const initData = async ()=>{
7642
+ modelValue.value = {
7643
+ invoiceUsingObjectName: originData.value?.invoiceUsingObjectName,
7644
+ numNo: originData.value?.beginNo || originData.value?.endNo ? (originData.value?.beginNo ?? "--") + " - " + (originData.value?.endNo ?? "--") : "--",
7645
+ beginNo: originData.value?.beginNo,
7646
+ endNo: originData.value?.endNo,
7647
+ residueCount: originData.value?.residueCount,
7648
+ currentNo: originData.value?.currentNo
7649
+ };
7650
+ updateModel.value = {
7651
+ currentNo: originData.value?.currentNo,
7652
+ disableReasonId: originData.value?.disableReasonId,
7653
+ disableReasonDesc: originData.value?.disableReasonId === THE_OTHER_REASON_ID ? originData.value?.disableReasonDesc : void 0
7654
+ };
7655
+ };
7656
+ /** 打开弹窗 */ const openDialog = async (row)=>{
7657
+ dialogRef.value.open();
7658
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.nextTick)(async ()=>{
7659
+ const loadingInstance = __WEBPACK_EXTERNAL_MODULE_element_sun__.ElLoading.service({
7660
+ target: ".dialog-container",
7661
+ fullscreen: true,
7662
+ text: "加载中..."
7663
+ });
7664
+ originData.value = row;
7665
+ await initData();
7666
+ await getReasonList();
7667
+ loadingInstance.close();
7668
+ });
7669
+ };
7670
+ /** 获取原因list */ const getReasonList = async ()=>{
7671
+ reasonLoading.value = true;
7672
+ const [, res] = await queryReasonList(constant_REASON_USE_SCOPE_CODE.ADJUST_NUMBER);
7673
+ reasonLoading.value = false;
7674
+ if (res?.success) reasonList.value = res?.data;
7675
+ };
7676
+ /** 提交 */ const confirmFn = async ()=>{
7677
+ const isValid = await formRef.value.ref.validate();
7678
+ if (!isValid) return [];
7679
+ const params = {
7680
+ invoiceAllotId: originData.value?.invoiceAllotId,
7681
+ currentNo: updateModel.value?.currentNo,
7682
+ disableReasonId: updateModel.value?.disableReasonId,
7683
+ disableReasonDesc: updateModel.value?.disableReasonId === THE_OTHER_REASON_ID ? updateModel.value?.disableReasonDesc : void 0
7684
+ };
7685
+ const [error, res] = await updateCurrentNoById(params);
7686
+ return [
7687
+ error,
7688
+ res
7689
+ ];
7690
+ };
7691
+ const invoiceInfoConfig = useInvoiceInfoFormConfig();
7692
+ const updateInvoiceConfig = useUpdateInvoiceFormConfig({
7693
+ reasonList,
7694
+ updateModel
7695
+ });
7696
+ __expose({
7697
+ open: openDialog
7698
+ });
7699
+ return (_ctx, _cache)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(pro_dialog, {
7700
+ title: "修改票号",
7701
+ ref_key: "dialogRef",
7702
+ ref: dialogRef,
7703
+ "destroy-on-close": "",
7704
+ "close-on-click-modal": false,
7705
+ "close-on-press-escape": false,
7706
+ "confirm-fn": confirmFn,
7707
+ onSuccess: _cache[2] || (_cache[2] = ()=>{
7708
+ emits('success');
7709
+ formRef.value.ref?.resetFields();
7710
+ })
7711
+ }, {
7712
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7713
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(Title, {
7714
+ title: "票据信息",
7715
+ class: "mb-2.5"
7716
+ }),
7717
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(pro_form, {
7718
+ column: 3,
7719
+ modelValue: modelValue.value,
7720
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event)=>modelValue.value = $event),
7721
+ data: (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(invoiceInfoConfig),
7722
+ "label-suffix": " :"
7723
+ }, null, 8, [
7724
+ "modelValue",
7725
+ "data"
7726
+ ]),
7727
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(Title, {
7728
+ title: "调整票号",
7729
+ class: "mb-2.5"
7730
+ }),
7731
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(pro_form, {
7732
+ ref_key: "formRef",
7733
+ ref: formRef,
7734
+ column: 2,
7735
+ modelValue: updateModel.value,
7736
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event)=>updateModel.value = $event),
7737
+ data: (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(updateInvoiceConfig)
7738
+ }, null, 8, [
7739
+ "modelValue",
7740
+ "data"
7741
+ ])
7742
+ ]),
7743
+ _: 1
7744
+ }, 512));
7745
+ }
7746
+ });
7747
+ const updateCurrentNo_exports_ = updateCurrentNovue_type_script_setup_true_lang_ts_name_updateDialog;
7748
+ /* ESM default export */ const composables_updateCurrentNo = updateCurrentNo_exports_;
7469
7749
  const invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_1 = {
7470
7750
  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]"
7471
7751
  };
@@ -7493,17 +7773,22 @@ const invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4 = {
7493
7773
  setup (__props, { expose: __expose, emit: __emit }) {
7494
7774
  const props = __props;
7495
7775
  const emit = __emit;
7776
+ const timer = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(); //定时器
7777
+ const isClickOut = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(true); //是否允许点击外部关闭
7778
+ const isRefreshing = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false); //刷新按钮动画
7496
7779
  const visible = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false); //popover的显示隐藏控制
7497
7780
  const loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false); //加载状态
7498
7781
  const currentRow = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(); //选中行
7499
7782
  const tableData = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([]);
7500
7783
  const tableRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(); //table ref
7784
+ const updateRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(); //updateRef ref
7501
7785
  const popoverRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(); //popover ref
7502
7786
  const menuId = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>props.menuId);
7503
7787
  const invoiceUsageCode = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>props.invoiceUsageCode);
7504
7788
  // 展示
7505
7789
  const handleShow = ()=>{
7506
7790
  visible.value = true;
7791
+ refresh();
7507
7792
  };
7508
7793
  // 隐藏
7509
7794
  const handleHide = ()=>{
@@ -7513,6 +7798,9 @@ const invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4 = {
7513
7798
  invoiceListData: tableData.value
7514
7799
  });
7515
7800
  };
7801
+ /** 点击外部 */ const handleClickOutside = ()=>{
7802
+ if (isClickOut.value) handleHide();
7803
+ };
7516
7804
  // 获取票据列表
7517
7805
  const getInvoiceList = async ()=>{
7518
7806
  loading.value = true;
@@ -7560,8 +7848,24 @@ const invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4 = {
7560
7848
  }, 0);
7561
7849
  }
7562
7850
  });
7851
+ /** 修改票号 */ const updateCurrentNo = async (row)=>{
7852
+ updateRef.value.open(row);
7853
+ isClickOut.value = false;
7854
+ };
7855
+ /** 图标更新方法 */ const handleRefresh = async (e)=>{
7856
+ e.stopPropagation();
7857
+ isRefreshing.value = true;
7858
+ // 清除已有定时器
7859
+ if (timer.value) clearTimeout(timer.value);
7860
+ timer.value = setTimeout(()=>{
7861
+ refresh();
7862
+ isRefreshing.value = false;
7863
+ clearTimeout(timer.value);
7864
+ }, 1000);
7865
+ };
7563
7866
  const { tableColumns } = useTableColumnsConfig({
7564
- currentRow: currentRow
7867
+ currentRow: currentRow,
7868
+ updateCurrentNo
7565
7869
  });
7566
7870
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.onMounted)(async ()=>{
7567
7871
  await getInvoiceList();
@@ -7573,67 +7877,95 @@ const invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4 = {
7573
7877
  });
7574
7878
  return (_ctx, _cache)=>{
7575
7879
  const _component_el_button = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-button");
7576
- 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), {
7577
- width: "auto",
7578
- trigger: "click",
7579
- visible: visible.value,
7580
- "show-arrow": false,
7581
- placement: "bottom-start"
7582
- }, {
7583
- reference: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7584
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", {
7585
- class: "relative overflow-hidden bg-[#EAEEFE] rounded",
7586
- onClick: handleShow,
7587
- ref_key: "popoverRef",
7588
- ref: popoverRef
7589
- }, [
7590
- (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),
7591
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(_component_el_button, {
7592
- class: "border-[#2468DA] bg-[#EAEEFE]"
7593
- }, {
7594
- default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7595
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_2, [
7596
- (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),
7597
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", null, "剩余张数 " + (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(currentRow.value?.residueCount ?? "--"), 1)
7598
- ])
7599
- ]),
7600
- _: 1
7601
- })
7602
- ], 512)
7603
- ]),
7604
- default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7605
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4, [
7606
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives)((0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(pro_table), {
7607
- ref_key: "tableRef",
7608
- ref: tableRef,
7609
- data: tableData.value,
7610
- loading: loading.value,
7611
- columns: (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(tableColumns),
7612
- "row-key": "invoiceAllotId",
7613
- "highlight-current-row": "",
7614
- onRowClick: _cache[0] || (_cache[0] = (row)=>{
7615
- currentRow.value = {
7616
- ...row
7617
- };
7618
- handleHide();
7619
- }),
7620
- onCurrentChange: setCurrentRow
7621
- }, null, 8, [
7622
- "data",
7623
- "loading",
7624
- "columns"
7625
- ]), [
7626
- [
7627
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ClickOutside),
7628
- handleHide
7629
- ]
7880
+ return (0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, [
7881
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElPopover), {
7882
+ width: "auto",
7883
+ trigger: "click",
7884
+ visible: visible.value,
7885
+ "show-arrow": false,
7886
+ placement: "bottom-start"
7887
+ }, {
7888
+ reference: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7889
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", {
7890
+ class: "relative overflow-hidden bg-[#EAEEFE] rounded",
7891
+ onClick: handleShow,
7892
+ ref_key: "popoverRef",
7893
+ ref: popoverRef
7894
+ }, [
7895
+ (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),
7896
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(_component_el_button, {
7897
+ class: "border-[#2468DA] bg-[#EAEEFE]"
7898
+ }, {
7899
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7900
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_2, [
7901
+ (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),
7902
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", null, "剩余张数 " + (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(currentRow.value?.residueCount ?? "--"), 1),
7903
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElIcon), {
7904
+ size: 20,
7905
+ onClick: handleRefresh,
7906
+ class: "pl-1"
7907
+ }, {
7908
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7909
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE__element_sun_icons_vue__.RefreshRight), {
7910
+ class: (0, __WEBPACK_EXTERNAL_MODULE_vue__.normalizeClass)({
7911
+ 'animate-spin': isRefreshing.value
7912
+ })
7913
+ }, null, 8, [
7914
+ "class"
7915
+ ])
7916
+ ]),
7917
+ _: 1
7918
+ })
7919
+ ])
7920
+ ]),
7921
+ _: 1
7922
+ })
7923
+ ], 512)
7924
+ ]),
7925
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
7926
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4, [
7927
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives)((0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(pro_table), {
7928
+ ref_key: "tableRef",
7929
+ ref: tableRef,
7930
+ data: tableData.value,
7931
+ loading: loading.value,
7932
+ columns: (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(tableColumns),
7933
+ "row-key": "invoiceAllotId",
7934
+ "highlight-current-row": "",
7935
+ onRowClick: _cache[0] || (_cache[0] = (row)=>{
7936
+ currentRow.value = {
7937
+ ...row
7938
+ };
7939
+ handleHide();
7940
+ }),
7941
+ onCurrentChange: setCurrentRow
7942
+ }, null, 8, [
7943
+ "data",
7944
+ "loading",
7945
+ "columns"
7946
+ ]), [
7947
+ [
7948
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ClickOutside),
7949
+ handleClickOutside
7950
+ ]
7951
+ ])
7630
7952
  ])
7631
- ])
7632
- ]),
7633
- _: 1
7634
- }, 8, [
7635
- "visible"
7636
- ]);
7953
+ ]),
7954
+ _: 1
7955
+ }, 8, [
7956
+ "visible"
7957
+ ]),
7958
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(composables_updateCurrentNo, {
7959
+ ref_key: "updateRef",
7960
+ ref: updateRef,
7961
+ onClose: _cache[1] || (_cache[1] = ($event)=>isClickOut.value = true),
7962
+ onCancel: _cache[2] || (_cache[2] = ($event)=>isClickOut.value = true),
7963
+ onSuccess: _cache[3] || (_cache[3] = async ()=>{
7964
+ isClickOut.value = true;
7965
+ await refresh();
7966
+ })
7967
+ }, null, 512)
7968
+ ], 64);
7637
7969
  };
7638
7970
  }
7639
7971
  });