verce-vue-test 0.0.63 → 0.0.65

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.
@@ -23,7 +23,7 @@ const { cardLayout } = storeToRefs(forecastInfoStore)
23
23
 
24
24
  <template>
25
25
  <!-- 水平布局使用两列;垂直布局由公共样式切换为两行等高卡片。 -->
26
- <main class="forecast-info-page" :class="{ 'forecast-info-page--horizontal': cardLayout === 'horizontal' }">
26
+ <div class="forecast-info-page" :class="{ 'forecast-info-page--horizontal': cardLayout === 'horizontal' }">
27
27
  <!-- 两个面板接收同一布局值,保证任一入口切换后页面整体保持一致。 -->
28
28
  <ForecastInfoPanel
29
29
  :layout="cardLayout"
@@ -35,5 +35,5 @@ const { cardLayout } = storeToRefs(forecastInfoStore)
35
35
  :layout-options="layoutOptions"
36
36
  @change-layout="forecastInfoStore.setCardLayout"
37
37
  />
38
- </main>
38
+ </div>
39
39
  </template>
@@ -205,6 +205,36 @@ export type ForecastInfoOperationResult = {
205
205
  message: string
206
206
  }
207
207
 
208
+ /** 核销接口中的单条预报信息入参。 */
209
+ export type VerificationPredItem = {
210
+ /** 预报金额。 */
211
+ predAmt: string
212
+ /** 预报流水号。 */
213
+ predRefNo: string
214
+ /** 核销金额。 */
215
+ verifyAmt: string
216
+ /** 核销状态。 */
217
+ verifyStatus: string
218
+ }
219
+
220
+ /** 核销接口中的单条流水信息入参。 */
221
+ export type VerificationTranItem = {
222
+ /** 交易金额。 */
223
+ amt: string
224
+ /** 流水号。 */
225
+ refNo: string
226
+ /** 核销状态。 */
227
+ verifyStatus: string
228
+ }
229
+
230
+ /** 核销与撤销核销共用的接口请求体。 */
231
+ export type VerificationRequestParams = {
232
+ /** 已选预报信息;核销操作至少包含一条。 */
233
+ predList: VerificationPredItem[]
234
+ /** 已选流水信息;预报可单独核销时允许为空数组。 */
235
+ tranList: VerificationTranItem[]
236
+ }
237
+
208
238
  // ---- 模拟接口数据 ----
209
239
 
210
240
  /**
@@ -691,6 +721,11 @@ function isVerified(row: { verifyStatus?: string }) {
691
721
  return String(row.verifyStatus ?? '').trim() === '2'
692
722
  }
693
723
 
724
+ /** 将后端可选字段转换为请求体要求的字符串,避免传出 undefined。 */
725
+ function toRequestText(value: unknown) {
726
+ return value === null || value === undefined ? '' : String(value)
727
+ }
728
+
694
729
  export const useForecastInfoStore = defineStore('forecastInfo', () => {
695
730
  // ---- 页面共享状态 ----
696
731
 
@@ -864,6 +899,26 @@ export const useForecastInfoStore = defineStore('forecastInfo', () => {
864
899
  return { success: true, message: '' }
865
900
  }
866
901
 
902
+ /**
903
+ * 从 Pinia 共享的多选状态构造核销接口入参。
904
+ * 这里不复用完整表格行,避免接口请求携带无关展示字段;真实接口可直接使用返回值。
905
+ */
906
+ function buildVerificationRequestParams(): VerificationRequestParams {
907
+ return {
908
+ predList: forecastSelectedRows.value.map((row) => ({
909
+ predAmt: toRequestText(row.predAmt),
910
+ predRefNo: toRequestText(row.predRefNo),
911
+ verifyAmt: toRequestText(row.verifyAmt),
912
+ verifyStatus: toRequestText(row.verifyStatus),
913
+ })),
914
+ tranList: flowSelectedRows.value.map((row) => ({
915
+ amt: toRequestText(row.amt),
916
+ refNo: toRequestText(row.refNo),
917
+ verifyStatus: toRequestText(row.verifyStatus),
918
+ })),
919
+ }
920
+ }
921
+
867
922
  /**
868
923
  * 校验预报信息及其已选流水信息的核销操作。
869
924
  * 真实核销接口接入时,在校验通过后调用接口,并在成功后同步两张表的关联数据。
@@ -904,10 +959,8 @@ export const useForecastInfoStore = defineStore('forecastInfo', () => {
904
959
 
905
960
  /** 预报信息核销按钮的统一业务入口。 */
906
961
  function handleForecastVerify() {
907
- console.log('核销选中数据', {
908
- forecastInfo: forecastSelectedRows.value,
909
- flowInfo: flowSelectedRows.value,
910
- })
962
+ const params = buildVerificationRequestParams()
963
+ console.log('核销入参', params)
911
964
 
912
965
  const result = verifySelectedForecastRows()
913
966
  if (result.success) {
@@ -921,10 +974,8 @@ export const useForecastInfoStore = defineStore('forecastInfo', () => {
921
974
 
922
975
  /** 预报信息撤销核销按钮的统一业务入口。 */
923
976
  function handleForecastCancelVerify() {
924
- console.log('撤销核销选中数据', {
925
- forecastInfo: forecastSelectedRows.value,
926
- flowInfo: flowSelectedRows.value,
927
- })
977
+ const params = buildVerificationRequestParams()
978
+ console.log('撤销核销入参', params)
928
979
 
929
980
  const result = cancelVerifySelectedForecastRows()
930
981
  if (result.success) {
@@ -1022,6 +1073,7 @@ export const useForecastInfoStore = defineStore('forecastInfo', () => {
1022
1073
  // ----预报信息-----
1023
1074
  handleForecastSelectionChange,
1024
1075
  calculateSelectedSummary,
1076
+ buildVerificationRequestParams,
1025
1077
  verifySelectedForecastRows,
1026
1078
  cancelVerifySelectedForecastRows,
1027
1079
  handleCalculationSummary,